@capillarytech/creatives-library 1.0.2 → 2.0.0
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 +54 -112
- package/assets/loading_img.gif +0 -0
- package/components/BreadCrumbs/index.js +65 -0
- package/components/BreadCrumbs/messages.js +13 -0
- package/components/BreadCrumbs/tests/index.test.js +10 -0
- package/components/CapTagList/index.js +233 -0
- package/components/CapTagList/messages.js +25 -0
- package/components/CapTagList/tests/index.test.js +10 -0
- package/components/Card/_customCard.scss +35 -0
- package/components/Card/index.js +78 -0
- package/components/Card/tests/index.test.js +10 -0
- package/components/CardGrid/index.js +71 -0
- package/components/CardGrid/tests/index.test.js +10 -0
- package/components/Ckeditor/index.js +206 -0
- package/components/Ckeditor/messages.js +13 -0
- package/components/Ckeditor/tests/index.test.js +10 -0
- package/components/Component/index.js +29 -0
- package/components/Component/tests/index.test.js +10 -0
- package/components/CustomPopOver/index.js +82 -0
- package/components/CustomPopOver/messages.js +13 -0
- package/components/CustomPopOver/tests/index.test.js +10 -0
- package/components/DateFilter/index.js +349 -0
- package/components/DateFilter/messages.js +17 -0
- package/components/DateFilter/tests/index.test.js +15 -0
- package/components/DateRange/index.js +113 -0
- package/components/DateRange/messages.js +13 -0
- package/components/DateRange/tests/index.test.js +10 -0
- package/components/Edmeditor/index.js +65 -0
- package/components/Edmeditor/messages.js +13 -0
- package/components/Edmeditor/tests/index.test.js +10 -0
- package/components/EmailPreview/_emailPreview.scss +119 -0
- package/components/EmailPreview/assets/images/iPad.svg +10 -0
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/EmailPreview/index.js +105 -0
- package/components/EmailPreview/messages.js +17 -0
- package/components/EmailPreview/tests/index.test.js +10 -0
- package/components/Footer/index.js +27 -0
- package/components/Footer/messages.js +13 -0
- package/components/Footer/tests/index.test.js +10 -0
- package/components/FormBuilder/_formBuilder.scss +85 -0
- package/components/FormBuilder/index.js +3298 -0
- package/components/FormBuilder/messages.js +13 -0
- package/components/FormBuilder/tests/index.test.js +10 -0
- package/components/ImagePreview/_imagePreview.scss +63 -0
- package/components/ImagePreview/index.js +52 -0
- package/components/ImagePreview/messages.js +13 -0
- package/components/ImagePreview/tests/index.test.js +10 -0
- package/components/PageHeader/_pageHeader.scss +22 -0
- package/components/PageHeader/index.js +37 -0
- package/components/PageHeader/messages.js +13 -0
- package/components/PageHeader/tests/index.test.js +10 -0
- package/components/Pagination/_pagination.scss +5 -0
- package/components/Pagination/index.js +49 -0
- package/components/Pagination/tests/index.test.js +10 -0
- package/components/PreviewSideBar/_previewsidebar.scss +28 -0
- package/components/PreviewSideBar/index.js +148 -0
- package/components/PreviewSideBar/messages.js +33 -0
- package/components/PreviewSideBar/tests/index.test.js +10 -0
- package/components/Sidebar/_sidebar.scss +115 -0
- package/components/Sidebar/index.js +235 -0
- package/components/Sidebar/messages.js +21 -0
- package/components/Sidebar/tests/index.test.js +10 -0
- package/components/SlideBox/_slideBox.scss +63 -0
- package/components/SlideBox/index.js +48 -0
- package/components/SlideBox/tests/index.test.js +103 -0
- package/components/SmsEditor/index.js +55 -0
- package/components/SmsEditor/tests/index.test.js +10 -0
- package/components/SmsTest/index.js +115 -0
- package/components/SmsTest/messages.js +13 -0
- package/components/SmsTest/tests/index.test.js +10 -0
- package/components/TemplatePreview/_templatePreview.scss +352 -0
- package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/components/TemplatePreview/assets/images/androidPushMessage.svg +45 -0
- package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +135 -0
- package/components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/components/TemplatePreview/assets/images/sms-body.png +0 -0
- package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
- package/components/TemplatePreview/assets/images/user-icon.svg +19 -0
- package/components/TemplatePreview/assets/images/wechat-mobile.svg +78 -0
- package/components/TemplatePreview/index.js +176 -0
- package/components/TemplatePreview/messages.js +29 -0
- package/components/TemplatePreview/tests/index.test.js +10 -0
- package/components/Toastr/index.js +60 -0
- package/components/Toastr/messages.js +13 -0
- package/components/Toastr/tests/index.test.js +10 -0
- package/components/ToastrMessage/index.js +110 -0
- package/components/ToastrMessage/messages.js +13 -0
- package/components/ToastrMessage/tests/index.test.js +10 -0
- package/components/TopBar/_topbar.scss +46 -0
- package/components/TopBar/assets/images/capillary_logo.png +0 -0
- package/components/TopBar/index.js +113 -0
- package/components/TopBar/messages.js +29 -0
- package/components/TopBar/tests/index.test.js +10 -0
- package/config/app.js +13 -20
- package/config/path.js +1 -2
- package/config/request.js +13 -12
- package/config/toastr.js +44 -0
- package/containers/App/actions.js +7 -0
- package/containers/App/constants.js +3 -0
- package/containers/App/reducer.js +19 -0
- package/containers/App/sagas.js +26 -0
- package/containers/App/selectors.js +25 -0
- package/containers/App/tests/actions.test.js +18 -0
- package/containers/App/tests/reducer.test.js +9 -0
- package/containers/App/tests/sagas.test.js +15 -0
- package/containers/App/tests/selectors.test.js +10 -0
- package/containers/Assets/Gallery/_gallery.scss +126 -0
- package/containers/Assets/Gallery/actions.js +37 -0
- package/containers/Assets/Gallery/constants.js +23 -0
- package/containers/Assets/Gallery/index.js +465 -0
- package/containers/Assets/Gallery/messages.js +89 -0
- package/containers/Assets/Gallery/reducer.js +81 -0
- package/containers/Assets/Gallery/sagas.js +84 -0
- package/containers/Assets/Gallery/selectors.js +25 -0
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +7 -0
- package/containers/Assets/Gallery/tests/actions.test.js +26 -0
- package/containers/Assets/Gallery/tests/index.test.js +10 -0
- package/containers/Assets/Gallery/tests/reducer.test.js +95 -0
- package/containers/Assets/Gallery/tests/sagas.test.js +15 -0
- package/containers/Assets/Gallery/tests/selectors.test.js +10 -0
- package/containers/Cap/actions.js +52 -0
- package/containers/Cap/constants.js +22 -0
- package/containers/Cap/index.js +370 -0
- package/containers/Cap/messsages.js +63 -0
- package/containers/Cap/reducer.js +108 -0
- package/containers/Cap/sagas.js +143 -0
- package/containers/Cap/selectors.js +54 -0
- package/containers/Cap/tests/index.test.js +16 -0
- package/containers/Cap/tests/selectors.test.js +28 -0
- package/containers/ChannelTemplates/actions.js +20 -0
- package/containers/ChannelTemplates/constants.js +8 -0
- package/containers/ChannelTemplates/index.js +48 -0
- package/containers/ChannelTemplates/messages.js +13 -0
- package/containers/ChannelTemplates/reducer.js +34 -0
- package/containers/ChannelTemplates/sagas.js +32 -0
- package/containers/ChannelTemplates/selectors.js +25 -0
- package/containers/ChannelTemplates/tests/actions.test.js +18 -0
- package/containers/ChannelTemplates/tests/index.test.js +10 -0
- package/containers/ChannelTemplates/tests/reducer.test.js +9 -0
- package/containers/ChannelTemplates/tests/sagas.test.js +15 -0
- package/containers/ChannelTemplates/tests/selectors.test.js +10 -0
- package/containers/Dashboard/actions.js +15 -0
- package/containers/Dashboard/constants.js +7 -0
- package/containers/Dashboard/index.js +54 -0
- package/containers/Dashboard/messages.js +13 -0
- package/containers/Dashboard/reducer.js +21 -0
- package/containers/Dashboard/sagas.js +11 -0
- package/containers/Dashboard/selectors.js +25 -0
- package/containers/Dashboard/tests/actions.test.js +18 -0
- package/containers/Dashboard/tests/index.test.js +10 -0
- package/containers/Dashboard/tests/reducer.test.js +9 -0
- package/containers/Dashboard/tests/sagas.test.js +15 -0
- package/containers/Dashboard/tests/selectors.test.js +10 -0
- package/containers/Ebill/_ebill.scss +5 -0
- package/containers/Ebill/actions.js +43 -0
- package/containers/Ebill/constants.js +20 -0
- package/containers/Ebill/index.js +1277 -0
- package/containers/Ebill/messages.js +73 -0
- package/containers/Ebill/reducer.js +72 -0
- package/containers/Ebill/sagas.js +65 -0
- package/containers/Ebill/selectors.js +25 -0
- package/containers/Ebill/tests/actions.test.js +18 -0
- package/containers/Ebill/tests/index.test.js +10 -0
- package/containers/Ebill/tests/reducer.test.js +9 -0
- package/containers/Ebill/tests/sagas.test.js +15 -0
- package/containers/Ebill/tests/selectors.test.js +10 -0
- package/containers/Email/_email.scss +141 -0
- package/containers/Email/actions.js +81 -0
- package/containers/Email/constants.js +36 -0
- package/containers/Email/index.js +3286 -0
- package/containers/Email/messages.js +233 -0
- package/containers/Email/reducer.js +142 -0
- package/containers/Email/sagas.js +136 -0
- package/containers/Email/selectors.js +31 -0
- package/containers/Email/tests/actions.test.js +18 -0
- package/containers/Email/tests/index.test.js +10 -0
- package/containers/Email/tests/reducer.test.js +9 -0
- package/containers/Email/tests/sagas.test.js +15 -0
- package/containers/Email/tests/selectors.test.js +10 -0
- package/containers/LanguageProvider/actions.js +17 -0
- package/containers/LanguageProvider/constants.js +8 -0
- package/containers/LanguageProvider/index.js +46 -0
- package/containers/LanguageProvider/reducer.js +30 -0
- package/containers/LanguageProvider/selectors.js +20 -0
- package/containers/LanguageProvider/tests/actions.test.js +19 -0
- package/containers/LanguageProvider/tests/index.test.js +49 -0
- package/containers/LanguageProvider/tests/reducer.test.js +20 -0
- package/containers/LanguageProvider/tests/selectors.test.js +15 -0
- package/containers/Line/Create/_lineCreate.scss +43 -0
- package/containers/Line/Create/actions.js +90 -0
- package/containers/Line/Create/constants.js +39 -0
- package/containers/Line/Create/index.js +833 -0
- package/containers/Line/Create/messages.js +173 -0
- package/containers/Line/Create/reducer.js +99 -0
- package/containers/Line/Create/sagas.js +107 -0
- package/containers/Line/Create/selectors.js +36 -0
- package/containers/Line/Edit/_lineEdit.scss +25 -0
- package/containers/Line/Edit/actions.js +79 -0
- package/containers/Line/Edit/constants.js +27 -0
- package/containers/Line/Edit/index.js +1068 -0
- package/containers/Line/Edit/messages.js +157 -0
- package/containers/Line/Edit/reducer.js +83 -0
- package/containers/Line/Edit/sagas.js +81 -0
- package/containers/Line/Edit/selectors.js +29 -0
- package/containers/Line/Edit/tests/actions.test.js +18 -0
- package/containers/Line/Edit/tests/index.test.js +10 -0
- package/containers/Line/Edit/tests/reducer.test.js +9 -0
- package/containers/Line/Edit/tests/sagas.test.js +15 -0
- package/containers/Line/Edit/tests/selectors.test.js +10 -0
- package/containers/Login/components/LoginForm/index.js +59 -0
- package/containers/Login/components/LoginForm/messages.js +21 -0
- package/containers/Login/components/LoginForm/tests/index.test.js +10 -0
- package/containers/Login/index.js +106 -0
- package/containers/Login/messages.js +21 -0
- package/containers/Login/selectors.js +25 -0
- package/containers/Login/tests/index.test.js +10 -0
- package/containers/Login/tests/sagas.test.js +15 -0
- package/containers/Login/tests/selectors.test.js +10 -0
- package/containers/MobilePush/Create/_mobilePushCreate.scss +25 -0
- package/containers/MobilePush/Create/actions.js +46 -0
- package/containers/MobilePush/Create/constants.js +23 -0
- package/containers/MobilePush/Create/index.js +2267 -0
- package/containers/MobilePush/Create/messages.js +233 -0
- package/containers/MobilePush/Create/reducer.js +70 -0
- package/containers/MobilePush/Create/sagas.js +60 -0
- package/containers/MobilePush/Create/selectors.js +28 -0
- package/containers/MobilePush/Create/tests/actions.test.js +18 -0
- package/containers/MobilePush/Create/tests/index.test.js +10 -0
- package/containers/MobilePush/Create/tests/reducer.test.js +9 -0
- package/containers/MobilePush/Create/tests/sagas.test.js +15 -0
- package/containers/MobilePush/Create/tests/selectors.test.js +10 -0
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +25 -0
- package/containers/MobilePush/Edit/actions.js +91 -0
- package/containers/MobilePush/Edit/constants.js +35 -0
- package/containers/MobilePush/Edit/index.js +2569 -0
- package/containers/MobilePush/Edit/messages.js +249 -0
- package/containers/MobilePush/Edit/reducer.js +112 -0
- package/containers/MobilePush/Edit/sagas.js +118 -0
- package/containers/MobilePush/Edit/selectors.js +29 -0
- package/containers/MobilePush/Edit/tests/actions.test.js +18 -0
- package/containers/MobilePush/Edit/tests/index.test.js +10 -0
- package/containers/MobilePush/Edit/tests/reducer.test.js +9 -0
- package/containers/MobilePush/Edit/tests/sagas.test.js +15 -0
- package/containers/MobilePush/Edit/tests/selectors.test.js +10 -0
- package/containers/NotFoundPage/index.js +25 -0
- package/containers/NotFoundPage/messages.js +13 -0
- package/containers/NotFoundPage/tests/index.test.js +17 -0
- package/containers/Sms/Create/_smsCreate.scss +45 -0
- package/containers/Sms/Create/actions.js +27 -0
- package/containers/Sms/Create/constants.js +16 -0
- package/containers/Sms/Create/index.js +1488 -0
- package/containers/Sms/Create/messages.js +85 -0
- package/containers/Sms/Create/reducer.js +41 -0
- package/containers/Sms/Create/sagas.js +36 -0
- package/containers/Sms/Create/selectors.js +28 -0
- package/containers/Sms/Create/tests/actions.test.js +18 -0
- package/containers/Sms/Create/tests/index.test.js +10 -0
- package/containers/Sms/Create/tests/reducer.test.js +9 -0
- package/containers/Sms/Create/tests/sagas.test.js +15 -0
- package/containers/Sms/Create/tests/selectors.test.js +10 -0
- package/containers/Sms/Edit/actions.js +40 -0
- package/containers/Sms/Edit/constants.js +17 -0
- package/containers/Sms/Edit/index.js +1472 -0
- package/containers/Sms/Edit/messages.js +89 -0
- package/containers/Sms/Edit/reducer.js +50 -0
- package/containers/Sms/Edit/sagas.js +52 -0
- package/containers/Sms/Edit/selectors.js +32 -0
- package/containers/Sms/Edit/tests/actions.test.js +18 -0
- package/containers/Sms/Edit/tests/index.test.js +10 -0
- package/containers/Sms/Edit/tests/reducer.test.js +9 -0
- package/containers/Sms/Edit/tests/sagas.test.js +15 -0
- package/containers/Sms/Edit/tests/selectors.test.js +10 -0
- package/containers/TagList/_tagList.scss +8 -0
- package/containers/TagList/actions.js +15 -0
- package/containers/TagList/constants.js +7 -0
- package/containers/TagList/index.js +236 -0
- package/containers/TagList/messages.js +13 -0
- package/containers/TagList/reducer.js +23 -0
- package/containers/TagList/sagas.js +11 -0
- package/containers/TagList/selectors.js +25 -0
- package/containers/TagList/tests/actions.test.js +18 -0
- package/containers/TagList/tests/index.test.js +10 -0
- package/containers/TagList/tests/reducer.test.js +9 -0
- package/containers/TagList/tests/sagas.test.js +15 -0
- package/containers/TagList/tests/selectors.test.js +10 -0
- package/containers/Templates/_templates.scss +333 -0
- package/containers/Templates/actions.js +108 -0
- package/containers/Templates/constants.js +45 -0
- package/containers/Templates/index.js +1593 -0
- package/containers/Templates/messages.js +233 -0
- package/containers/Templates/reducer.js +141 -0
- package/containers/Templates/sagas.js +168 -0
- package/containers/Templates/selectors.js +28 -0
- package/containers/Templates/tests/actions.test.js +18 -0
- package/containers/Templates/tests/index.test.js +10 -0
- package/containers/Templates/tests/reducer.test.js +9 -0
- package/containers/Templates/tests/sagas.test.js +15 -0
- package/containers/Templates/tests/selectors.test.js +10 -0
- package/containers/TemplatesV2/actions.js +16 -0
- package/containers/TemplatesV2/constants.js +10 -0
- package/containers/TemplatesV2/index.js +130 -0
- package/containers/TemplatesV2/messages.js +21 -0
- package/containers/TemplatesV2/reducer.js +34 -0
- package/containers/TemplatesV2/sagas.js +32 -0
- package/containers/TemplatesV2/selectors.js +25 -0
- package/containers/TemplatesV2/tests/actions.test.js +18 -0
- package/containers/TemplatesV2/tests/index.test.js +10 -0
- package/containers/TemplatesV2/tests/reducer.test.js +9 -0
- package/containers/TemplatesV2/tests/sagas.test.js +15 -0
- package/containers/TemplatesV2/tests/selectors.test.js +10 -0
- package/containers/TestPage/constants.js +7 -0
- package/containers/TestPage/index.js +31 -0
- package/containers/TestPage/messages.js +13 -0
- package/containers/TestPage/reducer.js +21 -0
- package/containers/TestPage/sagas.js +11 -0
- package/containers/Testv2/actions.js +15 -0
- package/containers/Testv2/constants.js +7 -0
- package/containers/Testv2/index.js +47 -0
- package/containers/Testv2/messages.js +13 -0
- package/containers/Testv2/reducer.js +23 -0
- package/containers/Testv2/sagas.js +11 -0
- package/containers/Testv2/selectors.js +25 -0
- package/containers/Testv2/tests/actions.test.js +18 -0
- package/containers/Testv2/tests/index.test.js +10 -0
- package/containers/Testv2/tests/reducer.test.js +9 -0
- package/containers/Testv2/tests/sagas.test.js +15 -0
- package/containers/Testv2/tests/selectors.test.js +10 -0
- package/containers/WeChat/_wechat.scss +8 -0
- package/containers/WeChat/actions.js +52 -0
- package/containers/WeChat/constants.js +28 -0
- package/containers/WeChat/index.js +1625 -0
- package/containers/WeChat/messages.js +73 -0
- package/containers/WeChat/reducer.js +74 -0
- package/containers/WeChat/sagas.js +86 -0
- package/containers/WeChat/selectors.js +25 -0
- package/containers/WeChat/tests/actions.test.js +18 -0
- package/containers/WeChat/tests/index.test.js +10 -0
- package/containers/WeChat/tests/reducer.test.js +9 -0
- package/containers/WeChat/tests/sagas.test.js +15 -0
- package/containers/WeChat/tests/selectors.test.js +10 -0
- package/favicon.ico +0 -0
- package/global-styles.js +4 -254
- package/gtm/eventDefinitions.js +17 -0
- package/gtm/eventDefinitionsMap.js +12 -0
- package/gtm/tests/events.test.js +3 -0
- package/i18n.js +19 -27
- package/index.html +37 -51
- package/index.js +83 -21
- package/initialState.js +36 -50
- package/package.json +55 -48
- package/reducers.js +53 -13
- package/routes.js +582 -0
- package/schemas/user.js +8 -0
- package/services/api.js +198 -412
- package/services/localStorageApi.js +6 -14
- package/store.js +61 -0
- package/styles/_variables.scss +53 -0
- package/styles/abstracts/_functions.scss +1 -0
- package/{components/atoms/PrimarySelect/style.js → styles/abstracts/_mixins.scss} +0 -0
- package/styles/abstracts/_module.scss +6 -0
- package/{components/molecules/ContentWithHeading/style.js → styles/abstracts/_placeholders.scss} +0 -0
- package/styles/abstracts/_variables.scss +34 -0
- package/{components/molecules/DowngradeTier/constants.js → styles/base/_animations.scss} +0 -0
- package/styles/base/_base.scss +64 -0
- package/styles/base/_module.scss +5 -0
- package/{components/molecules/PageHeaderDescription/constants.js → styles/base/_reset.scss} +0 -0
- package/{components/molecules/SenderCreatives/index.js → styles/base/_typography.scss} +0 -0
- package/styles/components/_module.scss +11 -0
- package/styles/components/autocompletebox/_module.scss +60 -0
- package/styles/components/breadcrumbs/_breadcrumbs.scss +14 -0
- package/styles/components/common/_accordianDropdown.scss +35 -0
- package/styles/components/common/_message.scss +3 -0
- package/styles/components/dimension/_dimension.scss +77 -0
- package/styles/components/filters/_dateFilter.scss +68 -0
- package/styles/components/filters/_dimensionFilter.scss +66 -0
- package/styles/components/footer/_footer.scss +13 -0
- package/{components/molecules/TrackerValueContent/style.js → styles/components/login/_loginForm.scss} +0 -0
- package/styles/components/navigation/_leftnav.scss +213 -0
- package/styles/components/navigation/_topnav.scss +52 -0
- package/styles/containers/_module.scss +3 -0
- package/styles/containers/layout/_layoutPage.scss +169 -0
- package/styles/containers/login/_loginPage.scss +60 -0
- package/styles/containers/reports/_reportPage.scss +128 -0
- package/{components/molecules/UpgradeTier/constants.js → styles/layout/_footer.scss} +0 -0
- package/styles/layout/_forms.scss +3 -0
- package/styles/layout/_grid.scss +3 -0
- package/styles/layout/_header.scss +25 -0
- package/styles/layout/_module.scss +1 -0
- package/{components/organisms/AllocationStrategy/tests/mockData.js → styles/layout/_navigation.scss} +0 -0
- package/{components/organisms/CommunicationStrategies/style.js → styles/layout/_sidebar.scss} +0 -0
- package/styles/main.scss +6 -0
- package/{components/organisms/CreateProgramIllustration/constants.js → styles/vendor/_module.scss} +0 -0
- package/styles/vendor/semantic/dist/components/accordion.css +311 -0
- package/styles/vendor/semantic/dist/components/accordion.js +610 -0
- package/styles/vendor/semantic/dist/components/accordion.min.css +9 -0
- package/styles/vendor/semantic/dist/components/accordion.min.js +10 -0
- package/styles/vendor/semantic/dist/components/accordion.rtl.css +252 -0
- package/styles/vendor/semantic/dist/components/accordion.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/ad.css +275 -0
- package/styles/vendor/semantic/dist/components/ad.min.css +10 -0
- package/styles/vendor/semantic/dist/components/ad.rtl.css +275 -0
- package/styles/vendor/semantic/dist/components/ad.rtl.min.css +10 -0
- package/styles/vendor/semantic/dist/components/api.js +1167 -0
- package/styles/vendor/semantic/dist/components/api.min.js +10 -0
- package/styles/vendor/semantic/dist/components/breadcrumb.css +124 -0
- package/styles/vendor/semantic/dist/components/breadcrumb.min.css +9 -0
- package/styles/vendor/semantic/dist/components/breadcrumb.rtl.css +124 -0
- package/styles/vendor/semantic/dist/components/breadcrumb.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/button.css +3557 -0
- package/styles/vendor/semantic/dist/components/button.min.css +9 -0
- package/styles/vendor/semantic/dist/components/button.rtl.css +3450 -0
- package/styles/vendor/semantic/dist/components/button.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/card.css +964 -0
- package/styles/vendor/semantic/dist/components/card.min.css +9 -0
- package/styles/vendor/semantic/dist/components/card.rtl.css +964 -0
- package/styles/vendor/semantic/dist/components/card.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/checkbox.css +625 -0
- package/styles/vendor/semantic/dist/components/checkbox.js +831 -0
- package/styles/vendor/semantic/dist/components/checkbox.min.css +9 -0
- package/styles/vendor/semantic/dist/components/checkbox.min.js +10 -0
- package/styles/vendor/semantic/dist/components/checkbox.rtl.css +625 -0
- package/styles/vendor/semantic/dist/components/checkbox.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/comment.css +270 -0
- package/styles/vendor/semantic/dist/components/comment.min.css +9 -0
- package/styles/vendor/semantic/dist/components/comment.rtl.css +270 -0
- package/styles/vendor/semantic/dist/components/comment.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/container.css +147 -0
- package/styles/vendor/semantic/dist/components/container.min.css +9 -0
- package/styles/vendor/semantic/dist/components/container.rtl.css +147 -0
- package/styles/vendor/semantic/dist/components/container.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/dimmer.css +200 -0
- package/styles/vendor/semantic/dist/components/dimmer.js +708 -0
- package/styles/vendor/semantic/dist/components/dimmer.min.css +9 -0
- package/styles/vendor/semantic/dist/components/dimmer.min.js +10 -0
- package/styles/vendor/semantic/dist/components/dimmer.rtl.css +200 -0
- package/styles/vendor/semantic/dist/components/dimmer.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/divider.css +260 -0
- package/styles/vendor/semantic/dist/components/divider.min.css +9 -0
- package/styles/vendor/semantic/dist/components/divider.rtl.css +260 -0
- package/styles/vendor/semantic/dist/components/divider.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/dropdown.css +1487 -0
- package/styles/vendor/semantic/dist/components/dropdown.js +3741 -0
- package/styles/vendor/semantic/dist/components/dropdown.min.css +9 -0
- package/styles/vendor/semantic/dist/components/dropdown.min.js +11 -0
- package/styles/vendor/semantic/dist/components/dropdown.rtl.css +1417 -0
- package/styles/vendor/semantic/dist/components/dropdown.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/embed.css +166 -0
- package/styles/vendor/semantic/dist/components/embed.js +696 -0
- package/styles/vendor/semantic/dist/components/embed.min.css +9 -0
- package/styles/vendor/semantic/dist/components/embed.min.js +10 -0
- package/styles/vendor/semantic/dist/components/embed.rtl.css +166 -0
- package/styles/vendor/semantic/dist/components/embed.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/feed.css +296 -0
- package/styles/vendor/semantic/dist/components/feed.min.css +9 -0
- package/styles/vendor/semantic/dist/components/feed.rtl.css +296 -0
- package/styles/vendor/semantic/dist/components/feed.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/flag.css +1031 -0
- package/styles/vendor/semantic/dist/components/flag.min.css +9 -0
- package/styles/vendor/semantic/dist/components/flag.rtl.css +1031 -0
- package/styles/vendor/semantic/dist/components/flag.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/form.css +1067 -0
- package/styles/vendor/semantic/dist/components/form.js +1558 -0
- package/styles/vendor/semantic/dist/components/form.min.css +9 -0
- package/styles/vendor/semantic/dist/components/form.min.js +10 -0
- package/styles/vendor/semantic/dist/components/form.rtl.css +1067 -0
- package/styles/vendor/semantic/dist/components/form.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/grid.css +2002 -0
- package/styles/vendor/semantic/dist/components/grid.min.css +9 -0
- package/styles/vendor/semantic/dist/components/grid.rtl.css +2002 -0
- package/styles/vendor/semantic/dist/components/grid.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/header.css +721 -0
- package/styles/vendor/semantic/dist/components/header.min.css +9 -0
- package/styles/vendor/semantic/dist/components/header.rtl.css +721 -0
- package/styles/vendor/semantic/dist/components/header.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/icon.css +3142 -0
- package/styles/vendor/semantic/dist/components/icon.min.css +9 -0
- package/styles/vendor/semantic/dist/components/icon.rtl.css +3142 -0
- package/styles/vendor/semantic/dist/components/icon.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/image.css +306 -0
- package/styles/vendor/semantic/dist/components/image.min.css +9 -0
- package/styles/vendor/semantic/dist/components/image.rtl.css +306 -0
- package/styles/vendor/semantic/dist/components/image.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/input.css +536 -0
- package/styles/vendor/semantic/dist/components/input.min.css +9 -0
- package/styles/vendor/semantic/dist/components/input.rtl.css +510 -0
- package/styles/vendor/semantic/dist/components/input.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/item.css +475 -0
- package/styles/vendor/semantic/dist/components/item.min.css +9 -0
- package/styles/vendor/semantic/dist/components/item.rtl.css +475 -0
- package/styles/vendor/semantic/dist/components/item.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/label.css +1320 -0
- package/styles/vendor/semantic/dist/components/label.min.css +9 -0
- package/styles/vendor/semantic/dist/components/label.rtl.css +1307 -0
- package/styles/vendor/semantic/dist/components/label.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/list.css +951 -0
- package/styles/vendor/semantic/dist/components/list.min.css +9 -0
- package/styles/vendor/semantic/dist/components/list.rtl.css +951 -0
- package/styles/vendor/semantic/dist/components/list.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/loader.css +347 -0
- package/styles/vendor/semantic/dist/components/loader.min.css +9 -0
- package/styles/vendor/semantic/dist/components/loader.rtl.css +347 -0
- package/styles/vendor/semantic/dist/components/loader.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/menu.css +2020 -0
- package/styles/vendor/semantic/dist/components/menu.min.css +1 -0
- package/styles/vendor/semantic/dist/components/menu.rtl.css +2002 -0
- package/styles/vendor/semantic/dist/components/menu.rtl.min.css +1 -0
- package/styles/vendor/semantic/dist/components/message.css +477 -0
- package/styles/vendor/semantic/dist/components/message.min.css +9 -0
- package/styles/vendor/semantic/dist/components/message.rtl.css +477 -0
- package/styles/vendor/semantic/dist/components/message.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/modal.css +512 -0
- package/styles/vendor/semantic/dist/components/modal.js +913 -0
- package/styles/vendor/semantic/dist/components/modal.min.css +9 -0
- package/styles/vendor/semantic/dist/components/modal.min.js +10 -0
- package/styles/vendor/semantic/dist/components/modal.rtl.css +499 -0
- package/styles/vendor/semantic/dist/components/modal.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/nag.css +147 -0
- package/styles/vendor/semantic/dist/components/nag.js +507 -0
- package/styles/vendor/semantic/dist/components/nag.min.css +9 -0
- package/styles/vendor/semantic/dist/components/nag.min.js +10 -0
- package/styles/vendor/semantic/dist/components/nag.rtl.css +147 -0
- package/styles/vendor/semantic/dist/components/nag.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/popup.css +733 -0
- package/styles/vendor/semantic/dist/components/popup.js +1475 -0
- package/styles/vendor/semantic/dist/components/popup.min.css +9 -0
- package/styles/vendor/semantic/dist/components/popup.min.js +10 -0
- package/styles/vendor/semantic/dist/components/popup.rtl.css +727 -0
- package/styles/vendor/semantic/dist/components/popup.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/progress.css +516 -0
- package/styles/vendor/semantic/dist/components/progress.js +931 -0
- package/styles/vendor/semantic/dist/components/progress.min.css +9 -0
- package/styles/vendor/semantic/dist/components/progress.min.js +10 -0
- package/styles/vendor/semantic/dist/components/progress.rtl.css +516 -0
- package/styles/vendor/semantic/dist/components/progress.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/rail.css +152 -0
- package/styles/vendor/semantic/dist/components/rail.min.css +9 -0
- package/styles/vendor/semantic/dist/components/rail.rtl.css +152 -0
- package/styles/vendor/semantic/dist/components/rail.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/rating.css +263 -0
- package/styles/vendor/semantic/dist/components/rating.js +508 -0
- package/styles/vendor/semantic/dist/components/rating.min.css +9 -0
- package/styles/vendor/semantic/dist/components/rating.min.js +10 -0
- package/styles/vendor/semantic/dist/components/rating.rtl.css +263 -0
- package/styles/vendor/semantic/dist/components/rating.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/reset.css +424 -0
- package/styles/vendor/semantic/dist/components/reset.min.css +9 -0
- package/styles/vendor/semantic/dist/components/reset.rtl.css +424 -0
- package/styles/vendor/semantic/dist/components/reset.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/reveal.css +284 -0
- package/styles/vendor/semantic/dist/components/reveal.min.css +9 -0
- package/styles/vendor/semantic/dist/components/reveal.rtl.css +284 -0
- package/styles/vendor/semantic/dist/components/reveal.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/search.css +408 -0
- package/styles/vendor/semantic/dist/components/search.js +1407 -0
- package/styles/vendor/semantic/dist/components/search.min.css +9 -0
- package/styles/vendor/semantic/dist/components/search.min.js +10 -0
- package/styles/vendor/semantic/dist/components/search.rtl.css +408 -0
- package/styles/vendor/semantic/dist/components/search.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/segment.css +791 -0
- package/styles/vendor/semantic/dist/components/segment.min.css +9 -0
- package/styles/vendor/semantic/dist/components/segment.rtl.css +791 -0
- package/styles/vendor/semantic/dist/components/segment.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/shape.css +157 -0
- package/styles/vendor/semantic/dist/components/shape.js +921 -0
- package/styles/vendor/semantic/dist/components/shape.min.css +9 -0
- package/styles/vendor/semantic/dist/components/shape.min.js +10 -0
- package/styles/vendor/semantic/dist/components/shape.rtl.css +157 -0
- package/styles/vendor/semantic/dist/components/shape.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/sidebar.css +638 -0
- package/styles/vendor/semantic/dist/components/sidebar.js +1036 -0
- package/styles/vendor/semantic/dist/components/sidebar.min.css +9 -0
- package/styles/vendor/semantic/dist/components/sidebar.min.js +10 -0
- package/styles/vendor/semantic/dist/components/sidebar.rtl.css +638 -0
- package/styles/vendor/semantic/dist/components/sidebar.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/site.css +154 -0
- package/styles/vendor/semantic/dist/components/site.js +487 -0
- package/styles/vendor/semantic/dist/components/site.min.css +9 -0
- package/styles/vendor/semantic/dist/components/site.min.js +10 -0
- package/styles/vendor/semantic/dist/components/site.rtl.css +154 -0
- package/styles/vendor/semantic/dist/components/site.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/state.js +708 -0
- package/styles/vendor/semantic/dist/components/state.min.js +10 -0
- package/styles/vendor/semantic/dist/components/statistic.css +569 -0
- package/styles/vendor/semantic/dist/components/statistic.min.css +9 -0
- package/styles/vendor/semantic/dist/components/statistic.rtl.css +569 -0
- package/styles/vendor/semantic/dist/components/statistic.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/step.css +623 -0
- package/styles/vendor/semantic/dist/components/step.min.css +9 -0
- package/styles/vendor/semantic/dist/components/step.rtl.css +623 -0
- package/styles/vendor/semantic/dist/components/step.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/sticky.css +78 -0
- package/styles/vendor/semantic/dist/components/sticky.js +942 -0
- package/styles/vendor/semantic/dist/components/sticky.min.css +9 -0
- package/styles/vendor/semantic/dist/components/sticky.min.js +10 -0
- package/styles/vendor/semantic/dist/components/sticky.rtl.css +78 -0
- package/styles/vendor/semantic/dist/components/sticky.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/tab.css +91 -0
- package/styles/vendor/semantic/dist/components/tab.js +946 -0
- package/styles/vendor/semantic/dist/components/tab.min.css +9 -0
- package/styles/vendor/semantic/dist/components/tab.min.js +10 -0
- package/styles/vendor/semantic/dist/components/tab.rtl.css +91 -0
- package/styles/vendor/semantic/dist/components/tab.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/table.css +1108 -0
- package/styles/vendor/semantic/dist/components/table.min.css +9 -0
- package/styles/vendor/semantic/dist/components/table.rtl.css +1108 -0
- package/styles/vendor/semantic/dist/components/table.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/transition.css +1964 -0
- package/styles/vendor/semantic/dist/components/transition.js +1095 -0
- package/styles/vendor/semantic/dist/components/transition.min.css +9 -0
- package/styles/vendor/semantic/dist/components/transition.min.js +10 -0
- package/styles/vendor/semantic/dist/components/transition.rtl.css +1964 -0
- package/styles/vendor/semantic/dist/components/transition.rtl.min.css +9 -0
- package/styles/vendor/semantic/dist/components/visibility.js +1283 -0
- package/styles/vendor/semantic/dist/components/visibility.min.js +10 -0
- package/styles/vendor/semantic/dist/semantic.css +36950 -0
- package/styles/vendor/semantic/dist/semantic.js +22500 -0
- package/styles/vendor/semantic/dist/semantic.min.css +364 -0
- package/styles/vendor/semantic/dist/semantic.min.js +19 -0
- package/styles/vendor/semantic/dist/semantic.rtl.css +36579 -0
- package/styles/vendor/semantic/dist/semantic.rtl.min.css +11 -0
- package/styles/vendor/semantic/dist/themes/basic/assets/fonts/icons.eot +0 -0
- package/styles/vendor/semantic/dist/themes/basic/assets/fonts/icons.svg +450 -0
- package/styles/vendor/semantic/dist/themes/basic/assets/fonts/icons.ttf +0 -0
- package/styles/vendor/semantic/dist/themes/basic/assets/fonts/icons.woff +0 -0
- package/styles/vendor/semantic/dist/themes/default/assets/fonts/icons.eot +0 -0
- package/styles/vendor/semantic/dist/themes/default/assets/fonts/icons.svg +685 -0
- package/styles/vendor/semantic/dist/themes/default/assets/fonts/icons.ttf +0 -0
- package/styles/vendor/semantic/dist/themes/default/assets/fonts/icons.woff +0 -0
- package/styles/vendor/semantic/dist/themes/default/assets/fonts/icons.woff2 +0 -0
- package/styles/vendor/semantic/dist/themes/default/assets/images/flags.png +0 -0
- package/styles/vendor/semantic/dist/themes/github/assets/fonts/octicons-local.ttf +0 -0
- package/styles/vendor/semantic/dist/themes/github/assets/fonts/octicons.svg +200 -0
- package/styles/vendor/semantic/dist/themes/github/assets/fonts/octicons.ttf +0 -0
- package/styles/vendor/semantic/dist/themes/github/assets/fonts/octicons.woff +0 -0
- package/styles/vendor/semantic/dist/themes/material/assets/fonts/icons.eot +0 -0
- package/styles/vendor/semantic/dist/themes/material/assets/fonts/icons.svg +2373 -0
- package/styles/vendor/semantic/dist/themes/material/assets/fonts/icons.ttf +0 -0
- package/styles/vendor/semantic/dist/themes/material/assets/fonts/icons.woff +0 -0
- package/styles/vendor/semantic/gulpfile.js +72 -0
- package/styles/vendor/semantic/src/definitions/behaviors/api.js +1167 -0
- package/styles/vendor/semantic/src/definitions/behaviors/colorize.js +280 -0
- package/styles/vendor/semantic/src/definitions/behaviors/form.js +1558 -0
- package/styles/vendor/semantic/src/definitions/behaviors/state.js +708 -0
- package/styles/vendor/semantic/src/definitions/behaviors/visibility.js +1283 -0
- package/styles/vendor/semantic/src/definitions/behaviors/visit.js +525 -0
- package/styles/vendor/semantic/src/definitions/collections/breadcrumb.less +122 -0
- package/styles/vendor/semantic/src/definitions/collections/form.less +1053 -0
- package/styles/vendor/semantic/src/definitions/collections/grid.less +1920 -0
- package/styles/vendor/semantic/src/definitions/collections/menu.less +1965 -0
- package/styles/vendor/semantic/src/definitions/collections/message.less +478 -0
- package/styles/vendor/semantic/src/definitions/collections/table.less +1114 -0
- package/styles/vendor/semantic/src/definitions/elements/button.less +3427 -0
- package/styles/vendor/semantic/src/definitions/elements/container.less +143 -0
- package/styles/vendor/semantic/src/definitions/elements/divider.less +255 -0
- package/styles/vendor/semantic/src/definitions/elements/flag.less +52 -0
- package/styles/vendor/semantic/src/definitions/elements/header.less +708 -0
- package/styles/vendor/semantic/src/definitions/elements/icon.less +477 -0
- package/styles/vendor/semantic/src/definitions/elements/image.less +324 -0
- package/styles/vendor/semantic/src/definitions/elements/input.less +507 -0
- package/styles/vendor/semantic/src/definitions/elements/label.less +1257 -0
- package/styles/vendor/semantic/src/definitions/elements/list.less +951 -0
- package/styles/vendor/semantic/src/definitions/elements/loader.less +332 -0
- package/styles/vendor/semantic/src/definitions/elements/rail.less +154 -0
- package/styles/vendor/semantic/src/definitions/elements/reveal.less +265 -0
- package/styles/vendor/semantic/src/definitions/elements/segment.less +768 -0
- package/styles/vendor/semantic/src/definitions/elements/step.less +562 -0
- package/styles/vendor/semantic/src/definitions/globals/reset.less +40 -0
- package/styles/vendor/semantic/src/definitions/globals/site.js +487 -0
- package/styles/vendor/semantic/src/definitions/globals/site.less +166 -0
- package/styles/vendor/semantic/src/definitions/modules/accordion.js +610 -0
- package/styles/vendor/semantic/src/definitions/modules/accordion.less +219 -0
- package/styles/vendor/semantic/src/definitions/modules/checkbox.js +831 -0
- package/styles/vendor/semantic/src/definitions/modules/checkbox.less +598 -0
- package/styles/vendor/semantic/src/definitions/modules/dimmer.js +708 -0
- package/styles/vendor/semantic/src/definitions/modules/dimmer.less +189 -0
- package/styles/vendor/semantic/src/definitions/modules/dropdown.js +3741 -0
- package/styles/vendor/semantic/src/definitions/modules/dropdown.less +1352 -0
- package/styles/vendor/semantic/src/definitions/modules/embed.js +696 -0
- package/styles/vendor/semantic/src/definitions/modules/embed.less +163 -0
- package/styles/vendor/semantic/src/definitions/modules/modal.js +913 -0
- package/styles/vendor/semantic/src/definitions/modules/modal.less +484 -0
- package/styles/vendor/semantic/src/definitions/modules/nag.js +507 -0
- package/styles/vendor/semantic/src/definitions/modules/nag.less +158 -0
- package/styles/vendor/semantic/src/definitions/modules/popup.js +1475 -0
- package/styles/vendor/semantic/src/definitions/modules/popup.less +712 -0
- package/styles/vendor/semantic/src/definitions/modules/progress.js +931 -0
- package/styles/vendor/semantic/src/definitions/modules/progress.less +503 -0
- package/styles/vendor/semantic/src/definitions/modules/rating.js +508 -0
- package/styles/vendor/semantic/src/definitions/modules/rating.less +191 -0
- package/styles/vendor/semantic/src/definitions/modules/search.js +1407 -0
- package/styles/vendor/semantic/src/definitions/modules/search.less +417 -0
- package/styles/vendor/semantic/src/definitions/modules/shape.js +921 -0
- package/styles/vendor/semantic/src/definitions/modules/shape.less +150 -0
- package/styles/vendor/semantic/src/definitions/modules/sidebar.js +1036 -0
- package/styles/vendor/semantic/src/definitions/modules/sidebar.less +552 -0
- package/styles/vendor/semantic/src/definitions/modules/sticky.js +942 -0
- package/styles/vendor/semantic/src/definitions/modules/sticky.less +74 -0
- package/styles/vendor/semantic/src/definitions/modules/tab.js +946 -0
- package/styles/vendor/semantic/src/definitions/modules/tab.less +94 -0
- package/styles/vendor/semantic/src/definitions/modules/transition.js +1095 -0
- package/styles/vendor/semantic/src/definitions/modules/transition.less +78 -0
- package/styles/vendor/semantic/src/definitions/views/ad.less +268 -0
- package/styles/vendor/semantic/src/definitions/views/card.less +1059 -0
- package/styles/vendor/semantic/src/definitions/views/comment.less +269 -0
- package/styles/vendor/semantic/src/definitions/views/feed.less +278 -0
- package/styles/vendor/semantic/src/definitions/views/item.less +464 -0
- package/styles/vendor/semantic/src/definitions/views/statistic.less +557 -0
- package/styles/vendor/semantic/src/semantic.less +66 -0
- package/styles/vendor/semantic/src/site/collections/breadcrumb.overrides +3 -0
- package/styles/vendor/semantic/src/site/collections/breadcrumb.variables +3 -0
- package/styles/vendor/semantic/src/site/collections/form.overrides +3 -0
- package/styles/vendor/semantic/src/site/collections/form.variables +3 -0
- package/styles/vendor/semantic/src/site/collections/grid.overrides +3 -0
- package/styles/vendor/semantic/src/site/collections/grid.variables +3 -0
- package/styles/vendor/semantic/src/site/collections/menu.overrides +24 -0
- package/styles/vendor/semantic/src/site/collections/menu.variables +6 -0
- package/styles/vendor/semantic/src/site/collections/message.overrides +3 -0
- package/styles/vendor/semantic/src/site/collections/message.variables +3 -0
- package/styles/vendor/semantic/src/site/collections/table.overrides +3 -0
- package/styles/vendor/semantic/src/site/collections/table.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/button.overrides +110 -0
- package/styles/vendor/semantic/src/site/elements/button.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/container.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/container.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/divider.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/divider.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/flag.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/flag.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/header.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/header.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/icon.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/icon.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/image.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/image.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/input.overrides +25 -0
- package/styles/vendor/semantic/src/site/elements/input.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/label.overrides +18 -0
- package/styles/vendor/semantic/src/site/elements/label.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/list.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/list.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/loader.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/loader.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/rail.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/rail.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/reveal.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/reveal.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/segment.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/segment.variables +3 -0
- package/styles/vendor/semantic/src/site/elements/step.overrides +3 -0
- package/styles/vendor/semantic/src/site/elements/step.variables +3 -0
- package/styles/vendor/semantic/src/site/globals/reset.overrides +3 -0
- package/styles/vendor/semantic/src/site/globals/reset.variables +3 -0
- package/styles/vendor/semantic/src/site/globals/site.overrides +3 -0
- package/styles/vendor/semantic/src/site/globals/site.variables +52 -0
- package/styles/vendor/semantic/src/site/modules/accordion.overrides +67 -0
- package/styles/vendor/semantic/src/site/modules/accordion.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/chatroom.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/chatroom.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/checkbox.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/checkbox.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/dimmer.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/dimmer.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/dropdown.overrides +80 -0
- package/styles/vendor/semantic/src/site/modules/dropdown.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/embed.overrides +3 -0
- package/{components/organisms/ExpiryStrategy/tests/mockData.js → styles/vendor/semantic/src/site/modules/embed.variables} +0 -0
- package/styles/vendor/semantic/src/site/modules/modal.overrides +13 -0
- package/styles/vendor/semantic/src/site/modules/modal.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/nag.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/nag.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/popup.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/popup.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/progress.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/progress.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/rating.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/rating.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/search.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/search.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/shape.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/shape.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/sidebar.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/sidebar.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/sticky.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/sticky.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/tab.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/tab.variables +3 -0
- package/styles/vendor/semantic/src/site/modules/transition.overrides +3 -0
- package/styles/vendor/semantic/src/site/modules/transition.variables +3 -0
- package/styles/vendor/semantic/src/site/views/ad.overrides +3 -0
- package/styles/vendor/semantic/src/site/views/ad.variables +3 -0
- package/styles/vendor/semantic/src/site/views/card.overrides +3 -0
- package/styles/vendor/semantic/src/site/views/card.variables +3 -0
- package/styles/vendor/semantic/src/site/views/comment.overrides +3 -0
- package/styles/vendor/semantic/src/site/views/comment.variables +3 -0
- package/styles/vendor/semantic/src/site/views/feed.overrides +3 -0
- package/styles/vendor/semantic/src/site/views/feed.variables +3 -0
- package/styles/vendor/semantic/src/site/views/item.overrides +3 -0
- package/styles/vendor/semantic/src/site/views/item.variables +3 -0
- package/styles/vendor/semantic/src/site/views/statistic.overrides +3 -0
- package/styles/vendor/semantic/src/site/views/statistic.variables +3 -0
- package/styles/vendor/semantic/src/theme.config +92 -0
- package/styles/vendor/semantic/src/theme.less +61 -0
- package/styles/vendor/semantic/src/themes/amazon/elements/button.overrides +46 -0
- package/styles/vendor/semantic/src/themes/amazon/elements/button.variables +58 -0
- package/styles/vendor/semantic/src/themes/amazon/globals/site.variables +43 -0
- package/styles/vendor/semantic/src/themes/basic/assets/fonts/icons.eot +0 -0
- package/styles/vendor/semantic/src/themes/basic/assets/fonts/icons.svg +450 -0
- package/styles/vendor/semantic/src/themes/basic/assets/fonts/icons.ttf +0 -0
- package/styles/vendor/semantic/src/themes/basic/assets/fonts/icons.woff +0 -0
- package/styles/vendor/semantic/src/themes/basic/collections/table.overrides +4 -0
- package/styles/vendor/semantic/src/themes/basic/collections/table.variables +11 -0
- package/styles/vendor/semantic/src/themes/basic/elements/button.overrides +4 -0
- package/styles/vendor/semantic/src/themes/basic/elements/button.variables +44 -0
- package/styles/vendor/semantic/src/themes/basic/elements/icon.overrides +189 -0
- package/styles/vendor/semantic/src/themes/basic/elements/icon.variables +12 -0
- package/styles/vendor/semantic/src/themes/basic/elements/step.overrides +10 -0
- package/styles/vendor/semantic/src/themes/basic/elements/step.variables +18 -0
- package/styles/vendor/semantic/src/themes/basic/globals/reset.overrides +5 -0
- package/styles/vendor/semantic/src/themes/basic/globals/reset.variables +3 -0
- package/styles/vendor/semantic/src/themes/basic/modules/progress.overrides +3 -0
- package/styles/vendor/semantic/src/themes/basic/modules/progress.variables +15 -0
- package/styles/vendor/semantic/src/themes/basic/views/card.overrides +4 -0
- package/styles/vendor/semantic/src/themes/basic/views/card.variables +35 -0
- package/styles/vendor/semantic/src/themes/bookish/elements/header.overrides +15 -0
- package/styles/vendor/semantic/src/themes/bookish/elements/header.variables +37 -0
- package/{components/organisms/RedemptionStrategy/tests/mockData.js → styles/vendor/semantic/src/themes/bootstrap3/elements/button.overrides} +0 -0
- package/styles/vendor/semantic/src/themes/bootstrap3/elements/button.variables +63 -0
- package/styles/vendor/semantic/src/themes/chubby/collections/form.overrides +16 -0
- package/styles/vendor/semantic/src/themes/chubby/collections/form.variables +9 -0
- package/{components/organisms/RenewalCommunication/constants.js → styles/vendor/semantic/src/themes/chubby/collections/menu.overrides} +0 -0
- package/styles/vendor/semantic/src/themes/chubby/collections/menu.variables +40 -0
- package/styles/vendor/semantic/src/themes/chubby/elements/button.overrides +21 -0
- package/styles/vendor/semantic/src/themes/chubby/elements/button.variables +57 -0
- package/styles/vendor/semantic/src/themes/chubby/elements/header.overrides +5 -0
- package/styles/vendor/semantic/src/themes/chubby/elements/header.variables +21 -0
- package/styles/vendor/semantic/src/themes/chubby/modules/accordion.overrides +7 -0
- package/styles/vendor/semantic/src/themes/chubby/modules/accordion.variables +15 -0
- package/styles/vendor/semantic/src/themes/chubby/views/comment.overrides +12 -0
- package/styles/vendor/semantic/src/themes/chubby/views/comment.variables +46 -0
- package/styles/vendor/semantic/src/themes/classic/collections/table.overrides +3 -0
- package/styles/vendor/semantic/src/themes/classic/collections/table.variables +14 -0
- package/styles/vendor/semantic/src/themes/classic/elements/button.overrides +3 -0
- package/styles/vendor/semantic/src/themes/classic/elements/button.variables +96 -0
- package/styles/vendor/semantic/src/themes/classic/elements/header.overrides +3 -0
- package/styles/vendor/semantic/src/themes/classic/elements/header.variables +12 -0
- package/styles/vendor/semantic/src/themes/classic/modules/progress.overrides +3 -0
- package/styles/vendor/semantic/src/themes/classic/modules/progress.variables +9 -0
- package/styles/vendor/semantic/src/themes/classic/views/card.overrides +98 -0
- package/styles/vendor/semantic/src/themes/classic/views/card.variables +22 -0
- package/{components/pages/ConfigureProgram/constants.js → styles/vendor/semantic/src/themes/colored/modules/checkbox.overrides} +0 -0
- package/styles/vendor/semantic/src/themes/colored/modules/checkbox.variables +29 -0
- package/styles/vendor/semantic/src/themes/default/assets/fonts/icons.eot +0 -0
- package/styles/vendor/semantic/src/themes/default/assets/fonts/icons.svg +685 -0
- package/styles/vendor/semantic/src/themes/default/assets/fonts/icons.ttf +0 -0
- package/styles/vendor/semantic/src/themes/default/assets/fonts/icons.woff +0 -0
- package/styles/vendor/semantic/src/themes/default/assets/fonts/icons.woff2 +0 -0
- package/styles/vendor/semantic/src/themes/default/assets/images/flags.png +0 -0
- package/styles/vendor/semantic/src/themes/default/collections/breadcrumb.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/collections/breadcrumb.variables +33 -0
- package/styles/vendor/semantic/src/themes/default/collections/form.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/collections/form.variables +195 -0
- package/styles/vendor/semantic/src/themes/default/collections/grid.overrides +4 -0
- package/styles/vendor/semantic/src/themes/default/collections/grid.variables +103 -0
- package/styles/vendor/semantic/src/themes/default/collections/menu.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/collections/menu.variables +458 -0
- package/styles/vendor/semantic/src/themes/default/collections/message.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/collections/message.variables +158 -0
- package/styles/vendor/semantic/src/themes/default/collections/table.overrides +0 -0
- package/styles/vendor/semantic/src/themes/default/collections/table.variables +246 -0
- package/styles/vendor/semantic/src/themes/default/elements/button.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/button.variables +358 -0
- package/styles/vendor/semantic/src/themes/default/elements/container.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/container.variables +58 -0
- package/styles/vendor/semantic/src/themes/default/elements/divider.overrides +18 -0
- package/styles/vendor/semantic/src/themes/default/elements/divider.variables +53 -0
- package/styles/vendor/semantic/src/themes/default/elements/flag.overrides +986 -0
- package/styles/vendor/semantic/src/themes/default/elements/flag.variables +13 -0
- package/styles/vendor/semantic/src/themes/default/elements/header.overrides +4 -0
- package/styles/vendor/semantic/src/themes/default/elements/header.variables +151 -0
- package/styles/vendor/semantic/src/themes/default/elements/icon.overrides +941 -0
- package/styles/vendor/semantic/src/themes/default/elements/icon.variables +62 -0
- package/styles/vendor/semantic/src/themes/default/elements/image.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/image.variables +44 -0
- package/styles/vendor/semantic/src/themes/default/elements/input.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/input.variables +101 -0
- package/styles/vendor/semantic/src/themes/default/elements/label.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/label.variables +254 -0
- package/styles/vendor/semantic/src/themes/default/elements/list.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/list.variables +224 -0
- package/styles/vendor/semantic/src/themes/default/elements/loader.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/loader.variables +72 -0
- package/styles/vendor/semantic/src/themes/default/elements/rail.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/rail.variables +34 -0
- package/styles/vendor/semantic/src/themes/default/elements/reveal.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/reveal.variables +17 -0
- package/styles/vendor/semantic/src/themes/default/elements/segment.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/elements/segment.variables +139 -0
- package/styles/vendor/semantic/src/themes/default/elements/step.overrides +16 -0
- package/styles/vendor/semantic/src/themes/default/elements/step.variables +130 -0
- package/styles/vendor/semantic/src/themes/default/globals/reset.overrides +429 -0
- package/styles/vendor/semantic/src/themes/default/globals/reset.variables +3 -0
- package/styles/vendor/semantic/src/themes/default/globals/site.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/globals/site.variables +936 -0
- package/styles/vendor/semantic/src/themes/default/modules/accordion.overrides +28 -0
- package/styles/vendor/semantic/src/themes/default/modules/accordion.variables +100 -0
- package/styles/vendor/semantic/src/themes/default/modules/chatroom.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/chatroom.variables +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/checkbox.overrides +36 -0
- package/styles/vendor/semantic/src/themes/default/modules/checkbox.variables +193 -0
- package/styles/vendor/semantic/src/themes/default/modules/dimmer.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/dimmer.variables +61 -0
- package/styles/vendor/semantic/src/themes/default/modules/dropdown.overrides +62 -0
- package/styles/vendor/semantic/src/themes/default/modules/dropdown.variables +373 -0
- package/styles/vendor/semantic/src/themes/default/modules/embed.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/embed.variables +53 -0
- package/styles/vendor/semantic/src/themes/default/modules/modal.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/modal.variables +151 -0
- package/styles/vendor/semantic/src/themes/default/modules/nag.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/nag.variables +74 -0
- package/styles/vendor/semantic/src/themes/default/modules/popup.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/popup.variables +137 -0
- package/styles/vendor/semantic/src/themes/default/modules/progress.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/progress.variables +113 -0
- package/styles/vendor/semantic/src/themes/default/modules/rating.overrides +68 -0
- package/styles/vendor/semantic/src/themes/default/modules/rating.variables +103 -0
- package/styles/vendor/semantic/src/themes/default/modules/search.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/search.variables +158 -0
- package/styles/vendor/semantic/src/themes/default/modules/shape.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/shape.variables +40 -0
- package/styles/vendor/semantic/src/themes/default/modules/sidebar.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/sidebar.variables +45 -0
- package/styles/vendor/semantic/src/themes/default/modules/sticky.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/sticky.variables +7 -0
- package/styles/vendor/semantic/src/themes/default/modules/tab.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/modules/tab.variables +11 -0
- package/styles/vendor/semantic/src/themes/default/modules/transition.overrides +910 -0
- package/styles/vendor/semantic/src/themes/default/modules/transition.variables +10 -0
- package/styles/vendor/semantic/src/themes/default/views/ad.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/views/ad.variables +13 -0
- package/styles/vendor/semantic/src/themes/default/views/card.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/views/card.variables +220 -0
- package/styles/vendor/semantic/src/themes/default/views/comment.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/views/comment.variables +104 -0
- package/styles/vendor/semantic/src/themes/default/views/feed.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/views/feed.variables +141 -0
- package/styles/vendor/semantic/src/themes/default/views/item.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/views/item.variables +154 -0
- package/styles/vendor/semantic/src/themes/default/views/statistic.overrides +3 -0
- package/styles/vendor/semantic/src/themes/default/views/statistic.variables +98 -0
- package/styles/vendor/semantic/src/themes/duo/elements/loader.overrides +3 -0
- package/styles/vendor/semantic/src/themes/duo/elements/loader.variables +6 -0
- package/styles/vendor/semantic/src/themes/fixed-width/collections/grid.overrides +3 -0
- package/styles/vendor/semantic/src/themes/fixed-width/collections/grid.variables +23 -0
- package/styles/vendor/semantic/src/themes/fixed-width/modules/modal.overrides +3 -0
- package/styles/vendor/semantic/src/themes/fixed-width/modules/modal.variables +37 -0
- package/styles/vendor/semantic/src/themes/flat/collections/form.overrides +28 -0
- package/styles/vendor/semantic/src/themes/flat/collections/form.variables +74 -0
- package/styles/vendor/semantic/src/themes/flat/globals/site.overrides +3 -0
- package/styles/vendor/semantic/src/themes/flat/globals/site.variables +107 -0
- package/styles/vendor/semantic/src/themes/github/assets/fonts/octicons-local.ttf +0 -0
- package/styles/vendor/semantic/src/themes/github/assets/fonts/octicons.svg +200 -0
- package/styles/vendor/semantic/src/themes/github/assets/fonts/octicons.ttf +0 -0
- package/styles/vendor/semantic/src/themes/github/assets/fonts/octicons.woff +0 -0
- package/styles/vendor/semantic/src/themes/github/collections/breadcrumb.variables +11 -0
- package/styles/vendor/semantic/src/themes/github/collections/form.overrides +16 -0
- package/styles/vendor/semantic/src/themes/github/collections/form.variables +40 -0
- package/styles/vendor/semantic/src/themes/github/collections/grid.variables +2 -0
- package/styles/vendor/semantic/src/themes/github/collections/menu.overrides +7 -0
- package/styles/vendor/semantic/src/themes/github/collections/menu.variables +61 -0
- package/styles/vendor/semantic/src/themes/github/collections/message.overrides +11 -0
- package/styles/vendor/semantic/src/themes/github/collections/message.variables +29 -0
- package/styles/vendor/semantic/src/themes/github/collections/table.variables +8 -0
- package/styles/vendor/semantic/src/themes/github/elements/button.overrides +4 -0
- package/styles/vendor/semantic/src/themes/github/elements/button.variables +77 -0
- package/styles/vendor/semantic/src/themes/github/elements/header.variables +9 -0
- package/styles/vendor/semantic/src/themes/github/elements/icon.overrides +208 -0
- package/styles/vendor/semantic/src/themes/github/elements/icon.variables +13 -0
- package/styles/vendor/semantic/src/themes/github/elements/image.variables +5 -0
- package/styles/vendor/semantic/src/themes/github/elements/input.overrides +32 -0
- package/styles/vendor/semantic/src/themes/github/elements/input.variables +16 -0
- package/styles/vendor/semantic/src/themes/github/elements/label.overrides +9 -0
- package/styles/vendor/semantic/src/themes/github/elements/label.variables +4 -0
- package/styles/vendor/semantic/src/themes/github/elements/segment.overrides +3 -0
- package/styles/vendor/semantic/src/themes/github/elements/segment.variables +40 -0
- package/styles/vendor/semantic/src/themes/github/elements/step.overrides +26 -0
- package/styles/vendor/semantic/src/themes/github/elements/step.variables +26 -0
- package/styles/vendor/semantic/src/themes/github/globals/site.variables +47 -0
- package/styles/vendor/semantic/src/themes/github/modules/dropdown.overrides +53 -0
- package/styles/vendor/semantic/src/themes/github/modules/dropdown.variables +35 -0
- package/styles/vendor/semantic/src/themes/github/modules/popup.variables +12 -0
- package/styles/vendor/semantic/src/themes/gmail/collections/message.overrides +0 -0
- package/styles/vendor/semantic/src/themes/gmail/collections/message.variables +15 -0
- package/styles/vendor/semantic/src/themes/instagram/views/card.overrides +12 -0
- package/styles/vendor/semantic/src/themes/instagram/views/card.variables +23 -0
- package/styles/vendor/semantic/src/themes/material/assets/fonts/icons.eot +0 -0
- package/styles/vendor/semantic/src/themes/material/assets/fonts/icons.svg +2373 -0
- package/styles/vendor/semantic/src/themes/material/assets/fonts/icons.ttf +0 -0
- package/styles/vendor/semantic/src/themes/material/assets/fonts/icons.woff +0 -0
- package/styles/vendor/semantic/src/themes/material/collections/menu.overrides +1 -0
- package/styles/vendor/semantic/src/themes/material/collections/menu.variables +10 -0
- package/styles/vendor/semantic/src/themes/material/elements/button.overrides +15 -0
- package/styles/vendor/semantic/src/themes/material/elements/button.variables +97 -0
- package/styles/vendor/semantic/src/themes/material/elements/header.overrides +15 -0
- package/styles/vendor/semantic/src/themes/material/elements/header.variables +21 -0
- package/styles/vendor/semantic/src/themes/material/elements/icon.overrides +934 -0
- package/styles/vendor/semantic/src/themes/material/elements/icon.variables +11 -0
- package/styles/vendor/semantic/src/themes/material/globals/site.overrides +0 -0
- package/styles/vendor/semantic/src/themes/material/globals/site.variables +128 -0
- package/styles/vendor/semantic/src/themes/material/modules/dropdown.overrides +5 -0
- package/styles/vendor/semantic/src/themes/material/modules/dropdown.variables +20 -0
- package/styles/vendor/semantic/src/themes/material/modules/modal.overrides +6 -0
- package/styles/vendor/semantic/src/themes/material/modules/modal.variables +15 -0
- package/styles/vendor/semantic/src/themes/pulsar/elements/loader.overrides +70 -0
- package/styles/vendor/semantic/src/themes/pulsar/elements/loader.variables +7 -0
- package/styles/vendor/semantic/src/themes/raised/elements/button.overrides +3 -0
- package/styles/vendor/semantic/src/themes/raised/elements/button.variables +27 -0
- package/styles/vendor/semantic/src/themes/resetcss/globals/reset.overrides +52 -0
- package/styles/vendor/semantic/src/themes/resetcss/globals/reset.variables +3 -0
- package/styles/vendor/semantic/src/themes/round/elements/button.overrides +0 -0
- package/styles/vendor/semantic/src/themes/round/elements/button.variables +138 -0
- package/styles/vendor/semantic/src/themes/rtl/globals/site.overrides +6 -0
- package/styles/vendor/semantic/src/themes/rtl/globals/site.variables +14 -0
- package/styles/vendor/semantic/src/themes/striped/modules/progress.overrides +29 -0
- package/styles/vendor/semantic/src/themes/striped/modules/progress.variables +3 -0
- package/styles/vendor/semantic/src/themes/timeline/views/feed.overrides +27 -0
- package/styles/vendor/semantic/src/themes/timeline/views/feed.variables +36 -0
- package/styles/vendor/semantic/src/themes/twitter/elements/button.overrides +13 -0
- package/styles/vendor/semantic/src/themes/twitter/elements/button.variables +44 -0
- package/styles/vendor/semantic/tasks/README.md +17 -0
- package/styles/vendor/semantic/tasks/admin/components/create.js +332 -0
- package/styles/vendor/semantic/tasks/admin/components/init.js +170 -0
- package/styles/vendor/semantic/tasks/admin/components/update.js +184 -0
- package/styles/vendor/semantic/tasks/admin/distributions/create.js +219 -0
- package/styles/vendor/semantic/tasks/admin/distributions/init.js +169 -0
- package/styles/vendor/semantic/tasks/admin/distributions/update.js +179 -0
- package/styles/vendor/semantic/tasks/admin/publish.js +25 -0
- package/styles/vendor/semantic/tasks/admin/register.js +55 -0
- package/styles/vendor/semantic/tasks/admin/release.js +29 -0
- package/styles/vendor/semantic/tasks/build/assets.js +35 -0
- package/styles/vendor/semantic/tasks/build/css.js +113 -0
- package/styles/vendor/semantic/tasks/build/javascript.js +77 -0
- package/styles/vendor/semantic/tasks/build.js +50 -0
- package/styles/vendor/semantic/tasks/check-install.js +28 -0
- package/styles/vendor/semantic/tasks/clean.js +14 -0
- package/styles/vendor/semantic/tasks/collections/README.md +16 -0
- package/styles/vendor/semantic/tasks/collections/admin.js +49 -0
- package/styles/vendor/semantic/tasks/collections/build.js +19 -0
- package/styles/vendor/semantic/tasks/collections/internal.js +227 -0
- package/styles/vendor/semantic/tasks/collections/rtl.js +16 -0
- package/styles/vendor/semantic/tasks/config/admin/github.js +37 -0
- package/styles/vendor/semantic/tasks/config/admin/oauth.example.js +11 -0
- package/styles/vendor/semantic/tasks/config/admin/release.js +111 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/README.md +32 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/bower.json +29 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/component-package.js +14 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/composer.json +20 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/css-package.js +34 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/less-package.js +21 -0
- package/styles/vendor/semantic/tasks/config/admin/templates/package.json +17 -0
- package/styles/vendor/semantic/tasks/config/defaults.js +117 -0
- package/styles/vendor/semantic/tasks/config/docs.js +32 -0
- package/styles/vendor/semantic/tasks/config/npm/gulpfile.js +72 -0
- package/styles/vendor/semantic/tasks/config/project/config.js +141 -0
- package/styles/vendor/semantic/tasks/config/project/install.js +763 -0
- package/styles/vendor/semantic/tasks/config/project/release.js +65 -0
- package/styles/vendor/semantic/tasks/config/tasks.js +166 -0
- package/styles/vendor/semantic/tasks/config/user.js +58 -0
- package/styles/vendor/semantic/tasks/docs/build.js +189 -0
- package/styles/vendor/semantic/tasks/docs/metadata.js +138 -0
- package/styles/vendor/semantic/tasks/docs/serve.js +255 -0
- package/styles/vendor/semantic/tasks/install.js +459 -0
- package/styles/vendor/semantic/tasks/rtl/build.js +132 -0
- package/styles/vendor/semantic/tasks/rtl/watch.js +221 -0
- package/styles/vendor/semantic/tasks/version.js +11 -0
- package/styles/vendor/semantic/tasks/watch.js +231 -0
- package/tests/i18n.test.js +9 -5
- package/tests/store.test.js +5 -22
- package/translations/en.json +381 -1148
- package/translations/zh.json +381 -1148
- package/utils/ApiCaller.js +101 -0
- package/utils/Formatter.js +77 -0
- package/utils/asyncInjectors.js +78 -0
- package/utils/authWrapper.js +26 -64
- package/utils/common.js +23 -0
- package/utils/jed.js +1497 -0
- package/utils/messageUtils.js +11 -0
- package/utils/smsCharCount.js +351 -0
- package/utils/smsCharCountV2.js +143 -0
- package/utils/tests/asyncInjectors.test.js +173 -0
- package/.htaccess +0 -52
- package/assets/access.png +0 -0
- package/assets/add-event.png +0 -0
- package/assets/addUser.svg +0 -34
- package/assets/atoms-icons-24-gift (1).svg +0 -22
- package/assets/atoms-illustration.png +0 -0
- package/assets/award-point.svg +0 -20
- package/assets/bill-point.svg +0 -15
- package/assets/calendar.svg +0 -24
- package/assets/color.svg +0 -20
- package/assets/confirmation.png +0 -0
- package/assets/contribute.svg +0 -28
- package/assets/coupon.svg +0 -26
- package/assets/delay.svg +0 -24
- package/assets/delete.svg +0 -14
- package/assets/dotted.png +0 -0
- package/assets/ebill.svg +0 -15
- package/assets/elephant.svg +0 -1
- package/assets/facebook.svg +0 -22
- package/assets/file-selector.svg +0 -11
- package/assets/forward.svg +0 -20
- package/assets/gift.svg +0 -22
- package/assets/group.svg +0 -28
- package/assets/integration.svg +0 -1
- package/assets/link.svg +0 -30
- package/assets/membership.svg +0 -24
- package/assets/message.svg +0 -20
- package/assets/mobile-push.svg +0 -22
- package/assets/notepad.svg +0 -20
- package/assets/offersIllustration.svg +0 -1
- package/assets/penguin.svg +0 -19
- package/assets/pigeon.svg +0 -17
- package/assets/points.svg +0 -28
- package/assets/referal.svg +0 -20
- package/assets/refresh-delay.svg +0 -24
- package/assets/refresh.svg +0 -11
- package/assets/removeCart.svg +0 -24
- package/assets/removeUser.svg +0 -24
- package/assets/renew.svg +0 -11
- package/assets/repair.png +0 -0
- package/assets/return.svg +0 -20
- package/assets/reverse-return.svg +0 -20
- package/assets/reward.svg +0 -18
- package/assets/social.svg +0 -20
- package/assets/star.svg +0 -20
- package/assets/target.svg +0 -24
- package/assets/thin-close.svg +0 -22
- package/assets/transfer.svg +0 -24
- package/assets/trigger.svg +0 -24
- package/assets/unlink.svg +0 -32
- package/assets/upgrade.svg +0 -26
- package/assets/users.svg +0 -18
- package/assets/wechat.svg +0 -18
- package/components/atoms/AvatarIcon/AvatarIcon.js +0 -42
- package/components/atoms/AvatarIcon/index.js +0 -1
- package/components/atoms/AvatarIcon/stories/AvatarIcon.stories.js +0 -12
- package/components/atoms/AvatarIcon/tests/AvatarIcon.test.js +0 -32
- package/components/atoms/AvatarIcon/tests/__snapshots__/AvatarIcon.test.js.snap +0 -116
- package/components/atoms/CustomSkeleton/CustomSkeleton.js +0 -61
- package/components/atoms/CustomSkeleton/index.js +0 -1
- package/components/atoms/CustomSkeleton/stories/CustomSkeleton.stories.js +0 -5
- package/components/atoms/CustomSkeleton/style.js +0 -18
- package/components/atoms/CustomSkeleton/tests/__snapshots__/index.test.js.snap +0 -66
- package/components/atoms/CustomSkeleton/tests/index.test.js +0 -29
- package/components/atoms/ElementToElementWrap/ElementToElementWrap.js +0 -26
- package/components/atoms/ElementToElementWrap/index.js +0 -1
- package/components/atoms/ElementToElementWrap/stories/ElementToElementWrap.stories.js +0 -5
- package/components/atoms/ElementToElementWrap/style.js +0 -5
- package/components/atoms/ElementToElementWrap/tests/__snapshots__/index.test.js.snap +0 -22
- package/components/atoms/ElementToElementWrap/tests/index.test.js +0 -19
- package/components/atoms/EllipsisText/EllipsisText.js +0 -16
- package/components/atoms/EllipsisText/index.js +0 -2
- package/components/atoms/EllipsisText/tests/__snapshots__/index.test.js.snap +0 -22
- package/components/atoms/EllipsisText/tests/index.test.js +0 -19
- package/components/atoms/GroupItemLabel/GroupItemLabel.js +0 -45
- package/components/atoms/GroupItemLabel/index.js +0 -1
- package/components/atoms/GroupItemLabel/style.js +0 -15
- package/components/atoms/GroupItemLabel/tests/__snapshots__/index.test.js.snap +0 -32
- package/components/atoms/GroupItemLabel/tests/index.test.js +0 -35
- package/components/atoms/Heading/Heading.js +0 -20
- package/components/atoms/Heading/index.js +0 -1
- package/components/atoms/Heading/stories/Heading.stories.js +0 -7
- package/components/atoms/Heading/style.js +0 -6
- package/components/atoms/Heading/tests/__snapshots__/index.test.js.snap +0 -9
- package/components/atoms/Heading/tests/index.test.js +0 -10
- package/components/atoms/Label/Label.js +0 -8
- package/components/atoms/Label/index.js +0 -1
- package/components/atoms/Label/tests/__snapshots__/index.test.js.snap +0 -17
- package/components/atoms/Label/tests/index.test.js +0 -19
- package/components/atoms/LdsErrorState/LdsErrorState.js +0 -148
- package/components/atoms/LdsErrorState/index.js +0 -1
- package/components/atoms/LdsErrorState/tests/__snapshots__/index.test.js.snap +0 -161
- package/components/atoms/LdsErrorState/tests/index.test.js +0 -10
- package/components/atoms/LdsNoDataState/LdsNoDataState.js +0 -113
- package/components/atoms/LdsNoDataState/index.js +0 -1
- package/components/atoms/LdsNoDataState/tests/__snapshots__/index.test.js.snap +0 -100
- package/components/atoms/LdsNoDataState/tests/index.test.js +0 -10
- package/components/atoms/PrimaryInput/PrimaryInput.js +0 -59
- package/components/atoms/PrimaryInput/constants.js +0 -7
- package/components/atoms/PrimaryInput/index.js +0 -1
- package/components/atoms/PrimaryInput/stories/PrimaryInput.stories.js +0 -25
- package/components/atoms/PrimaryInput/style.js +0 -26
- package/components/atoms/PrimaryInput/tests/__snapshots__/index.test.js.snap +0 -78
- package/components/atoms/PrimaryInput/tests/index.test.js +0 -60
- package/components/atoms/PrimarySelect/PrimarySelect.js +0 -57
- package/components/atoms/PrimarySelect/index.js +0 -1
- package/components/atoms/PrimarySelect/stories/PrimarySelect.stories.js +0 -25
- package/components/atoms/PrimarySelect/tests/__snapshots__/index.test.js.snap +0 -116
- package/components/atoms/PrimarySelect/tests/index.test.js +0 -55
- package/components/atoms/RenderRoute/RenderRoute.js +0 -16
- package/components/atoms/RenderRoute/index.js +0 -1
- package/components/atoms/RenderRoute/stories/RenderRoute.stories.js +0 -8
- package/components/atoms/RenderRoute/tests/__snapshots__/index.test.js.snap +0 -271
- package/components/atoms/RenderRoute/tests/index.test.js +0 -16
- package/components/atoms/ReonNotEnabled/ReonNotEnabled.js +0 -403
- package/components/atoms/ReonNotEnabled/index.js +0 -1
- package/components/atoms/ReonNotEnabled/stories/ReonNotEnabled.stories.js +0 -5
- package/components/atoms/ReonNotEnabled/tests/__snapshots__/index.test.js.snap +0 -528
- package/components/atoms/ReonNotEnabled/tests/index.test.js +0 -10
- package/components/atoms/SelectOptionLabelWithInfo/SelectOptionLabelWithInfo.js +0 -73
- package/components/atoms/SelectOptionLabelWithInfo/index.js +0 -1
- package/components/atoms/SelectOptionLabelWithInfo/tests/__snapshots__/index.test.js.snap +0 -65
- package/components/atoms/SelectOptionLabelWithInfo/tests/index.test.js +0 -23
- package/components/atoms/SortIcon/SortIcon.js +0 -53
- package/components/atoms/SortIcon/index.js +0 -1
- package/components/atoms/SortIcon/stories/SortIcon.stories.js +0 -5
- package/components/atoms/SortIcon/style.js +0 -31
- package/components/atoms/SortIcon/tests/__snapshots__/index.test.js.snap +0 -46
- package/components/atoms/SortIcon/tests/index.test.js +0 -18
- package/components/atoms/StatusColor/StatusColor.js +0 -63
- package/components/atoms/StatusColor/index.js +0 -1
- package/components/atoms/StatusColor/stories/StatusColor.stories.js +0 -7
- package/components/atoms/StatusColor/style.js +0 -9
- package/components/atoms/StatusColor/tests/__snapshots__/index.test.js.snap +0 -28
- package/components/atoms/StatusColor/tests/index.test.js +0 -20
- package/components/atoms/Tag/Tag.js +0 -97
- package/components/atoms/Tag/index.js +0 -1
- package/components/atoms/Tag/stories/Tag.stories.js +0 -14
- package/components/atoms/Tag/style.js +0 -19
- package/components/atoms/Tag/tests/__snapshots__/index.test.js.snap +0 -101
- package/components/atoms/Tag/tests/index.test.js +0 -34
- package/components/atoms/TriggerAction/TriggerAction.js +0 -43
- package/components/atoms/TriggerAction/index.js +0 -1
- package/components/atoms/TriggerAction/tests/__snapshots__/index.test.js.snap +0 -38
- package/components/atoms/TriggerAction/tests/index.test.js +0 -54
- package/components/molecules/AccessCard/AccessCard.js +0 -35
- package/components/molecules/AccessCard/index.js +0 -1
- package/components/molecules/AccessCard/messages.js +0 -20
- package/components/molecules/AccessCard/stories/AccessCard.stories.js +0 -7
- package/components/molecules/AccessCard/style.js +0 -22
- package/components/molecules/AccessCard/tests/AccessCard.test.js +0 -13
- package/components/molecules/AccessCard/tests/__snapshots__/AccessCard.test.js.snap +0 -32
- package/components/molecules/ActionExpression/ActionExpression.js +0 -135
- package/components/molecules/ActionExpression/index.js +0 -1
- package/components/molecules/ActionExpression/style.js +0 -10
- package/components/molecules/ActionExpression/tests/ActionExpression.test.js +0 -37
- package/components/molecules/ActionExpression/tests/__snapshots__/ActionExpression.test.js.snap +0 -87
- package/components/molecules/ActionTitle/ActionTitle.js +0 -44
- package/components/molecules/ActionTitle/index.js +0 -1
- package/components/molecules/ActionTitle/tests/ActionTitle.test.js +0 -23
- package/components/molecules/ActionTitle/tests/__snapshots__/ActionTitle.test.js.snap +0 -11
- package/components/molecules/AddActionConditionWorkflow/AddActionConditionWorkflow.js +0 -87
- package/components/molecules/AddActionConditionWorkflow/index.js +0 -1
- package/components/molecules/AddActionConditionWorkflow/style.js +0 -9
- package/components/molecules/AddMoreCard/AddMoreCard.js +0 -28
- package/components/molecules/AddMoreCard/index.js +0 -1
- package/components/molecules/AddMoreCard/style.js +0 -23
- package/components/molecules/AddTierBanner/AddTierBanner.js +0 -46
- package/components/molecules/AddTierBanner/index.js +0 -1
- package/components/molecules/AddTierPrimaryInfo/AddTierPrimaryInfo.js +0 -150
- package/components/molecules/AddTierPrimaryInfo/index.js +0 -1
- package/components/molecules/AddTierPrimaryInfo/messages.js +0 -28
- package/components/molecules/AddTrackersInfo/AddTrackersInfo.js +0 -53
- package/components/molecules/AddTrackersInfo/index.js +0 -1
- package/components/molecules/AddTrackersInfo/messages.js +0 -17
- package/components/molecules/AddTrackersInfo/style.js +0 -31
- package/components/molecules/AdvanceSettingScrollContainer/AdvanceSettingScrollContainer.js +0 -64
- package/components/molecules/AdvanceSettingScrollContainer/index.js +0 -1
- package/components/molecules/AdvanceSettingScrollContainer/style.js +0 -28
- package/components/molecules/ButtonWithPagination/ButtonWithPagination.js +0 -51
- package/components/molecules/ButtonWithPagination/index.js +0 -1
- package/components/molecules/ButtonWithPagination/style.js +0 -9
- package/components/molecules/CardWithHeadingAction/CardWithHeadingAction.js +0 -47
- package/components/molecules/CardWithHeadingAction/index.js +0 -1
- package/components/molecules/CardWithHeadingAction/style.js +0 -37
- package/components/molecules/CardsCommunication/CardsCommunication.js +0 -118
- package/components/molecules/CardsCommunication/constants.js +0 -4
- package/components/molecules/CardsCommunication/index.js +0 -2
- package/components/molecules/CardsCommunication/messages.js +0 -24
- package/components/molecules/CardsCommunication/style.js +0 -18
- package/components/molecules/CardsCommunication/utils.js +0 -35
- package/components/molecules/CardsWithCheckboxCommunication/CardsWithCheckboxCommunication.js +0 -58
- package/components/molecules/CardsWithCheckboxCommunication/constants.js +0 -1
- package/components/molecules/CardsWithCheckboxCommunication/index.js +0 -1
- package/components/molecules/CardsWithCheckboxCommunication/messages.js +0 -17
- package/components/molecules/CardsWithCheckboxCommunication/style.js +0 -14
- package/components/molecules/CheckboxWithInputPrefix/CheckboxWithInputPrefix.js +0 -79
- package/components/molecules/CheckboxWithInputPrefix/index.js +0 -1
- package/components/molecules/CheckboxWithInputPrefix/style.js +0 -23
- package/components/molecules/CollapsableContent/CollapsableContent.js +0 -62
- package/components/molecules/CollapsableContent/index.js +0 -1
- package/components/molecules/CollapsableContent/style.js +0 -32
- package/components/molecules/CollapseWithDateRange/CollapseWithDateRange.js +0 -61
- package/components/molecules/CollapseWithDateRange/index.js +0 -1
- package/components/molecules/CollapseWithInput/CollapseWithInput.js +0 -51
- package/components/molecules/CollapseWithInput/index.js +0 -1
- package/components/molecules/CollapseWithMultiSelect/CollapseWithMultiSelect.js +0 -62
- package/components/molecules/CollapseWithMultiSelect/index.js +0 -1
- package/components/molecules/CollapseWithRadioGroup/CollapseWithRadioGroup.js +0 -55
- package/components/molecules/CollapseWithRadioGroup/index.js +0 -1
- package/components/molecules/CollapseWithSelectAndInput/CollapseWithSelectAndInput.js +0 -93
- package/components/molecules/CollapseWithSelectAndInput/index.js +0 -1
- package/components/molecules/CollapseWithSelectAndInput/style.js +0 -9
- package/components/molecules/CollapseWithStore/CollapseWithStore.js +0 -81
- package/components/molecules/CollapseWithStore/index.js +0 -1
- package/components/molecules/CollapseWithSwitchSelect/CollapseWithSwitchSelect.js +0 -69
- package/components/molecules/CollapseWithSwitchSelect/index.js +0 -1
- package/components/molecules/ColorPatch/ColorPatch.js +0 -26
- package/components/molecules/ColorPatch/index.js +0 -1
- package/components/molecules/ColorPatch/style.js +0 -34
- package/components/molecules/ColorSelector/ColorSelector.js +0 -112
- package/components/molecules/ColorSelector/index.js +0 -1
- package/components/molecules/ColorSelector/style.js +0 -73
- package/components/molecules/CommunicationTable/CommunicationTable.js +0 -327
- package/components/molecules/CommunicationTable/constants.js +0 -9
- package/components/molecules/CommunicationTable/index.js +0 -1
- package/components/molecules/CommunicationTable/messages.js +0 -28
- package/components/molecules/CommunicationTable/stories/CommunicationTable.stories.js +0 -15
- package/components/molecules/CommunicationTable/stories/mockData.js +0 -52
- package/components/molecules/CommunicationTable/style.js +0 -121
- package/components/molecules/CommunicationTable/tests/index.test.js +0 -9
- package/components/molecules/ConfirmationModal/ConfirmationModal.js +0 -102
- package/components/molecules/ConfirmationModal/index.js +0 -1
- package/components/molecules/ConfirmationModal/style.js +0 -61
- package/components/molecules/ContentPreviews/ContentPreviews.js +0 -123
- package/components/molecules/ContentPreviews/constants.js +0 -1
- package/components/molecules/ContentPreviews/index.js +0 -1
- package/components/molecules/ContentPreviews/mockData.js +0 -95
- package/components/molecules/ContentPreviews/style.js +0 -36
- package/components/molecules/ContentPreviews/tests/__snapshots__/index.test.js.snap +0 -181
- package/components/molecules/ContentPreviews/tests/index.test.js +0 -30
- package/components/molecules/ContentWithHeading/ContentWithHeading.js +0 -27
- package/components/molecules/ContentWithHeading/index.js +0 -1
- package/components/molecules/CreateActionButton/CreateActionButton.js +0 -73
- package/components/molecules/CreateActionButton/index.js +0 -1
- package/components/molecules/CreateActionButton/style.js +0 -10
- package/components/molecules/CreateOfferInfo/CreateOfferInfo.js +0 -61
- package/components/molecules/CreateOfferInfo/index.js +0 -1
- package/components/molecules/CreateOfferInfo/messages.js +0 -21
- package/components/molecules/CreateOfferInfo/style.js +0 -23
- package/components/molecules/CreateTierInfo/CreateTierInfo.js +0 -64
- package/components/molecules/CreateTierInfo/index.js +0 -1
- package/components/molecules/CreateTierInfo/messages.js +0 -25
- package/components/molecules/CreateTierInfo/style.js +0 -24
- package/components/molecules/CreateTracker/CreateTracker.js +0 -903
- package/components/molecules/CreateTracker/actions.js +0 -14
- package/components/molecules/CreateTracker/constants.js +0 -12
- package/components/molecules/CreateTracker/index.js +0 -1
- package/components/molecules/CreateTracker/messages.js +0 -247
- package/components/molecules/CreateTracker/reducer.js +0 -51
- package/components/molecules/CreateTracker/saga.js +0 -64
- package/components/molecules/CreateTracker/selectors.js +0 -32
- package/components/molecules/CreateTracker/style.js +0 -57
- package/components/molecules/CreativesErrorFallBack/CreativesErrorFallback.js +0 -33
- package/components/molecules/CreativesErrorFallBack/index.js +0 -1
- package/components/molecules/CreativesErrorFallBack/style.js +0 -10
- package/components/molecules/CustomTree/CustomTree.js +0 -51
- package/components/molecules/CustomTree/index.js +0 -1
- package/components/molecules/CustomTree/style.js +0 -59
- package/components/molecules/DelayCreatives/DelayCreatives.js +0 -252
- package/components/molecules/DelayCreatives/index.js +0 -1
- package/components/molecules/DelayCreatives/messages.js +0 -20
- package/components/molecules/DelayCreatives/style.js +0 -64
- package/components/molecules/DividerInlinedText/DividerInlinedText.js +0 -42
- package/components/molecules/DividerInlinedText/index.js +0 -1
- package/components/molecules/DividerInlinedText/style.js +0 -21
- package/components/molecules/DowngradeTier/DowngradeTier.js +0 -211
- package/components/molecules/DowngradeTier/index.js +0 -1
- package/components/molecules/DowngradeTier/messages.js +0 -39
- package/components/molecules/EmptyStateIllustration/EmptyStateIllustration.js +0 -47
- package/components/molecules/EmptyStateIllustration/index.js +0 -1
- package/components/molecules/EmptyStateIllustration/messages.js +0 -21
- package/components/molecules/EmptyStateIllustration/stories/EmptyStateIllustration.stories.js +0 -7
- package/components/molecules/EmptyStateIllustration/style.js +0 -11
- package/components/molecules/EmptyStateIllustration/tests/index.test.js +0 -11
- package/components/molecules/ErrorBoundaryWrapper/ErrorBoundaryWrapper.js +0 -87
- package/components/molecules/ErrorBoundaryWrapper/index.js +0 -1
- package/components/molecules/ErrorBoundaryWrapper/messages.js +0 -24
- package/components/molecules/ExpandedStepsWithContent/ExandedStepsWithContent.js +0 -98
- package/components/molecules/ExpandedStepsWithContent/index.js +0 -1
- package/components/molecules/ExpandedStepsWithContent/messages.js +0 -16
- package/components/molecules/ExpandedStepsWithContent/style.js +0 -63
- package/components/molecules/FileSelector/FileSelector.js +0 -81
- package/components/molecules/FileSelector/index.js +0 -1
- package/components/molecules/FileSelector/messages.js +0 -40
- package/components/molecules/FileSelector/style.js +0 -14
- package/components/molecules/HeaderWithButton/HeaderWithButton.js +0 -49
- package/components/molecules/HeaderWithButton/index.js +0 -1
- package/components/molecules/HeaderWithInput/HeaderWithInput.js +0 -79
- package/components/molecules/HeaderWithInput/index.js +0 -1
- package/components/molecules/HeaderWithInput/style.js +0 -18
- package/components/molecules/InfoBanner/InfoBanner.js +0 -54
- package/components/molecules/InfoBanner/index.js +0 -1
- package/components/molecules/InfoBanner/style.js +0 -39
- package/components/molecules/InputToInput/InputToInput.js +0 -49
- package/components/molecules/InputToInput/index.js +0 -1
- package/components/molecules/InputToInput/stories/InputToInput.stories.js +0 -24
- package/components/molecules/InputToInput/style.js +0 -10
- package/components/molecules/InputToInput/tests/index.test.js +0 -11
- package/components/molecules/InputWithPrefixSufix/InputWithPrefixSufix.js +0 -70
- package/components/molecules/InputWithPrefixSufix/index.js +0 -1
- package/components/molecules/InputWithPrefixSufix/style.js +0 -27
- package/components/molecules/LabelWithDivider/LabelWithDivider.js +0 -29
- package/components/molecules/LabelWithDivider/index.js +0 -1
- package/components/molecules/LoyaltyStatus/LoyaltyStatus.js +0 -57
- package/components/molecules/LoyaltyStatus/constants.js +0 -6
- package/components/molecules/LoyaltyStatus/index.js +0 -1
- package/components/molecules/LoyaltyStatus/messages.js +0 -24
- package/components/molecules/LoyaltyStatus/stories/LoyaltyStatus.stories.js +0 -7
- package/components/molecules/LoyaltyStatus/style.js +0 -12
- package/components/molecules/LoyaltyStatus/tests/LoyaltyStatus.test.js +0 -17
- package/components/molecules/LoyaltyStatus/tests/__snapshots__/LoyaltyStatus.test.js.snap +0 -3583
- package/components/molecules/LoyaltyStatus/tests/mockdata.js +0 -1
- package/components/molecules/MoreLabel/MoreLabel.js +0 -56
- package/components/molecules/MoreLabel/index.js +0 -1
- package/components/molecules/MoreLabel/messages.js +0 -16
- package/components/molecules/NudgeModal/NudgeModal.js +0 -78
- package/components/molecules/NudgeModal/index.js +0 -1
- package/components/molecules/NudgeModal/style.js +0 -26
- package/components/molecules/NumberInput/NumberInput.js +0 -131
- package/components/molecules/NumberInput/constants.js +0 -5
- package/components/molecules/NumberInput/index.js +0 -1
- package/components/molecules/NumberInput/style.js +0 -10
- package/components/molecules/PageHeader/PageHeader.js +0 -177
- package/components/molecules/PageHeader/index.js +0 -1
- package/components/molecules/PageHeader/stories/PageHeader.stories.js +0 -20
- package/components/molecules/PageHeader/style.js +0 -65
- package/components/molecules/PageHeader/tests/PageHeader.test.js +0 -40
- package/components/molecules/PageHeader/tests/__snapshots__/PageHeader.test.js.snap +0 -2342
- package/components/molecules/PageHeaderDescription/PageHeaderDescription.js +0 -80
- package/components/molecules/PageHeaderDescription/index.js +0 -1
- package/components/molecules/PageHeaderDescription/stories/PageHeaderDescription.stories.js +0 -14
- package/components/molecules/PageHeaderDescription/style.js +0 -45
- package/components/molecules/PageHeaderDescription/tests/PageHeaderDescription.test.js +0 -32
- package/components/molecules/PageHeaderDescription/tests/__snapshots__/PageHeaderDescription.test.js.snap +0 -749
- package/components/molecules/PointExpiryCommunication/PointExpiryCommunication.js +0 -360
- package/components/molecules/PointExpiryCommunication/constants.js +0 -12
- package/components/molecules/PointExpiryCommunication/index.js +0 -1
- package/components/molecules/PointExpiryCommunication/messages.js +0 -44
- package/components/molecules/PointExpiryCommunication/style.js +0 -50
- package/components/molecules/PointExpiryCommunication/tests/__snapshots__/index.test.js.snap +0 -38
- package/components/molecules/PointExpiryCommunication/tests/index.test.js +0 -13
- package/components/molecules/ProgramName/ProgramName.js +0 -109
- package/components/molecules/ProgramName/index.js +0 -1
- package/components/molecules/ProgramName/stories/ProgramName.stories.js +0 -5
- package/components/molecules/ProgramName/style.js +0 -45
- package/components/molecules/ProgramName/tests/index.test.js +0 -11
- package/components/molecules/ProgramTitle/ProgramTitle.js +0 -65
- package/components/molecules/ProgramTitle/index.js +0 -1
- package/components/molecules/ProgramTitle/stories/ProgramTitle.stories.js +0 -5
- package/components/molecules/ProgramTitle/tests/index.test.js +0 -11
- package/components/molecules/ProgramValueSkeleton/ProgramValueSkeleton.js +0 -85
- package/components/molecules/ProgramValueSkeleton/index.js +0 -1
- package/components/molecules/ProgramValueSkeleton/stories/ProgramValueSkeleton.stories.js +0 -5
- package/components/molecules/ProgramValueSkeleton/style.js +0 -10
- package/components/molecules/ProgramValueSkeleton/tests/index.test.js +0 -11
- package/components/molecules/RadioCardWithAction/RadioCardWithAction.js +0 -57
- package/components/molecules/RadioCardWithAction/index.js +0 -1
- package/components/molecules/RadioContentSlidebox/RadioContentSlidebox.js +0 -58
- package/components/molecules/RadioContentSlidebox/index.js +0 -1
- package/components/molecules/RadioWithInfo/RadioWithInfo.js +0 -60
- package/components/molecules/RadioWithInfo/index.js +0 -1
- package/components/molecules/RadioWithInfo/stories/RadioWithInfo.stories.js +0 -15
- package/components/molecules/RadioWithInfo/style.js +0 -62
- package/components/molecules/RadioWithInfo/tests/RadioWithInfo.test.js +0 -15
- package/components/molecules/RadioWithInfo/tests/__snapshots__/RadioWithInfo.test.js.snap +0 -1659
- package/components/molecules/RenewalTier/RenewalTier.js +0 -270
- package/components/molecules/RenewalTier/constants.js +0 -9
- package/components/molecules/RenewalTier/index.js +0 -1
- package/components/molecules/RenewalTier/messages.js +0 -40
- package/components/molecules/ReviewTierModal/ReviewTierModal.js +0 -128
- package/components/molecules/ReviewTierModal/index.js +0 -1
- package/components/molecules/ReviewTierModal/messages.js +0 -20
- package/components/molecules/ReviewTierModal/style.js +0 -38
- package/components/molecules/RowHeader/RowHeader.js +0 -86
- package/components/molecules/RowHeader/index.js +0 -1
- package/components/molecules/RowHeader/stories/RowHeader.stories.js +0 -7
- package/components/molecules/RowHeader/style.js +0 -7
- package/components/molecules/RowHeader/tests/RowHeader.test.js +0 -42
- package/components/molecules/RowHeader/tests/__snapshots__/RowHeader.test.js.snap +0 -699
- package/components/molecules/SelectApiWrapper/SelectApiWrapper.js +0 -119
- package/components/molecules/SelectApiWrapper/index.js +0 -1
- package/components/molecules/SelectApiWrapper/messages.js +0 -20
- package/components/molecules/SelectApiWrapper/style.js +0 -14
- package/components/molecules/SelectCollection/SelectCollection.js +0 -69
- package/components/molecules/SelectCollection/index.js +0 -2
- package/components/molecules/SelectCollection/stories/SelectCollection.stories.js +0 -24
- package/components/molecules/SelectCollection/style.js +0 -8
- package/components/molecules/SelectCollection/tests/index.test.js +0 -11
- package/components/molecules/SelectsWithAction/SelectsWithAction.js +0 -70
- package/components/molecules/SelectsWithAction/index.js +0 -1
- package/components/molecules/SenderCreatives/SenderCreatives.js +0 -41
- package/components/molecules/SenderInformation/SenderInformation.js +0 -162
- package/components/molecules/SenderInformation/index.js +0 -1
- package/components/molecules/SenderInformation/messages.js +0 -72
- package/components/molecules/SenderInformation/style.js +0 -27
- package/components/molecules/SenderSlideBox/SenderSlideBox.js +0 -430
- package/components/molecules/SenderSlideBox/index.js +0 -1
- package/components/molecules/SenderSlideBox/style.js +0 -79
- package/components/molecules/SomethingWentWrong/SomethingWentWrong.js +0 -52
- package/components/molecules/SomethingWentWrong/index.js +0 -1
- package/components/molecules/SomethingWentWrong/style.js +0 -5
- package/components/molecules/SortHeader/SortHeader.js +0 -55
- package/components/molecules/SortHeader/index.js +0 -1
- package/components/molecules/SortHeader/stories/SortHeader.stories.js +0 -5
- package/components/molecules/SortHeader/tests/index.test.js +0 -11
- package/components/molecules/StrategiesTag/StrategiesTag.js +0 -71
- package/components/molecules/StrategiesTag/index.js +0 -1
- package/components/molecules/StrategiesTag/style.js +0 -15
- package/components/molecules/SuggestionCard/SuggestionCard.js +0 -121
- package/components/molecules/SuggestionCard/index.js +0 -1
- package/components/molecules/SuggestionCard/messages.js +0 -20
- package/components/molecules/SuggestionCard/stories/SuggestionCard.stories.js +0 -16
- package/components/molecules/SuggestionCard/style.js +0 -56
- package/components/molecules/SuggestionCard/tests/index.test.js +0 -11
- package/components/molecules/SwitchWithDivider/SwitchWithDivider.js +0 -77
- package/components/molecules/SwitchWithDivider/index.js +0 -1
- package/components/molecules/SwitchWithDivider/style.js +0 -29
- package/components/molecules/SyncLabel/SyncLabel.js +0 -54
- package/components/molecules/SyncLabel/index.js +0 -1
- package/components/molecules/SyncLabel/messages.js +0 -11
- package/components/molecules/SyncLabel/stories/SyncLabel.stories.js +0 -5
- package/components/molecules/SyncLabel/style.js +0 -12
- package/components/molecules/SyncLabel/tests/SyncLabel.test.js +0 -22
- package/components/molecules/SyncLabel/tests/__snapshots__/SyncLabel.test.js.snap +0 -2708
- package/components/molecules/TableCommunication/constants.js +0 -9
- package/components/molecules/TableCommunication/index.js +0 -1
- package/components/molecules/TableOption/TableOption.js +0 -59
- package/components/molecules/TableOption/index.js +0 -1
- package/components/molecules/TableOption/stories/TableOption.stories.js +0 -5
- package/components/molecules/TableOption/tests/index.test.js +0 -11
- package/components/molecules/TagForCapAndScope/TagForCapAndScope.js +0 -47
- package/components/molecules/TagForCapAndScope/index.js +0 -1
- package/components/molecules/TagForCapAndScope/style.js +0 -19
- package/components/molecules/TagsTab/TagsTab.js +0 -77
- package/components/molecules/TagsTab/index.js +0 -1
- package/components/molecules/TagsTab/stories/TagsTab.stories.js +0 -8
- package/components/molecules/TagsTab/stories/mockData.js +0 -9
- package/components/molecules/TagsTab/style.js +0 -14
- package/components/molecules/TagsTab/tests/index.test.js +0 -11
- package/components/molecules/TierButtonInput/TierButtonInput.js +0 -56
- package/components/molecules/TierButtonInput/index.js +0 -1
- package/components/molecules/TierButtonInput/messages.js +0 -16
- package/components/molecules/TierButtonInput/style.js +0 -31
- package/components/molecules/TierCard/BlockContent.js +0 -106
- package/components/molecules/TierCard/CardBody.js +0 -314
- package/components/molecules/TierCard/CardContent.js +0 -51
- package/components/molecules/TierCard/TierCard.js +0 -123
- package/components/molecules/TierCard/TierWithContent.js +0 -62
- package/components/molecules/TierCard/constants.js +0 -11
- package/components/molecules/TierCard/index.js +0 -1
- package/components/molecules/TierCard/messages.js +0 -97
- package/components/molecules/TierCard/stories/TierCard.stories.js +0 -7
- package/components/molecules/TierCard/style.js +0 -140
- package/components/molecules/TierCardHeader/TierCardHeader.js +0 -73
- package/components/molecules/TierCardHeader/index.js +0 -1
- package/components/molecules/TierCardHeader/style.js +0 -32
- package/components/molecules/TierRenewalCommunication/TierRenewalCommunication.js +0 -230
- package/components/molecules/TierRenewalCommunication/constants.js +0 -12
- package/components/molecules/TierRenewalCommunication/index.js +0 -1
- package/components/molecules/TierRenewalCommunication/messages.js +0 -24
- package/components/molecules/TierRenewalCommunication/style.js +0 -23
- package/components/molecules/TierRenewalCommunication/tests/__snapshots__/index.test.js.snap +0 -42
- package/components/molecules/TierRenewalCommunication/tests/index.test.js +0 -13
- package/components/molecules/TierUpgradeCommunication/TierUpgradeCommunication.js +0 -102
- package/components/molecules/TierUpgradeCommunication/constants.js +0 -2
- package/components/molecules/TierUpgradeCommunication/index.js +0 -1
- package/components/molecules/TierUpgradeCommunication/messages.js +0 -40
- package/components/molecules/TierUpgradeCommunication/style.js +0 -51
- package/components/molecules/TierUpgradeCommunication/tests/__snapshots__/index.test.js.snap +0 -11
- package/components/molecules/TierUpgradeCommunication/tests/index.test.js +0 -13
- package/components/molecules/TitleWithStatus/TitleWithStatus.js +0 -60
- package/components/molecules/TitleWithStatus/index.js +0 -1
- package/components/molecules/TitleWithStatus/stories/TitleWithStatus.stories.js +0 -5
- package/components/molecules/TitleWithStatus/style.js +0 -15
- package/components/molecules/TitleWithStatus/tests/index.test.js +0 -11
- package/components/molecules/TrackerValueContent/TrackerValueContent.js +0 -115
- package/components/molecules/TrackerValueContent/index.js +0 -1
- package/components/molecules/UpgradeTier/UpgradeTier.js +0 -303
- package/components/molecules/UpgradeTier/index.js +0 -1
- package/components/molecules/UpgradeTier/messages.js +0 -24
- package/components/molecules/UpgradeTrackerTier/UpgradeTrackerTier.js +0 -212
- package/components/molecules/UpgradeTrackerTier/index.js +0 -1
- package/components/molecules/UpgradeTrackerTier/messages.js +0 -11
- package/components/organisms/AddEarnCondition/AddEarnCondition.js +0 -889
- package/components/organisms/AddEarnCondition/actions.js +0 -13
- package/components/organisms/AddEarnCondition/constants.js +0 -48
- package/components/organisms/AddEarnCondition/index.js +0 -1
- package/components/organisms/AddEarnCondition/messages.js +0 -177
- package/components/organisms/AddEarnCondition/reducer.js +0 -49
- package/components/organisms/AddEarnCondition/saga.js +0 -88
- package/components/organisms/AddEarnCondition/selectors.js +0 -33
- package/components/organisms/AddEarnCondition/style.js +0 -109
- package/components/organisms/AddPaymentMethod/AddPaymentMethod.js +0 -253
- package/components/organisms/AddPaymentMethod/constants.js +0 -9
- package/components/organisms/AddPaymentMethod/index.js +0 -1
- package/components/organisms/AddPaymentMethod/messages.js +0 -44
- package/components/organisms/AddPaymentMethod/style.js +0 -48
- package/components/organisms/AddTier/AddTier.js +0 -492
- package/components/organisms/AddTier/actions.js +0 -26
- package/components/organisms/AddTier/constants.js +0 -25
- package/components/organisms/AddTier/defaultStates.js +0 -61
- package/components/organisms/AddTier/index.js +0 -1
- package/components/organisms/AddTier/messages.js +0 -45
- package/components/organisms/AddTier/reducer.js +0 -49
- package/components/organisms/AddTier/saga.js +0 -78
- package/components/organisms/AddTier/selectors.js +0 -23
- package/components/organisms/AddTier/style.js +0 -127
- package/components/organisms/AddTier/utils.js +0 -614
- package/components/organisms/AddTierSetting/AddTierSetting.js +0 -199
- package/components/organisms/AddTierSetting/constants.js +0 -8
- package/components/organisms/AddTierSetting/index.js +0 -1
- package/components/organisms/AddTierSetting/messages.js +0 -69
- package/components/organisms/AddTierSetting/mockData.js +0 -30
- package/components/organisms/AddTierSetting/style.js +0 -20
- package/components/organisms/AddTierSetting/utils.js +0 -16
- package/components/organisms/AdvancedOption/AdvancedOption.js +0 -138
- package/components/organisms/AdvancedOption/constants.js +0 -5
- package/components/organisms/AdvancedOption/index.js +0 -1
- package/components/organisms/AdvancedOption/messages.js +0 -48
- package/components/organisms/AdvancedOption/style.js +0 -52
- package/components/organisms/AllocationPointWorkflowAction/AllocationPointWorkflowAction.js +0 -356
- package/components/organisms/AllocationPointWorkflowAction/constants.js +0 -6
- package/components/organisms/AllocationPointWorkflowAction/index.js +0 -1
- package/components/organisms/AllocationPointWorkflowAction/style.js +0 -17
- package/components/organisms/AllocationStrategy/AllocationStrategy.js +0 -539
- package/components/organisms/AllocationStrategy/constants.js +0 -16
- package/components/organisms/AllocationStrategy/index.js +0 -1
- package/components/organisms/AllocationStrategy/messages.js +0 -112
- package/components/organisms/AllocationStrategy/style.js +0 -19
- package/components/organisms/AllocationStrategy/tests/AllocationStrategy.test.js +0 -5
- package/components/organisms/AwardPointsConfig/AwardPointsConfig.js +0 -704
- package/components/organisms/AwardPointsConfig/constants.js +0 -7
- package/components/organisms/AwardPointsConfig/index.js +0 -1
- package/components/organisms/AwardPointsConfig/messages.js +0 -104
- package/components/organisms/AwardPointsConfig/style.js +0 -3
- package/components/organisms/AwardRefereePointsWorkflowAction/AwardRefereePointsWorkflowAction.js +0 -285
- package/components/organisms/AwardRefereePointsWorkflowAction/index.js +0 -1
- package/components/organisms/AwardRefereePointsWorkflowAction/style.js +0 -17
- package/components/organisms/AwardReferrerPointsWorkflowAction/AwardReferrerPointsWorkflowAction.js +0 -282
- package/components/organisms/AwardReferrerPointsWorkflowAction/index.js +0 -1
- package/components/organisms/AwardReferrerPointsWorkflowAction/style.js +0 -17
- package/components/organisms/CappingSlidebox/CappingSlidebox.js +0 -556
- package/components/organisms/CappingSlidebox/index.js +0 -1
- package/components/organisms/CappingSlidebox/messages.js +0 -36
- package/components/organisms/CappingSlidebox/style.js +0 -3
- package/components/organisms/Communication/Communication.js +0 -245
- package/components/organisms/Communication/actions.js +0 -24
- package/components/organisms/Communication/constants.js +0 -25
- package/components/organisms/Communication/index.js +0 -1
- package/components/organisms/Communication/messages.js +0 -24
- package/components/organisms/Communication/mockData.js +0 -163
- package/components/organisms/Communication/reducer.js +0 -41
- package/components/organisms/Communication/saga.js +0 -36
- package/components/organisms/Communication/selectors.js +0 -25
- package/components/organisms/Communication/style.js +0 -15
- package/components/organisms/Communication/tests/actions.test.js +0 -13
- package/components/organisms/Communication/tests/index.test.js +0 -11
- package/components/organisms/Communication/tests/reducer.test.js +0 -8
- package/components/organisms/Communication/tests/selectors.test.js +0 -5
- package/components/organisms/CommunicationAdvancedOption/CommunicationAdvancedOption.js +0 -249
- package/components/organisms/CommunicationAdvancedOption/actions.js +0 -12
- package/components/organisms/CommunicationAdvancedOption/constants.js +0 -8
- package/components/organisms/CommunicationAdvancedOption/index.js +0 -1
- package/components/organisms/CommunicationAdvancedOption/messages.js +0 -17
- package/components/organisms/CommunicationAdvancedOption/reducer.js +0 -31
- package/components/organisms/CommunicationAdvancedOption/saga.js +0 -36
- package/components/organisms/CommunicationAdvancedOption/selectors.js +0 -25
- package/components/organisms/CommunicationAdvancedOption/style.js +0 -8
- package/components/organisms/CommunicationStrategies/CommunicationStrategies.js +0 -325
- package/components/organisms/CommunicationStrategies/actions.js +0 -17
- package/components/organisms/CommunicationStrategies/constants.js +0 -14
- package/components/organisms/CommunicationStrategies/index.js +0 -1
- package/components/organisms/CommunicationStrategies/messages.js +0 -69
- package/components/organisms/CommunicationStrategies/reducer.js +0 -39
- package/components/organisms/CommunicationStrategies/saga.js +0 -62
- package/components/organisms/CommunicationStrategies/selectors.js +0 -25
- package/components/organisms/CommunicationStrategies/tests/__snapshots__/index.test.js.snap +0 -1195
- package/components/organisms/CommunicationStrategies/tests/index.test.js +0 -13
- package/components/organisms/CommunicationStrategies/utils.js +0 -567
- package/components/organisms/ConfigureKPI/ConfigureKPI.js +0 -285
- package/components/organisms/ConfigureKPI/actions.js +0 -17
- package/components/organisms/ConfigureKPI/constants.js +0 -13
- package/components/organisms/ConfigureKPI/index.js +0 -1
- package/components/organisms/ConfigureKPI/messages.js +0 -11
- package/components/organisms/ConfigureKPI/reducer.js +0 -36
- package/components/organisms/ConfigureKPI/saga.js +0 -69
- package/components/organisms/ConfigureKPI/selectors.js +0 -21
- package/components/organisms/ConfigureKPI/style.js +0 -25
- package/components/organisms/ConfigureKPI/tests/ConfigureKPI.test.js +0 -60
- package/components/organisms/ConfigureKPI/tests/__snapshots__/ConfigureKPI.test.js.snap +0 -52
- package/components/organisms/ConfigureKPI/tests/__snapshots__/reducer.test.js.snap +0 -9
- package/components/organisms/ConfigureKPI/tests/mockdata.js +0 -22
- package/components/organisms/ConfigureKPI/tests/reducer.test.js +0 -91
- package/components/organisms/ConfigureKPI/tests/saga.test.js +0 -146
- package/components/organisms/ConfigureKPI/tests/utils.test.js +0 -17
- package/components/organisms/ConfigureKPI/utils.js +0 -9
- package/components/organisms/ConfigureProgramSteps/ConfigureProgramSteps.js +0 -157
- package/components/organisms/ConfigureProgramSteps/constants.js +0 -4
- package/components/organisms/ConfigureProgramSteps/index.js +0 -1
- package/components/organisms/ConfigureProgramSteps/messages.js +0 -47
- package/components/organisms/ConfigureProgramSteps/style.js +0 -52
- package/components/organisms/ConfigureStrategies/ConfigureStrategies.js +0 -370
- package/components/organisms/ConfigureStrategies/actions.js +0 -11
- package/components/organisms/ConfigureStrategies/constants.js +0 -18
- package/components/organisms/ConfigureStrategies/index.js +0 -1
- package/components/organisms/ConfigureStrategies/messages.js +0 -59
- package/components/organisms/ConfigureStrategies/reducer.js +0 -35
- package/components/organisms/ConfigureStrategies/saga.js +0 -44
- package/components/organisms/ConfigureStrategies/selectors.js +0 -33
- package/components/organisms/ConfigureStrategies/style.js +0 -149
- package/components/organisms/ConfigureTrackers/ConfigureTrackers.js +0 -167
- package/components/organisms/ConfigureTrackers/index.js +0 -1
- package/components/organisms/ConfigureTrackers/style.js +0 -31
- package/components/organisms/ConfigureWorkflows/ConfigureWorkflows.js +0 -526
- package/components/organisms/ConfigureWorkflows/ScopingAndCapping.js +0 -460
- package/components/organisms/ConfigureWorkflows/WorkflowActions.js +0 -341
- package/components/organisms/ConfigureWorkflows/WorkflowConfigurationSection.js +0 -1474
- package/components/organisms/ConfigureWorkflows/actions.js +0 -201
- package/components/organisms/ConfigureWorkflows/constants.js +0 -289
- package/components/organisms/ConfigureWorkflows/data.js +0 -11201
- package/components/organisms/ConfigureWorkflows/index.js +0 -1
- package/components/organisms/ConfigureWorkflows/messages.js +0 -138
- package/components/organisms/ConfigureWorkflows/reducer.js +0 -402
- package/components/organisms/ConfigureWorkflows/saga.js +0 -742
- package/components/organisms/ConfigureWorkflows/selectors.js +0 -139
- package/components/organisms/ConfigureWorkflows/style.js +0 -252
- package/components/organisms/ConfigureWorkflows/utils.js +0 -696
- package/components/organisms/CouponSlidebox/CouponSlidebox.js +0 -327
- package/components/organisms/CouponSlidebox/_coupons.scss +0 -121
- package/components/organisms/CouponSlidebox/actions.js +0 -13
- package/components/organisms/CouponSlidebox/constants.js +0 -16
- package/components/organisms/CouponSlidebox/index.js +0 -1
- package/components/organisms/CouponSlidebox/messages.js +0 -113
- package/components/organisms/CouponSlidebox/reducer.js +0 -31
- package/components/organisms/CouponSlidebox/saga.js +0 -18
- package/components/organisms/CouponSlidebox/selectors.js +0 -22
- package/components/organisms/Coupons/Coupons.js +0 -324
- package/components/organisms/Coupons/actions.js +0 -13
- package/components/organisms/Coupons/constants.js +0 -22
- package/components/organisms/Coupons/index.js +0 -1
- package/components/organisms/Coupons/messages.js +0 -121
- package/components/organisms/Coupons/reducer.js +0 -31
- package/components/organisms/Coupons/saga.js +0 -18
- package/components/organisms/Coupons/selectors.js +0 -22
- package/components/organisms/Coupons/stories/Coupons.stories.js +0 -5
- package/components/organisms/Coupons/style.js +0 -24
- package/components/organisms/Coupons/tests/actions.test.js +0 -13
- package/components/organisms/Coupons/tests/index.test.js +0 -5
- package/components/organisms/Coupons/tests/saga.test.js +0 -11
- package/components/organisms/Coupons/tests/selectors.test.js +0 -8
- package/components/organisms/CreateProgram/CreateProgram.js +0 -457
- package/components/organisms/CreateProgram/actions.js +0 -17
- package/components/organisms/CreateProgram/constants.js +0 -9
- package/components/organisms/CreateProgram/index.js +0 -1
- package/components/organisms/CreateProgram/messages.js +0 -47
- package/components/organisms/CreateProgram/reducer.js +0 -38
- package/components/organisms/CreateProgram/saga.js +0 -43
- package/components/organisms/CreateProgram/selectors.js +0 -22
- package/components/organisms/CreateProgram/style.js +0 -33
- package/components/organisms/CreateProgram/tests/CreateProgram.test.js +0 -68
- package/components/organisms/CreateProgram/tests/__snapshots__/reducer.test.js.snap +0 -9
- package/components/organisms/CreateProgram/tests/mockdata.js +0 -10
- package/components/organisms/CreateProgram/tests/reducer.test.js +0 -95
- package/components/organisms/CreateProgram/tests/saga.test.js +0 -163
- package/components/organisms/CreateProgramIllustration/CreateProgramIllustration.js +0 -62
- package/components/organisms/CreateProgramIllustration/index.js +0 -1
- package/components/organisms/CreateProgramIllustration/messages.js +0 -25
- package/components/organisms/CreateTender/CreateTender.js +0 -485
- package/components/organisms/CreateTender/actions.js +0 -17
- package/components/organisms/CreateTender/constants.js +0 -11
- package/components/organisms/CreateTender/index.js +0 -1
- package/components/organisms/CreateTender/messages.js +0 -84
- package/components/organisms/CreateTender/reducer.js +0 -37
- package/components/organisms/CreateTender/saga.js +0 -42
- package/components/organisms/CreateTender/selectors.js +0 -25
- package/components/organisms/CreateTender/style.js +0 -68
- package/components/organisms/CreateTier/CreateTier.js +0 -214
- package/components/organisms/CreateTier/actions.js +0 -16
- package/components/organisms/CreateTier/constants.js +0 -7
- package/components/organisms/CreateTier/index.js +0 -1
- package/components/organisms/CreateTier/messages.js +0 -20
- package/components/organisms/CreateTier/reducer.js +0 -37
- package/components/organisms/CreateTier/saga.js +0 -47
- package/components/organisms/CreateTier/selectors.js +0 -25
- package/components/organisms/CreateTier/style.js +0 -11
- package/components/organisms/CreateTier/utils.js +0 -55
- package/components/organisms/Creatives/Creatives.js +0 -1071
- package/components/organisms/Creatives/actions.js +0 -13
- package/components/organisms/Creatives/constants.js +0 -20
- package/components/organisms/Creatives/index.js +0 -1
- package/components/organisms/Creatives/index.scss +0 -170
- package/components/organisms/Creatives/messages.js +0 -299
- package/components/organisms/Creatives/reducer.js +0 -145
- package/components/organisms/Creatives/saga.js +0 -145
- package/components/organisms/Creatives/selectors.js +0 -28
- package/components/organisms/Creatives/style.js +0 -40
- package/components/organisms/Creatives/tests/actions.test.js +0 -13
- package/components/organisms/Creatives/tests/index.test.js +0 -5
- package/components/organisms/Creatives/tests/saga.test.js +0 -11
- package/components/organisms/Creatives/tests/selectors.test.js +0 -5
- package/components/organisms/Creatives/useDidMountEffect.js +0 -12
- package/components/organisms/CustomerActivity/CustomerActivity.js +0 -455
- package/components/organisms/CustomerActivity/constants.js +0 -3
- package/components/organisms/CustomerActivity/index.js +0 -1
- package/components/organisms/CustomerActivity/messages.js +0 -102
- package/components/organisms/CustomerActivity/style.js +0 -87
- package/components/organisms/EbillWorkflowAction/EbillWorkflowAction.js +0 -276
- package/components/organisms/EbillWorkflowAction/index.js +0 -1
- package/components/organisms/EbillWorkflowAction/messages.js +0 -36
- package/components/organisms/EbillWorkflowAction/style.js +0 -10
- package/components/organisms/ExpiryCommunication/ExpiryCommunication.js +0 -109
- package/components/organisms/ExpiryCommunication/constants.js +0 -18
- package/components/organisms/ExpiryCommunication/index.js +0 -1
- package/components/organisms/ExpiryCommunication/messages.js +0 -36
- package/components/organisms/ExpiryCommunication/tests/index.test.js +0 -11
- package/components/organisms/ExpiryCommunication/utils.js +0 -259
- package/components/organisms/ExpiryConditions/ExpiryConditions.js +0 -505
- package/components/organisms/ExpiryConditions/actions.js +0 -8
- package/components/organisms/ExpiryConditions/constants.js +0 -6
- package/components/organisms/ExpiryConditions/index.js +0 -1
- package/components/organisms/ExpiryConditions/messages.js +0 -96
- package/components/organisms/ExpiryConditions/reducer.js +0 -33
- package/components/organisms/ExpiryConditions/saga.js +0 -34
- package/components/organisms/ExpiryConditions/selectors.js +0 -21
- package/components/organisms/ExpiryConditions/style.js +0 -36
- package/components/organisms/ExpiryStrategy/ExpiryStrategy.js +0 -548
- package/components/organisms/ExpiryStrategy/constants.js +0 -7
- package/components/organisms/ExpiryStrategy/index.js +0 -1
- package/components/organisms/ExpiryStrategy/messages.js +0 -28
- package/components/organisms/ExpiryStrategy/style.js +0 -13
- package/components/organisms/ExpiryStrategy/tests/ExpiryStrategy.test.js +0 -5
- package/components/organisms/ForwardToSetWorkflowAction/ForwardToSetWorkflowAction.js +0 -308
- package/components/organisms/ForwardToSetWorkflowAction/constants.js +0 -17
- package/components/organisms/ForwardToSetWorkflowAction/index.js +0 -1
- package/components/organisms/ForwardToSetWorkflowAction/messages.js +0 -75
- package/components/organisms/ForwardToSetWorkflowAction/style.js +0 -16
- package/components/organisms/InitiateSupplementaryMemberShipWorkflowAction/InitiateSupplementaryMemberShipWorkflowAction.js +0 -259
- package/components/organisms/InitiateSupplementaryMemberShipWorkflowAction/constants.js +0 -19
- package/components/organisms/InitiateSupplementaryMemberShipWorkflowAction/index.js +0 -1
- package/components/organisms/InitiateSupplementaryMemberShipWorkflowAction/messages.js +0 -32
- package/components/organisms/InitiateSupplementaryMemberShipWorkflowAction/style.js +0 -17
- package/components/organisms/IssueCouponsWorkflowAction/IssueCouponsWorkflowAction.js +0 -345
- package/components/organisms/IssueCouponsWorkflowAction/actions.js +0 -11
- package/components/organisms/IssueCouponsWorkflowAction/constants.js +0 -11
- package/components/organisms/IssueCouponsWorkflowAction/index.js +0 -1
- package/components/organisms/IssueCouponsWorkflowAction/messages.js +0 -24
- package/components/organisms/IssueCouponsWorkflowAction/mockData.js +0 -12
- package/components/organisms/IssueCouponsWorkflowAction/reducer.js +0 -35
- package/components/organisms/IssueCouponsWorkflowAction/saga.js +0 -35
- package/components/organisms/IssueCouponsWorkflowAction/selectors.js +0 -29
- package/components/organisms/IssueCouponsWorkflowAction/style.js +0 -22
- package/components/organisms/LoyaltyDetail/LoyaltyDetail.js +0 -442
- package/components/organisms/LoyaltyDetail/actions.js +0 -14
- package/components/organisms/LoyaltyDetail/constants.js +0 -32
- package/components/organisms/LoyaltyDetail/index.js +0 -1
- package/components/organisms/LoyaltyDetail/messages.js +0 -77
- package/components/organisms/LoyaltyDetail/reducer.js +0 -51
- package/components/organisms/LoyaltyDetail/saga.js +0 -65
- package/components/organisms/LoyaltyDetail/selectors.js +0 -36
- package/components/organisms/LoyaltyDetail/style.js +0 -81
- package/components/organisms/LoyaltyDetail/tests/LoyaltyDetail.test.js +0 -50
- package/components/organisms/LoyaltyDetail/tests/__snapshots__/reducer.test.js.snap +0 -12
- package/components/organisms/LoyaltyDetail/tests/mockdata.js +0 -39
- package/components/organisms/LoyaltyDetail/tests/reducer.test.js +0 -92
- package/components/organisms/LoyaltyDetail/tests/saga.test.js +0 -132
- package/components/organisms/LoyaltyDetail/utils.js +0 -217
- package/components/organisms/LoyaltyGraph/LoyaltyGraph.js +0 -448
- package/components/organisms/LoyaltyGraph/actions.js +0 -6
- package/components/organisms/LoyaltyGraph/constants.js +0 -21
- package/components/organisms/LoyaltyGraph/index.js +0 -1
- package/components/organisms/LoyaltyGraph/messages.js +0 -49
- package/components/organisms/LoyaltyGraph/reducer.js +0 -33
- package/components/organisms/LoyaltyGraph/saga.js +0 -51
- package/components/organisms/LoyaltyGraph/selectors.js +0 -23
- package/components/organisms/LoyaltyGraph/style.js +0 -141
- package/components/organisms/LoyaltyGraph/tests/LoyaltyGraph.test.js +0 -49
- package/components/organisms/LoyaltyGraph/tests/__snapshots__/LoyaltyGraph.test.js.snap +0 -77
- package/components/organisms/LoyaltyGraph/tests/mockdata.js +0 -72
- package/components/organisms/LoyaltyGraph/utils.js +0 -61
- package/components/organisms/MandatoryAndPriorityChannel/MandatoryAndPriorityChannel.js +0 -246
- package/components/organisms/MandatoryAndPriorityChannel/index.js +0 -1
- package/components/organisms/MandatoryAndPriorityChannel/messages.js +0 -23
- package/components/organisms/MandatoryAndPriorityChannel/style.js +0 -31
- package/components/organisms/NavigationBar/NavigationBar.js +0 -199
- package/components/organisms/NavigationBar/constants.js +0 -1
- package/components/organisms/NavigationBar/index.js +0 -1
- package/components/organisms/NavigationBar/messages.js +0 -29
- package/components/organisms/NavigationBar/style.js +0 -10
- package/components/organisms/NavigationBar/tests/NavigationBar.test.js +0 -208
- package/components/organisms/NavigationBar/tests/__snapshots__/NavigationBar.test.js.snap +0 -42
- package/components/organisms/NavigationBar/tests/mockdata.js +0 -15
- package/components/organisms/NoConfigWorkflowAction/NoConfigWorkflowAction.js +0 -108
- package/components/organisms/NoConfigWorkflowAction/index.js +0 -1
- package/components/organisms/Nudges/Nudges.js +0 -277
- package/components/organisms/Nudges/actions.js +0 -6
- package/components/organisms/Nudges/constants.js +0 -5
- package/components/organisms/Nudges/index.js +0 -1
- package/components/organisms/Nudges/messages.js +0 -20
- package/components/organisms/Nudges/reducer.js +0 -35
- package/components/organisms/Nudges/saga.js +0 -32
- package/components/organisms/Nudges/selectors.js +0 -21
- package/components/organisms/Nudges/style.js +0 -114
- package/components/organisms/OrgChange/OrgChange.js +0 -250
- package/components/organisms/OrgChange/constants.js +0 -2
- package/components/organisms/OrgChange/index.js +0 -1
- package/components/organisms/OrgChange/message.js +0 -38
- package/components/organisms/OrgChange/style.js +0 -15
- package/components/organisms/OrgChange/tests/OrgChange.test.js +0 -71
- package/components/organisms/OrgChange/tests/__snapshots__/OrgChange.test.js.snap +0 -4736
- package/components/organisms/PaymentMethodsAdvanced/PaymentSettingsAdvanced.js +0 -516
- package/components/organisms/PaymentMethodsAdvanced/actions.js +0 -26
- package/components/organisms/PaymentMethodsAdvanced/constants.js +0 -42
- package/components/organisms/PaymentMethodsAdvanced/index.js +0 -1
- package/components/organisms/PaymentMethodsAdvanced/messages.js +0 -50
- package/components/organisms/PaymentMethodsAdvanced/reducer.js +0 -76
- package/components/organisms/PaymentMethodsAdvanced/saga.js +0 -129
- package/components/organisms/PaymentMethodsAdvanced/selectors.js +0 -25
- package/components/organisms/PaymentMethodsAdvanced/style.js +0 -22
- package/components/organisms/PerformanceCard/PerformanceCard.js +0 -110
- package/components/organisms/PerformanceCard/index.js +0 -1
- package/components/organisms/PerformanceCard/messages.js +0 -20
- package/components/organisms/PerformanceCard/style.js +0 -49
- package/components/organisms/PerformanceCard/tests/PerformanceCard.test.js +0 -55
- package/components/organisms/PerformanceCard/tests/__snapshots__/PerformanceCard.test.js.snap +0 -6372
- package/components/organisms/PerformanceCard/tests/mockdata.js +0 -6
- package/components/organisms/PerformanceStats/PerformanceStats.js +0 -474
- package/components/organisms/PerformanceStats/actions.js +0 -15
- package/components/organisms/PerformanceStats/constants.js +0 -32
- package/components/organisms/PerformanceStats/index.js +0 -1
- package/components/organisms/PerformanceStats/messages.js +0 -45
- package/components/organisms/PerformanceStats/reducer.js +0 -42
- package/components/organisms/PerformanceStats/saga.js +0 -41
- package/components/organisms/PerformanceStats/selectors.js +0 -21
- package/components/organisms/PerformanceStats/style.js +0 -79
- package/components/organisms/PerformanceStats/tests/PerformanceStats.test.js +0 -49
- package/components/organisms/PerformanceStats/tests/__snapshots__/PerformanceStats.test.js.snap +0 -25276
- package/components/organisms/PerformanceStats/tests/__snapshots__/reducer.test.js.snap +0 -10
- package/components/organisms/PerformanceStats/tests/mockdata.js +0 -46
- package/components/organisms/PerformanceStats/tests/reducer.test.js +0 -58
- package/components/organisms/PerformanceStats/tests/saga.test.js +0 -74
- package/components/organisms/PointContributionToGroup/PointContributionToGroup.js +0 -311
- package/components/organisms/PointContributionToGroup/constants.js +0 -26
- package/components/organisms/PointContributionToGroup/index.js +0 -1
- package/components/organisms/PointContributionToGroup/messages.js +0 -20
- package/components/organisms/PointContributionToGroup/style.js +0 -17
- package/components/organisms/PointStrategies/PointStrategies.js +0 -278
- package/components/organisms/PointStrategies/constants.js +0 -4
- package/components/organisms/PointStrategies/index.js +0 -1
- package/components/organisms/PointStrategies/messages.js +0 -58
- package/components/organisms/PointStrategies/style.js +0 -10
- package/components/organisms/PointsAdvancedOption/PointsAdvancedOption.js +0 -198
- package/components/organisms/PointsAdvancedOption/actions.js +0 -12
- package/components/organisms/PointsAdvancedOption/constants.js +0 -13
- package/components/organisms/PointsAdvancedOption/index.js +0 -1
- package/components/organisms/PointsAdvancedOption/messages.js +0 -25
- package/components/organisms/PointsAdvancedOption/reducer.js +0 -31
- package/components/organisms/PointsAdvancedOption/saga.js +0 -35
- package/components/organisms/PointsAdvancedOption/selectors.js +0 -25
- package/components/organisms/PointsAdvancedOption/style.js +0 -23
- package/components/organisms/PointsAdvancedOption/utils.js +0 -6
- package/components/organisms/PointsGroupRedemptionWorkflowAction/PointsGroupRedemptionWorkflowAction.js +0 -143
- package/components/organisms/PointsGroupRedemptionWorkflowAction/index.js +0 -1
- package/components/organisms/PointsGroupRedemptionWorkflowAction/style.js +0 -17
- package/components/organisms/PointsRedemptionReversalWorkflowAction/PointsRedemptionReversalWorkflowAction.js +0 -251
- package/components/organisms/PointsRedemptionReversalWorkflowAction/index.js +0 -1
- package/components/organisms/PointsRedemptionReversalWorkflowAction/style.js +0 -17
- package/components/organisms/PointsRedemptionWorkflowAction/PointsRedemptionWorkflowAction.js +0 -159
- package/components/organisms/PointsRedemptionWorkflowAction/index.js +0 -1
- package/components/organisms/PointsRedemptionWorkflowAction/style.js +0 -17
- package/components/organisms/Preview/Preview.js +0 -176
- package/components/organisms/Preview/index.js +0 -1
- package/components/organisms/Preview/messages.js +0 -14
- package/components/organisms/Preview/reducer.js +0 -15
- package/components/organisms/Preview/style.js +0 -12
- package/components/organisms/Preview/tests/__snapshots__/index.test.js.snap +0 -107
- package/components/organisms/Preview/tests/index.test.js +0 -63
- package/components/organisms/ProgramPerformance/ProgramPerformance.js +0 -101
- package/components/organisms/ProgramPerformance/actions.js +0 -13
- package/components/organisms/ProgramPerformance/constants.js +0 -7
- package/components/organisms/ProgramPerformance/data.js +0 -26
- package/components/organisms/ProgramPerformance/index.js +0 -1
- package/components/organisms/ProgramPerformance/messages.js +0 -16
- package/components/organisms/ProgramPerformance/reducer.js +0 -20
- package/components/organisms/ProgramPerformance/saga.js +0 -6
- package/components/organisms/ProgramPerformance/selectors.js +0 -25
- package/components/organisms/ProgramPerformance/style.js +0 -25
- package/components/organisms/ProgramPerformance/tests/actions.test.js +0 -13
- package/components/organisms/ProgramPerformance/tests/index.test.js +0 -11
- package/components/organisms/ProgramPerformance/tests/reducer.test.js +0 -10
- package/components/organisms/ProgramPerformance/tests/saga.test.js +0 -11
- package/components/organisms/ProgramPerformance/tests/selectors.test.js +0 -8
- package/components/organisms/ProgramSettings/ProgramSettings.js +0 -281
- package/components/organisms/ProgramSettings/actions.js +0 -17
- package/components/organisms/ProgramSettings/constants.js +0 -32
- package/components/organisms/ProgramSettings/index.js +0 -1
- package/components/organisms/ProgramSettings/messages.js +0 -57
- package/components/organisms/ProgramSettings/reducer.js +0 -46
- package/components/organisms/ProgramSettings/saga.js +0 -59
- package/components/organisms/ProgramSettings/selectors.js +0 -25
- package/components/organisms/ProgramSettings/style.js +0 -18
- package/components/organisms/ProgramWorkflows/ProgramWorkflows.js +0 -293
- package/components/organisms/ProgramWorkflows/actions.js +0 -13
- package/components/organisms/ProgramWorkflows/constants.js +0 -16
- package/components/organisms/ProgramWorkflows/data.js +0 -44
- package/components/organisms/ProgramWorkflows/index.js +0 -1
- package/components/organisms/ProgramWorkflows/messages.js +0 -52
- package/components/organisms/ProgramWorkflows/reducer.js +0 -20
- package/components/organisms/ProgramWorkflows/selectors.js +0 -26
- package/components/organisms/ProgramWorkflows/style.js +0 -19
- package/components/organisms/ProgramWorkflows/tests/actions.test.js +0 -13
- package/components/organisms/ProgramWorkflows/tests/index.test.js +0 -11
- package/components/organisms/ProgramWorkflows/tests/reducer.test.js +0 -10
- package/components/organisms/ProgramWorkflows/tests/selectors.test.js +0 -8
- package/components/organisms/PromisedPointToCurrentPointWorkflowAction/PromisedPointToCurrentPointWorkflowAction.js +0 -140
- package/components/organisms/PromisedPointToCurrentPointWorkflowAction/index.js +0 -1
- package/components/organisms/PromisedPointToCurrentPointWorkflowAction/style.js +0 -17
- package/components/organisms/RadioTreeSelect/RadioTreeSelect.js +0 -135
- package/components/organisms/RadioTreeSelect/constants.js +0 -3
- package/components/organisms/RadioTreeSelect/index.js +0 -1
- package/components/organisms/RadioTreeSelect/style.js +0 -108
- package/components/organisms/RedeemConditionFields/RedeemConditionFields.js +0 -190
- package/components/organisms/RedeemConditionFields/index.js +0 -1
- package/components/organisms/RedeemConditionFields/messages.js +0 -74
- package/components/organisms/RedeemConditionFields/tests/index.test.js +0 -11
- package/components/organisms/RedeemConditions/RedeemConditions.js +0 -364
- package/components/organisms/RedeemConditions/actions.js +0 -12
- package/components/organisms/RedeemConditions/constants.js +0 -11
- package/components/organisms/RedeemConditions/index.js +0 -1
- package/components/organisms/RedeemConditions/messages.js +0 -36
- package/components/organisms/RedeemConditions/reducer.js +0 -35
- package/components/organisms/RedeemConditions/saga.js +0 -33
- package/components/organisms/RedeemConditions/selectors.js +0 -21
- package/components/organisms/RedeemConditions/style.js +0 -22
- package/components/organisms/RedemptionStrategy/RedemptionStrategy.js +0 -586
- package/components/organisms/RedemptionStrategy/constants.js +0 -9
- package/components/organisms/RedemptionStrategy/index.js +0 -1
- package/components/organisms/RedemptionStrategy/messages.js +0 -56
- package/components/organisms/RedemptionStrategy/style.js +0 -32
- package/components/organisms/RedemptionStrategy/tests/RedemptionStrategy.test.js +0 -5
- package/components/organisms/RenewTierWorkflowAction/RenewTierWorkflowAction.js +0 -130
- package/components/organisms/RenewTierWorkflowAction/index.js +0 -1
- package/components/organisms/RenewTierWorkflowAction/style.js +0 -17
- package/components/organisms/RenewalCommunication/RenewalCommunication.js +0 -146
- package/components/organisms/RenewalCommunication/index.js +0 -1
- package/components/organisms/RenewalCommunication/messages.js +0 -48
- package/components/organisms/RenewalCommunication/tests/index.test.js +0 -11
- package/components/organisms/RenewalCommunication/utils.js +0 -287
- package/components/organisms/ReturnConditions/ReturnConditions.js +0 -573
- package/components/organisms/ReturnConditions/actions.js +0 -12
- package/components/organisms/ReturnConditions/constants.js +0 -8
- package/components/organisms/ReturnConditions/index.js +0 -1
- package/components/organisms/ReturnConditions/messages.js +0 -95
- package/components/organisms/ReturnConditions/reducer.js +0 -35
- package/components/organisms/ReturnConditions/saga.js +0 -34
- package/components/organisms/ReturnConditions/selectors.js +0 -21
- package/components/organisms/ReturnConditions/style.js +0 -38
- package/components/organisms/ReturnStrategy/ReturnStrategy.js +0 -465
- package/components/organisms/ReturnStrategy/constants.js +0 -7
- package/components/organisms/ReturnStrategy/index.js +0 -1
- package/components/organisms/ReturnStrategy/messages.js +0 -36
- package/components/organisms/ReturnStrategy/style.js +0 -14
- package/components/organisms/ReturnStrategy/tests/ReturnStrategy.test.js +0 -5
- package/components/organisms/ReviewTierUnloadModal/ReviewTierUnloadModal.js +0 -106
- package/components/organisms/ReviewTierUnloadModal/index.js +0 -1
- package/components/organisms/ReviewTierUnloadModal/messages.js +0 -26
- package/components/organisms/ScopeSlidebox/ScopeSlidebox.js +0 -955
- package/components/organisms/ScopeSlidebox/constants.js +0 -21
- package/components/organisms/ScopeSlidebox/index.js +0 -1
- package/components/organisms/ScopeSlidebox/messages.js +0 -84
- package/components/organisms/SelectLabelWorkflowAction/SelectLabelWorkflowAction.js +0 -70
- package/components/organisms/SelectLabelWorkflowAction/index.js +0 -1
- package/components/organisms/SendEmailWorkflowAction/SendEmailWorkflowAction.js +0 -147
- package/components/organisms/SendEmailWorkflowAction/index.js +0 -1
- package/components/organisms/SendMessagesWorkflowAction/SendMessagesWorkflowAction.js +0 -193
- package/components/organisms/SendMessagesWorkflowAction/index.js +0 -1
- package/components/organisms/SendMessagesWorkflowAction/style.js +0 -17
- package/components/organisms/SendMobilePushWorkflowAction/SendMobilePushWorkflowAction.js +0 -145
- package/components/organisms/SendMobilePushWorkflowAction/index.js +0 -1
- package/components/organisms/SendSmsWorkflowAction/SendSmsWorkflowAction.js +0 -148
- package/components/organisms/SendSmsWorkflowAction/index.js +0 -1
- package/components/organisms/SocialConnectWorkflowAction/SocialConnectWorkflowAction.js +0 -142
- package/components/organisms/SocialConnectWorkflowAction/index.js +0 -1
- package/components/organisms/StrategyDashboard/StrategyDashboard.js +0 -197
- package/components/organisms/StrategyDashboard/actions.js +0 -7
- package/components/organisms/StrategyDashboard/constants.js +0 -9
- package/components/organisms/StrategyDashboard/context.js +0 -7
- package/components/organisms/StrategyDashboard/index.js +0 -1
- package/components/organisms/StrategyDashboard/reducer.js +0 -36
- package/components/organisms/StrategyDashboard/saga.js +0 -32
- package/components/organisms/StrategyDashboard/selectors.js +0 -33
- package/components/organisms/StrategyDashboard/style.js +0 -21
- package/components/organisms/TagCustomerAction/TagCustomerAction.js +0 -153
- package/components/organisms/TagCustomerAction/index.js +0 -1
- package/components/organisms/TagCustomerAction/messages.js +0 -20
- package/components/organisms/TierUpgradeAndDowngrade/TierUpgradeAndDowngrade.js +0 -343
- package/components/organisms/TierUpgradeAndDowngrade/constants.js +0 -2
- package/components/organisms/TierUpgradeAndDowngrade/index.js +0 -1
- package/components/organisms/TierUpgradeAndDowngrade/messages.js +0 -56
- package/components/organisms/TierUpgradeAndDowngrade/style.js +0 -167
- package/components/organisms/TierUpgradeAndDowngrade/utils.js +0 -252
- package/components/organisms/TieradvancedOption/TierAdvancedOption.js +0 -406
- package/components/organisms/TieradvancedOption/actions.js +0 -12
- package/components/organisms/TieradvancedOption/constants.js +0 -25
- package/components/organisms/TieradvancedOption/index.js +0 -1
- package/components/organisms/TieradvancedOption/messages.js +0 -102
- package/components/organisms/TieradvancedOption/reducer.js +0 -31
- package/components/organisms/TieradvancedOption/saga.js +0 -33
- package/components/organisms/TieradvancedOption/selectors.js +0 -25
- package/components/organisms/TieradvancedOption/style.js +0 -52
- package/components/organisms/TieradvancedOption/utils.js +0 -153
- package/components/organisms/Tiers/Tiers.js +0 -826
- package/components/organisms/Tiers/actions.js +0 -30
- package/components/organisms/Tiers/constants.js +0 -27
- package/components/organisms/Tiers/context.js +0 -7
- package/components/organisms/Tiers/index.js +0 -1
- package/components/organisms/Tiers/messages.js +0 -29
- package/components/organisms/Tiers/reducer.js +0 -53
- package/components/organisms/Tiers/saga.js +0 -62
- package/components/organisms/Tiers/selectors.js +0 -23
- package/components/organisms/Tiers/style.js +0 -71
- package/components/organisms/Tiers/tests/actions.test.js +0 -13
- package/components/organisms/Tiers/tests/index.test.js +0 -11
- package/components/organisms/Tiers/tests/reducer.test.js +0 -8
- package/components/organisms/Tiers/tests/selectors.test.js +0 -7
- package/components/organisms/TrackerEvaluationWorkflowAction/TrackerEvaluationWorkflowAction.js +0 -205
- package/components/organisms/TrackerEvaluationWorkflowAction/index.js +0 -1
- package/components/organisms/TrackerEvaluationWorkflowAction/style.js +0 -17
- package/components/organisms/Trackers/Trackers.js +0 -476
- package/components/organisms/Trackers/constants.js +0 -14
- package/components/organisms/Trackers/index.js +0 -1
- package/components/organisms/Trackers/messages.js +0 -60
- package/components/organisms/Trackers/style.js +0 -74
- package/components/organisms/Trackers/tests/Trackers.test.js +0 -5
- package/components/organisms/TransactionAllocationPointWorkflowAction/TransactionAllocationPointWorkflowAction.js +0 -355
- package/components/organisms/TransactionAllocationPointWorkflowAction/constants.js +0 -3
- package/components/organisms/TransactionAllocationPointWorkflowAction/index.js +0 -1
- package/components/organisms/TransactionAllocationPointWorkflowAction/style.js +0 -17
- package/components/organisms/TransferGroupPoints/TransferGroupPoints.js +0 -570
- package/components/organisms/TransferGroupPoints/constants.js +0 -21
- package/components/organisms/TransferGroupPoints/index.js +0 -1
- package/components/organisms/TransferGroupPoints/messages.js +0 -32
- package/components/organisms/TransferGroupPoints/style.js +0 -21
- package/components/organisms/UpgradeCommunication/UpgradeCommunication.js +0 -128
- package/components/organisms/UpgradeCommunication/index.js +0 -1
- package/components/organisms/UpgradeCommunication/messages.js +0 -20
- package/components/organisms/UpgradeCommunication/tests/index.test.js +0 -11
- package/components/organisms/UpgradeCommunication/utils.js +0 -170
- package/components/organisms/UpgradeToTierSettingsWorkflowAction/UpgradeToTierSettingsWorkflowAction.js +0 -205
- package/components/organisms/UpgradeToTierSettingsWorkflowAction/index.js +0 -1
- package/components/organisms/UpgradeToTierSettingsWorkflowAction/messages.js +0 -17
- package/components/organisms/UpgradeToTierSettingsWorkflowAction/style.js +0 -17
- package/components/organisms/UpgradeToTierWorkflowAction/UpgradeToTierWorkflowAction.js +0 -337
- package/components/organisms/UpgradeToTierWorkflowAction/index.js +0 -1
- package/components/organisms/UpgradeToTierWorkflowAction/messages.js +0 -48
- package/components/organisms/UpgradeToTierWorkflowAction/style.js +0 -17
- package/components/pages/AccessForbidden/AccessForbidden.js +0 -20
- package/components/pages/AccessForbidden/index.js +0 -1
- package/components/pages/AccessForbidden/messages.js +0 -14
- package/components/pages/AccessForbidden/style.js +0 -6
- package/components/pages/App/constants.js +0 -454
- package/components/pages/App/index.js +0 -47
- package/components/pages/Cap/Cap.js +0 -254
- package/components/pages/Cap/Loadable.js +0 -10
- package/components/pages/Cap/actions.js +0 -172
- package/components/pages/Cap/constants.js +0 -146
- package/components/pages/Cap/index.js +0 -1
- package/components/pages/Cap/messages.js +0 -1222
- package/components/pages/Cap/reducer.js +0 -287
- package/components/pages/Cap/routes.js +0 -36
- package/components/pages/Cap/saga.js +0 -570
- package/components/pages/Cap/selectors.js +0 -196
- package/components/pages/Cap/style.js +0 -71
- package/components/pages/ConfigureProgram/ConfigureProgram.js +0 -66
- package/components/pages/ConfigureProgram/data.js +0 -17
- package/components/pages/ConfigureProgram/index.js +0 -1
- package/components/pages/ConfigureProgram/messages.js +0 -33
- package/components/pages/Dashboard/Dashboard.js +0 -171
- package/components/pages/Dashboard/Loadable.js +0 -10
- package/components/pages/Dashboard/constants.js +0 -9
- package/components/pages/Dashboard/data.js +0 -364
- package/components/pages/Dashboard/index.js +0 -1
- package/components/pages/Dashboard/messages.js +0 -35
- package/components/pages/Dashboard/style.js +0 -5
- package/components/pages/LanguageProvider/actions.js +0 -27
- package/components/pages/LanguageProvider/constants.js +0 -16
- package/components/pages/LanguageProvider/index.js +0 -167
- package/components/pages/LanguageProvider/reducer.js +0 -39
- package/components/pages/LanguageProvider/saga.js +0 -31
- package/components/pages/LanguageProvider/selectors.js +0 -18
- package/components/pages/LanguageProvider/style.js +0 -5
- package/components/pages/LanguageProvider/tests/actions.test.js +0 -15
- package/components/pages/LanguageProvider/tests/index.test.js +0 -66
- package/components/pages/LanguageProvider/tests/reducer.test.js +0 -30
- package/components/pages/LanguageProvider/tests/saga.test.js +0 -63
- package/components/pages/LanguageProvider/tests/selectors.test.js +0 -12
- package/components/pages/Login/Loadable.js +0 -10
- package/components/pages/Login/Login.js +0 -88
- package/components/pages/Login/index.js +0 -1
- package/components/pages/Login/messages.js +0 -32
- package/components/pages/LoyaltySetting/LoyaltySetting.js +0 -43
- package/components/pages/LoyaltySetting/index.js +0 -1
- package/components/pages/LoyaltySetting/style.js +0 -3
- package/components/pages/LoyaltySetting/tests/LoyaltySetting.test.js +0 -28
- package/components/pages/LoyaltySetting/tests/__snapshots__/LoyaltySetting.test.js.snap +0 -9
- package/components/pages/NotFoundPage/Loadable.js +0 -10
- package/components/pages/NotFoundPage/NotFoundPage.js +0 -26
- package/components/pages/NotFoundPage/index.js +0 -1
- package/components/pages/NotFoundPage/messages.js +0 -15
- package/components/pages/NotFoundPage/tests/NotFoundPage.test.js +0 -11
- package/components/pages/NotFoundPage/tests/__snapshots__/NotFoundPage.test.js.snap +0 -18
- package/components/pages/ProgramSummary/ProgramSummary.js +0 -748
- package/components/pages/ProgramSummary/actions.js +0 -58
- package/components/pages/ProgramSummary/constants.js +0 -40
- package/components/pages/ProgramSummary/context.js +0 -7
- package/components/pages/ProgramSummary/index.js +0 -1
- package/components/pages/ProgramSummary/messages.js +0 -87
- package/components/pages/ProgramSummary/reducer.js +0 -130
- package/components/pages/ProgramSummary/saga.js +0 -181
- package/components/pages/ProgramSummary/selectors.js +0 -55
- package/components/pages/ProgramSummary/style.js +0 -68
- package/components/pages/ProgramSummary/tests/ProgramSummary.test.js +0 -16
- package/components/pages/ProgramSummary/tests/__snapshots__/ProgramSummary.test.js.snap +0 -63
- package/components/pages/ProgramSummary/utils.js +0 -7
- package/components/templates/PageTemplate/index.js +0 -1
- package/components/templates/PageTemplate/pageTemplate.js +0 -28
- package/components/templates/PageTemplate/tests/pageTemplate.test.js +0 -15
- package/config/constants.js +0 -4
- package/config/urls.js +0 -4
- package/configureStore.js +0 -51
- package/lib/CustomHooks/useInterval/index.js +0 -1
- package/lib/CustomHooks/useInterval/useInterval.js +0 -29
- package/services/requestConstructor.js +0 -114
- package/tests/integration/CreateProgram/CreateProgram.integration.test.js +0 -38
- package/tests/integration/CreateProgram/mocks/handler.js +0 -15
- package/tests/integration/CreateProgram/mocks/initialState.js +0 -4
- package/tests/integration/test-utils.js +0 -41
- package/utils/bugsnag.js +0 -43
- package/utils/checkStore.js +0 -21
- package/utils/clearDataOnUnmount.js +0 -14
- package/utils/commonUtils.js +0 -839
- package/utils/communication.js +0 -301
- package/utils/constants.js +0 -6
- package/utils/coupons.js +0 -26
- package/utils/createComponentWithIntl.js +0 -8
- package/utils/gtmTrackers/gtmEvents/cappingDetails.js +0 -33
- package/utils/gtmTrackers/gtmEvents/commChannelDetails.js +0 -29
- package/utils/gtmTrackers/gtmEvents/commDetails.js +0 -142
- package/utils/gtmTrackers/gtmEvents/configureKpis.js +0 -20
- package/utils/gtmTrackers/gtmEvents/earnPointDetails.js +0 -44
- package/utils/gtmTrackers/gtmEvents/errorScreen.js +0 -7
- package/utils/gtmTrackers/gtmEvents/expiryPointDetails.js +0 -35
- package/utils/gtmTrackers/gtmEvents/pointsSettingDetails.js +0 -14
- package/utils/gtmTrackers/gtmEvents/programDetails.js +0 -28
- package/utils/gtmTrackers/gtmEvents/programSettingDetails.js +0 -38
- package/utils/gtmTrackers/gtmEvents/publishChanges.js +0 -13
- package/utils/gtmTrackers/gtmEvents/redeemPointDetails.js +0 -37
- package/utils/gtmTrackers/gtmEvents/returnPointDetails.js +0 -26
- package/utils/gtmTrackers/gtmEvents/scopingDetails.js +0 -33
- package/utils/gtmTrackers/gtmEvents/tenderDetails.js +0 -43
- package/utils/gtmTrackers/gtmEvents/tierDetails.js +0 -110
- package/utils/gtmTrackers/gtmEvents/trackerDetails.js +0 -61
- package/utils/gtmTrackers/gtmEvents/workflowDetails.js +0 -14
- package/utils/gtmTrackers/index.js +0 -17
- package/utils/gtmTrackers/tests/errorScreen.test.js +0 -13
- package/utils/gtmTrackers/tests/mockData.js +0 -4
- package/utils/gtmTrackers/tests/programDetails.test.js +0 -24
- package/utils/history.js +0 -3
- package/utils/injectReducer.js +0 -40
- package/utils/injectSaga.js +0 -58
- package/utils/intlWrapper.js +0 -40
- package/utils/parseSenderDetails.js +0 -49
- package/utils/reducerInjectors.js +0 -34
- package/utils/sagaInjectors.js +0 -92
- package/utils/tests/checkStore.test.js +0 -33
- package/utils/tiers.js +0 -331
- package/utils/userUtils.js +0 -7
- package/utils/validationHelper.js +0 -9
- package/utils/withErrorBoundary.js +0 -24
- package/utils/withStyles.js +0 -9
- package/utils/workflow.js +0 -622
- /package/{assets/cap-logo.png → containers/Login/assets/images/capillary_logo.png} +0 -0
|
@@ -0,0 +1,3298 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* FormBuilder
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Label } from 'semantic-ui-react';
|
|
12
|
+
import _ from 'lodash';
|
|
13
|
+
import { Tabs, Row, Col, Table, Modal, notification} from 'antd';
|
|
14
|
+
import { CapButton, CapInput, CapPopover, CapTextArea, CapCheckbox, CapRadio, CapRadioGroup, CapSelect, CapTable, CapColumn} from '@capillarytech/cap-react-ui-library';
|
|
15
|
+
import TemplatePreview from '../../components/TemplatePreview';
|
|
16
|
+
// import { CapCheckbox } from '@capillarytech/cap-react-ui-library/basic/checkbox';
|
|
17
|
+
import TagList from '../../containers/TagList';
|
|
18
|
+
import SmsEditor from '../SmsEditor';
|
|
19
|
+
import SlideBox from '../SlideBox';
|
|
20
|
+
import CardGrid from '../CardGrid';
|
|
21
|
+
import * as charCount from '../../utils/smsCharCount';
|
|
22
|
+
import CKEditor from "../../components/Ckeditor/";
|
|
23
|
+
import EDMEditor from "../../components/Edmeditor";
|
|
24
|
+
import CustomPopOver from '../../components/CustomPopOver';
|
|
25
|
+
import './_formBuilder.scss';
|
|
26
|
+
import {updateCharCount, checkUnicode} from "../../utils/smsCharCountV2";
|
|
27
|
+
const TabPane = Tabs.TabPane;
|
|
28
|
+
const {Column} = Table;
|
|
29
|
+
// import styled from 'styled-components';
|
|
30
|
+
|
|
31
|
+
// import { FormattedMessage } from 'react-intl';
|
|
32
|
+
// import messages from './messages';
|
|
33
|
+
|
|
34
|
+
class FormBuilder extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
35
|
+
constructor(props) {
|
|
36
|
+
super(props);
|
|
37
|
+
this.state = {
|
|
38
|
+
formData: {},
|
|
39
|
+
errorData: {},
|
|
40
|
+
currentTab: 1,
|
|
41
|
+
currentLangTab: 'en',
|
|
42
|
+
usingTabContainer: false,
|
|
43
|
+
tabCount: 1,
|
|
44
|
+
tabKey: '',
|
|
45
|
+
isFormValid: false,
|
|
46
|
+
checkValidation: false,
|
|
47
|
+
showModal: false,
|
|
48
|
+
modal: {},
|
|
49
|
+
currentEvent: {},
|
|
50
|
+
currentEventData: {},
|
|
51
|
+
popoverVisible: false,
|
|
52
|
+
customPopoverVisible: false,
|
|
53
|
+
};
|
|
54
|
+
this.renderForm = this.renderForm.bind(this);
|
|
55
|
+
this.updateFormData = this.updateFormData.bind(this);
|
|
56
|
+
this.callChildEvent = this.callChildEvent.bind(this);
|
|
57
|
+
this.renderColLabelSection = this.renderColLabelSection.bind(this);
|
|
58
|
+
this.renderMultiColSection = this.renderMultiColSection.bind(this);
|
|
59
|
+
this.renderSection = this.renderSection.bind(this);
|
|
60
|
+
this.renderContainer = this.renderContainer.bind(this);
|
|
61
|
+
this.renderParentSection = this.renderParentSection.bind(this);
|
|
62
|
+
this.initializeStandAloneSections = this.initializeStandAloneSections.bind(this);
|
|
63
|
+
this.initializeMultiColSection = this.initializeMultiColSection.bind(this);
|
|
64
|
+
this.initializeParentSection = this.initializeParentSection.bind(this);
|
|
65
|
+
this.initializeColLabelSection = this.initializeColLabelSection.bind(this);
|
|
66
|
+
this.initializeContainers = this.initializeContainers.bind(this);
|
|
67
|
+
this.cloneVersionData = this.cloneVersionData.bind(this);
|
|
68
|
+
this.markFinalTabVersion = this.markFinalTabVersion.bind(this);
|
|
69
|
+
this.duplicateVersion = this.duplicateVersion.bind(this);
|
|
70
|
+
this.deleteVersion = this.deleteVersion.bind(this);
|
|
71
|
+
this.renameVersion = this.renameVersion.bind(this);
|
|
72
|
+
this.resetState = this.resetState.bind(this);
|
|
73
|
+
this.onEdit = this.onEdit.bind(this);
|
|
74
|
+
this.changeVersionName = this.changeVersionName.bind(this);
|
|
75
|
+
this.hasClass = this.hasClass.bind(this);
|
|
76
|
+
this.validateForm = this.validateForm.bind(this);
|
|
77
|
+
this.indexOfEnd = this.indexOfEnd.bind(this);
|
|
78
|
+
this.saveForm = this.saveForm.bind(this);
|
|
79
|
+
this.initializeEditErrorData = this.initializeEditErrorData.bind(this);
|
|
80
|
+
this.checkIfSupportedTag = this.checkIfSupportedTag.bind(this);
|
|
81
|
+
this.transformInjectedTags = this.transformInjectedTags.bind(this);
|
|
82
|
+
this.formElements = [];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
componentWillMount() {
|
|
86
|
+
console.log('FOrm builder Mounting ', this.props, this.state);
|
|
87
|
+
this.setState({usingTabContainer: this.props.usingTabContainer ? this.props.usingTabContainer : false});
|
|
88
|
+
if (this.props.formData && (this.props.isEdit || (!this.props.isEdit && !_.isEmpty(this.props.formData)))) {
|
|
89
|
+
console.log('mounted');
|
|
90
|
+
this.setState({formData: this.props.formData}, () => {
|
|
91
|
+
// if (!this.props.isNewVersionFlow) {
|
|
92
|
+
this.initialiseForm(this.props.schema, false, true);
|
|
93
|
+
// }
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
console.log('initializing in edit');
|
|
97
|
+
this.initialiseForm(this.props.schema, true);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
componentWillReceiveProps(nextProps) {
|
|
102
|
+
console.log('outgoing nextprops', nextProps, this.state.formData);
|
|
103
|
+
const type = this.props.location.query.type;
|
|
104
|
+
if (this.state.usingTabContainer && nextProps.tabCount !== this.props.tabCount) {
|
|
105
|
+
this.setState({tabCount: nextProps.tabCount});
|
|
106
|
+
}
|
|
107
|
+
if (nextProps.startValidation && nextProps.startValidation !== false && this.props.startValidation !== nextProps.startValidation) {
|
|
108
|
+
this.setState({checkValidation: true});
|
|
109
|
+
const ifValid = this.validateForm(null, null, null, true);
|
|
110
|
+
console.log('validation final', ifValid);
|
|
111
|
+
if (ifValid) {
|
|
112
|
+
this.saveForm(true);
|
|
113
|
+
} else {
|
|
114
|
+
this.props.stopValidation();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// if (nextProps.saveForm && this.props.saveForm !== nextProps.saveForm) {
|
|
118
|
+
// this.saveForm(saveForm);
|
|
119
|
+
// }
|
|
120
|
+
if (nextProps.isEdit) {
|
|
121
|
+
console.log('Edit mode form data ', nextProps.formData, this.state.formData);
|
|
122
|
+
if (!_.isEqual(nextProps.formData, this.state.formData) && !_.isEmpty(nextProps.formData)) {
|
|
123
|
+
console.log('incoming props 1');
|
|
124
|
+
if (type === 'embedded') { //TODO: has to be checked and changed.
|
|
125
|
+
this.setState({checkValidation: true, formData: nextProps.formData}, () => {
|
|
126
|
+
this.validateForm();
|
|
127
|
+
});
|
|
128
|
+
// this.setState({formData: nextProps.formData}, () => {
|
|
129
|
+
// this.validateForm();
|
|
130
|
+
// });
|
|
131
|
+
}
|
|
132
|
+
//TODO change this structure
|
|
133
|
+
if (this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'WECHAT') {
|
|
134
|
+
this.setState({formData: nextProps.formData});
|
|
135
|
+
} else if ( !_.isEmpty(nextProps.formData) && !_.isEqual(this.state.formData, nextProps.formData) && this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'MOBILEPUSH') {
|
|
136
|
+
this.setState({formData: nextProps.formData, tabCount: nextProps.tabCount});
|
|
137
|
+
// this.resetTabKeys(nextProps.formData, nextProps.tabCount);
|
|
138
|
+
} else if (this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'EMAIL') {
|
|
139
|
+
this.setState({formData: nextProps.formData});
|
|
140
|
+
}
|
|
141
|
+
console.log("incoming props 1", this.state.usingTabContainer, this.state.tabKey);
|
|
142
|
+
if (this.state.usingTabContainer && this.state.tabKey === '') {
|
|
143
|
+
//this.setState({formData: nextProps.formData});
|
|
144
|
+
if (nextProps.isNewVersionFlow && !_.isEqual(this.state.tabKey, nextProps.tabKey)) {
|
|
145
|
+
console.log('Tab key condition', nextProps.tabKey);
|
|
146
|
+
this.setState({tabKey: nextProps.tabKey});
|
|
147
|
+
} else if (!nextProps.isNewVersionFlow) {
|
|
148
|
+
this.resetTabKeys(nextProps.formData, nextProps.tabCount);
|
|
149
|
+
}
|
|
150
|
+
this.initializeEditErrorData(nextProps.formData, nextProps.tabCount);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (_.isEmpty(this.props.formData) && !_.isEmpty(nextProps.formData)) {
|
|
154
|
+
console.log('incoming props 2');
|
|
155
|
+
if (this.state.usingTabContainer) {
|
|
156
|
+
this.resetTabKeys(nextProps.formData, nextProps.tabCount);
|
|
157
|
+
}
|
|
158
|
+
this.initializeEditErrorData(nextProps.formData, nextProps.tabCount);
|
|
159
|
+
}
|
|
160
|
+
if (!_.isEmpty(this.props.formData) && this.props.formData !== this.state.formData && _.isEmpty(this.state.formData) && this.state.usingTabContainer) {
|
|
161
|
+
console.log('incoming props 3');
|
|
162
|
+
this.resetTabKeys(this.props.formData, nextProps.tabCount);
|
|
163
|
+
}
|
|
164
|
+
if ( this.state.usingTabContainer && nextProps.formData && !_.isEmpty(nextProps.formData) && _.isEmpty(this.props.formData) && nextProps.tabCount && this.state.tabCount !== nextProps.tabCount) {
|
|
165
|
+
console.log('incoming props 4', this.state, nextProps);
|
|
166
|
+
this.setState({ formData: nextProps.formData, tabCount: nextProps.tabCount }, () => {
|
|
167
|
+
this.initializeEditErrorData(nextProps.formData, nextProps.tabCount);
|
|
168
|
+
if (this.state.usingTabContainer) {
|
|
169
|
+
this.resetTabKeys(nextProps.formData, nextProps.tabCount);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
if (nextProps.tabCount > 1) {
|
|
173
|
+
this.setState({usingTabContainer: true});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// if (nextProps.currentTab) {
|
|
177
|
+
// this.setState({currentTab: nextProps.currentTab});
|
|
178
|
+
// }
|
|
179
|
+
} else if (!_.isEmpty(nextProps.formData) &&
|
|
180
|
+
( !this.state.usingTabContainer || (this.state.usingTabContainer && nextProps.tabKey !== ''))
|
|
181
|
+
&& !_.isEqual(nextProps.formData, this.state.formData) &&
|
|
182
|
+
!_.isEqual(nextProps.formData, this.props.formData)) {
|
|
183
|
+
console.log('outgoing hahaha', nextProps.tabKey);
|
|
184
|
+
this.setState({formData: nextProps.formData, tabKey: nextProps.tabKey}, () => {
|
|
185
|
+
this.validateForm();
|
|
186
|
+
});
|
|
187
|
+
//this.resetTabKeys(nextProps.formData, nextProps.tabCount);
|
|
188
|
+
} else if ((_.isEmpty(this.props.formData) || !this.props.formData) && _.isEmpty(this.state.formData)) {
|
|
189
|
+
console.log('outgoing init when empty');
|
|
190
|
+
this.initialiseForm(nextProps.schema, true);
|
|
191
|
+
} else if (_.isEmpty(this.props.formData) && !_.isEmpty(nextProps.formData)) {
|
|
192
|
+
console.log('outgoing clean form data');
|
|
193
|
+
this.setState({formData: nextProps.formData});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
let currentLangTab = _.cloneDeep(this.state.currentLangTab);
|
|
197
|
+
if (nextProps.isNewVersionFlow && nextProps.formData[`${this.state.currentTab - 1}`] && nextProps.formData[`${this.state.currentTab - 1}`].activeTab) {
|
|
198
|
+
currentLangTab = nextProps.formData[`${this.state.currentTab - 1}`].activeTab;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (nextProps.isNewVersionFlow && nextProps.currentTab && nextProps.currentTab !== this.props.currentTab) {
|
|
202
|
+
this.setState({currentTab: nextProps.currentTab});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (!_.isEmpty(nextProps.formData) && !_.isEqual(this.state.formData, nextProps.formData)) {
|
|
206
|
+
console.log('outgoing always', nextProps.formData);
|
|
207
|
+
if (nextProps.isNewVersionFlow) {
|
|
208
|
+
console.log('outgoing new flow');
|
|
209
|
+
const tabKey = (this.state.tabKey !== nextProps.formData[nextProps.currentTab - 1].tabKey) ? nextProps.formData[nextProps.currentTab - 1].tabKey : this.state.tabKey;
|
|
210
|
+
console.log('outgoing tab key form builder', this.state.tabKey, nextProps.formData[nextProps.currentTab - 1].tabKey, nextProps.formData, this.state.formData);
|
|
211
|
+
this.setState({tabKey});
|
|
212
|
+
}
|
|
213
|
+
this.setState({formData: nextProps.formData, currentLangTab}, () => {
|
|
214
|
+
if (nextProps.isNewVersionFlow && !this.state.formData[this.state.currentTab - 1][this.state.formData[this.state.currentTab - 1].activeTab].tabKey) {
|
|
215
|
+
console.log('outgoing have to reset tab keys');
|
|
216
|
+
this.resetTabKeys(nextProps.formData, nextProps.tabCount, false, true);
|
|
217
|
+
}
|
|
218
|
+
if (type === 'embedded' || this.props.schema.channel.toUpperCase() === 'EMAIL') {
|
|
219
|
+
this.validateForm();
|
|
220
|
+
}
|
|
221
|
+
if ((this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'MOBILEPUSH')) {
|
|
222
|
+
this.validateForm();
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
console.log('outgoing Next prop schema ', nextProps.schema);
|
|
228
|
+
if (!_.isEqual(nextProps.schema, this.props.schema)) {
|
|
229
|
+
console.log('outgoing Reinitializing form ', nextProps.schema, this.props.schema);
|
|
230
|
+
this.setState({ isFormValid: (this.props.isEdit ? this.props.isEdit : true) }, () => {
|
|
231
|
+
console.log('outgoing set validity');
|
|
232
|
+
if (!this.props.isEdit || (this.props.isEdit && !_.isEmpty(nextProps.formData))) {
|
|
233
|
+
console.log('outgoing 1', this.state.formData, nextProps.formData);
|
|
234
|
+
let resetTabKeys = (this.state.formData.tabKey === undefined);
|
|
235
|
+
if ((this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'MOBILEPUSH')) {
|
|
236
|
+
resetTabKeys = false;
|
|
237
|
+
console.log('outgoing 2');
|
|
238
|
+
}
|
|
239
|
+
if (this.props.isNewVersionFlow) {
|
|
240
|
+
resetTabKeys = false;
|
|
241
|
+
}
|
|
242
|
+
console.log('outgoing 3', resetTabKeys);
|
|
243
|
+
this.initialiseForm(nextProps.schema, false, resetTabKeys);
|
|
244
|
+
this.validateForm();
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
if (!_.isEqual(nextProps.checkValidation, this.props.checkValidation)) {
|
|
249
|
+
console.log('setting validation ', nextProps.checkValidation, this.props.checkValidation);
|
|
250
|
+
this.setState({ checkValidation: nextProps.checkValidation });
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (this.props.currentTab !== nextProps.currentTab && nextProps.currentTab) {
|
|
254
|
+
this.setState({currentTab: nextProps.currentTab});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (!_.isEmpty(nextProps.injectedTags) && !_.isEqual(nextProps.injectedTags, this.props.injectedTags)) {
|
|
258
|
+
console.log('Inside injected Tags', nextProps.injectedTags, this.props.injectedTags);
|
|
259
|
+
this.validateForm(nextProps.tags, nextProps.injectedTags);
|
|
260
|
+
}
|
|
261
|
+
if (!_.isEmpty(nextProps.tags) && !_.isEqual(nextProps.tags, this.props.tags)) {
|
|
262
|
+
console.log('Inside Tags', nextProps.tags, this.props.tags);
|
|
263
|
+
this.validateForm(nextProps.tags, nextProps.injectedTags);
|
|
264
|
+
}
|
|
265
|
+
if (!_.isEqual(nextProps.showModal, this.props.showModal)) {
|
|
266
|
+
console.log('Inside Modal change ', nextProps.showModal);
|
|
267
|
+
this.setState({showModal: nextProps.showModal});
|
|
268
|
+
}
|
|
269
|
+
if (nextProps.modal && (!_.isEqual(nextProps.modal, this.props.modal) || _.isEmpty(this.state.modal))) {
|
|
270
|
+
console.log('Inside Modal change ', nextProps.showModal);
|
|
271
|
+
this.setState({modal: nextProps.modal});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
onEdit(data, e) {
|
|
276
|
+
console.log('called on Edit', data, e);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
getModal = () => {
|
|
280
|
+
let modal;
|
|
281
|
+
if (this.state.modal) {
|
|
282
|
+
if (this.state.modal.type === 'confirm') {
|
|
283
|
+
console.log('Adding modal to render');
|
|
284
|
+
modal = (<Modal
|
|
285
|
+
visible={this.state.showModal}
|
|
286
|
+
title={this.state.modal.title}
|
|
287
|
+
onOk={this.handleOk}
|
|
288
|
+
onCancel={this.handleCancel}
|
|
289
|
+
footer={[
|
|
290
|
+
<CapButton key="back" onClick={this.handleCancel}>Cancel</CapButton>,
|
|
291
|
+
<CapButton key="submit" type="primary" id={this.state.modal.id} onClick={this.handleOk}>
|
|
292
|
+
Yes
|
|
293
|
+
</CapButton>,
|
|
294
|
+
]}
|
|
295
|
+
>
|
|
296
|
+
{this.state.modal.body}
|
|
297
|
+
</Modal>);
|
|
298
|
+
} else if (this.state.modal.type === "info") {
|
|
299
|
+
modal = (<Modal
|
|
300
|
+
visible={this.state.showModal}
|
|
301
|
+
title={this.state.modal.title}
|
|
302
|
+
onOk={this.handleOk}
|
|
303
|
+
onCancel={this.handleCancel}
|
|
304
|
+
footer={[
|
|
305
|
+
<CapButton key="back" onClick={this.handleCancel}>Ok</CapButton>,
|
|
306
|
+
]}
|
|
307
|
+
>
|
|
308
|
+
{this.state.modal.body}
|
|
309
|
+
</Modal>);
|
|
310
|
+
} else if (this.state.modal.type === "action") {
|
|
311
|
+
modal = (<Modal
|
|
312
|
+
visible={this.state.showModal}
|
|
313
|
+
title={this.state.modal.title}
|
|
314
|
+
onOk={this.handleOk}
|
|
315
|
+
onCancel={this.handleCancel}
|
|
316
|
+
footer={[
|
|
317
|
+
]}
|
|
318
|
+
afterClose={this.handleCloseModal}
|
|
319
|
+
>
|
|
320
|
+
{this.state.modal.jsx}
|
|
321
|
+
</Modal>);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return modal;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
openNotificationWithIcon = (type, message) => {
|
|
328
|
+
const dur = (type === 'error' || type === 'warning') ? null : 5;
|
|
329
|
+
notification[type]({
|
|
330
|
+
message: (`${type.toUpperCase()} ! ! ! `),
|
|
331
|
+
description: message, //'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
|
|
332
|
+
duration: dur,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
handleCloseModal = (data, e) => {
|
|
337
|
+
console.log('handle close modal', data, e);
|
|
338
|
+
const event = this.state.currentEvent;
|
|
339
|
+
if (!_.isEmpty(this.state.currentEvent)) {
|
|
340
|
+
switch (event) {
|
|
341
|
+
case "addLanguage":
|
|
342
|
+
this.updateFormData(this.state.currentEventData, this.state.currentEventVal, this.state.currentEvent);
|
|
343
|
+
break;
|
|
344
|
+
default:
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
handleVisibleChange = (popoverVisible) => {
|
|
351
|
+
this.setState({ popoverVisible });
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
handleCustomPopoverVisibleChange = (customPopoverVisible) => {
|
|
355
|
+
this.setState({ customPopoverVisible });
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
resetTabKeys(form, count, changeDefaultTab, setFormTabKey) {
|
|
359
|
+
const tabCount = count || this.state.tabCount;
|
|
360
|
+
console.log('outgoing reset', form, count, changeDefaultTab);
|
|
361
|
+
console.log('incoming reset', form, tabCount);
|
|
362
|
+
const formData = _.cloneDeep(form);
|
|
363
|
+
let baseIndex = 0;
|
|
364
|
+
for (let idx = 0; idx < tabCount; idx += 1) {
|
|
365
|
+
if (this.props.isNewVersionFlow && formData[idx].selectedLanguages.length > 0) {
|
|
366
|
+
for (let langIndex = 0; langIndex < formData[idx].selectedLanguages.length; langIndex += 1 ) {
|
|
367
|
+
const id = _.uniqueId();
|
|
368
|
+
if (formData[idx][formData[idx].selectedLanguages[langIndex]]) {
|
|
369
|
+
if (!formData[idx][formData[idx].selectedLanguages[langIndex]].tabKey) {
|
|
370
|
+
formData[idx][formData[idx].selectedLanguages[langIndex]].tabKey = id;
|
|
371
|
+
}
|
|
372
|
+
if (formData[idx].base) {
|
|
373
|
+
formData.base[formData.base.selectedLanguages[langIndex]].tabKey = id;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (setFormTabKey) {
|
|
378
|
+
if (!formData[idx].activeTab) {
|
|
379
|
+
const baseLanguage = this.props.baseLanguage;
|
|
380
|
+
console.log('outgoing reset do not have active tab');
|
|
381
|
+
formData[idx].tabKey = formData[idx][baseLanguage].tabKey;
|
|
382
|
+
} else {
|
|
383
|
+
console.log('outgoing reset have active tab');
|
|
384
|
+
formData[idx].tabKey = formData[idx][formData[idx].activeTab].tabKey;
|
|
385
|
+
}
|
|
386
|
+
if (formData[idx].base) {
|
|
387
|
+
if (!formData.base.activeTab) {
|
|
388
|
+
console.log('outgoing reset do not have active tab base');
|
|
389
|
+
const baseLanguage = this.props.baseLanguage;
|
|
390
|
+
formData.base.tabKey = formData.base[baseLanguage].tabKey;
|
|
391
|
+
} else {
|
|
392
|
+
console.log('outgoing reset have active tab base');
|
|
393
|
+
formData.base.tabKey = formData.base[formData[idx].activeTab].tabKey;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
console.log('debug bal 2', formData[idx], formData, idx);
|
|
398
|
+
if (formData[idx].base && formData.base.activeTab) {
|
|
399
|
+
console.log('debug bal', formData[idx][formData[idx].activeTab].tabKey, idx, formData[idx]);
|
|
400
|
+
// if (!formData.base.tabKey) {
|
|
401
|
+
console.log('resetting base tak key');
|
|
402
|
+
formData.base.tabKey = formData[idx][formData[idx].activeTab].tabKey;
|
|
403
|
+
//}
|
|
404
|
+
baseIndex = idx;
|
|
405
|
+
}
|
|
406
|
+
} else {
|
|
407
|
+
console.log('Old Flow');
|
|
408
|
+
if (formData[idx]) {
|
|
409
|
+
if (!formData[idx].tabKey) {
|
|
410
|
+
formData[idx].tabKey = _.uniqueId();
|
|
411
|
+
}
|
|
412
|
+
if (formData[idx].base) {
|
|
413
|
+
formData.base = formData[idx];
|
|
414
|
+
baseIndex = idx;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
console.log('Hello World ', formData, tabCount);
|
|
420
|
+
if ((formData.base && formData.base.tabKey && formData.base.tabKey !== '' && !changeDefaultTab) || (formData.base && this.state.tabKey !== formData.base.tabKey)) {
|
|
421
|
+
console.log('setting tab key', formData.base.tabKey, this.state.tabKey);
|
|
422
|
+
if (this.state.currentTab === 1 && !this.props.isNewVersionFlow) {
|
|
423
|
+
this.setState({tabKey: formData.base.tabKey});
|
|
424
|
+
} else if (this.props.isNewVersionFlow && this.state.tabKey !== formData[this.state.currentTab - 1].tabKey) {
|
|
425
|
+
console.log('outgoing changing tab key');
|
|
426
|
+
this.setState({tabKey: formData[this.state.currentTab - 1].tabKey});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
if (setFormTabKey) {
|
|
430
|
+
console.log('outgoing reset form builder tab key', formData.base.tabKey, formData[0].tabKey, formData);
|
|
431
|
+
this.setState({tabKey: formData.base.tabKey});
|
|
432
|
+
}
|
|
433
|
+
console.log('form data before adding key', formData);
|
|
434
|
+
console.log('outgoing reset final before set', formData, this.state.tabKey);
|
|
435
|
+
if (changeDefaultTab) {
|
|
436
|
+
this.setState({formData}, () => {
|
|
437
|
+
console.log('outgoing reset set data', formData);
|
|
438
|
+
this.props.onChange(formData, this.state.tabCount);
|
|
439
|
+
this.validateForm();
|
|
440
|
+
});
|
|
441
|
+
} else {
|
|
442
|
+
this.setState({formData, currentTab: baseIndex + 1}, () => {
|
|
443
|
+
this.props.onChange(formData, this.state.tabCount);
|
|
444
|
+
this.validateForm();
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/* eslint-disable */
|
|
450
|
+
validateForm(tags, injectedTags, isSave, showMessages) {
|
|
451
|
+
console.log('validating form', this.state.formData);
|
|
452
|
+
console.log("mmm", this.props );
|
|
453
|
+
let isValid = true;
|
|
454
|
+
const type = (this.props.location && this.props.location.query.type) ? this.props.location.query.type : 'full';
|
|
455
|
+
const currentModule = (this.props.location && this.props.location.query.module) ? this.props.location.query.module : 'default';
|
|
456
|
+
const errorData = _.cloneDeep(this.state.errorData);
|
|
457
|
+
if (this.props.schema.channel === 'SMS') {
|
|
458
|
+
console.log('sms error validation form data', this.state.formData);
|
|
459
|
+
for (let count = 0; count < this.state.tabCount; count += 1) {
|
|
460
|
+
if (_.isEmpty(errorData[count])) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
const index = count + 1;
|
|
464
|
+
if (!this.state.formData[count]) {
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
const content = this.state.formData[count][`sms-editor${index > 1 ? index : ''}`];
|
|
468
|
+
const unicodeCheck = this.state.formData[count][`unicode-validity${index > 1 ? index : ''}`];
|
|
469
|
+
const ifUnicode = content && content !== '' ? checkUnicode(content) : false;
|
|
470
|
+
console.log('characters are', ifUnicode, unicodeCheck);
|
|
471
|
+
const tagValidationResponse = this.validateTags(content, tags, injectedTags);
|
|
472
|
+
console.log('tag valid response', tagValidationResponse);
|
|
473
|
+
if (tagValidationResponse.valid) {
|
|
474
|
+
errorData[count][`sms-editor${index > 1 ? index : ''}`] = false;
|
|
475
|
+
} else {
|
|
476
|
+
console.log('sms error validation tags issue');
|
|
477
|
+
errorData[count][`sms-editor${index > 1 ? index : ''}`] = true;
|
|
478
|
+
isValid = false;
|
|
479
|
+
}
|
|
480
|
+
if(content !== '' && (ifUnicode && !unicodeCheck)) {
|
|
481
|
+
errorData[count][`unicode-validity${index > 1 ? index : ''}`] = true;
|
|
482
|
+
isValid = false;
|
|
483
|
+
} else if (content === '') {
|
|
484
|
+
console.log('sms error validation content is empty');
|
|
485
|
+
errorData[count][`sms-editor${index > 1 ? index : ''}`] = true;
|
|
486
|
+
isValid = false;
|
|
487
|
+
} else {
|
|
488
|
+
errorData[count][`unicode-validity${index > 1 ? index : ''}`] = false;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if(type !== 'embedded' && (!this.state.formData['template-name'] || this.state.formData['template-name'] === '')) {
|
|
492
|
+
errorData['template-name'] = true;
|
|
493
|
+
isValid = false;
|
|
494
|
+
} else {
|
|
495
|
+
errorData['template-name'] = false;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
//validation for LINE
|
|
500
|
+
if (this.props.schema.channel === 'LINE') {
|
|
501
|
+
console.log('line error validation form data', this.state.formData);
|
|
502
|
+
if (this.state.formData['0']['message-editor'] !== undefined ) {
|
|
503
|
+
const content = this.state.formData['0']['message-editor'];
|
|
504
|
+
console.log('tag valid response', content);
|
|
505
|
+
const tagValidationResponse = this.validateTags(content, tags, injectedTags);
|
|
506
|
+
console.log('tag valid response', tagValidationResponse);
|
|
507
|
+
if (tagValidationResponse.valid) {
|
|
508
|
+
errorData['0']['message-editor'] = false;
|
|
509
|
+
} else {
|
|
510
|
+
console.log('message error validation tags issue');
|
|
511
|
+
errorData['0']['message-editor'] = true;
|
|
512
|
+
isValid = false;
|
|
513
|
+
}
|
|
514
|
+
if (content.trim() === '') {
|
|
515
|
+
console.log('line error validation content is empty');
|
|
516
|
+
errorData['0']['message-editor'] = true;
|
|
517
|
+
isValid = false;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if ( (this.state.formData['0'].image !== undefined) && (this.state.formData['0'].imagePreview !== undefined)){
|
|
522
|
+
const imgContentLength = this.state.formData['0'].image.length;
|
|
523
|
+
const imgContentLengthPreview = this.state.formData['0'].imagePreview.length;
|
|
524
|
+
if ( (imgContentLength < 1) && (imgContentLengthPreview < 1) ) {
|
|
525
|
+
console.log('line error validation image content is empty');
|
|
526
|
+
errorData['0'].image = true;
|
|
527
|
+
errorData['0'].imagePreview = true;
|
|
528
|
+
isValid = false;
|
|
529
|
+
}else{
|
|
530
|
+
errorData['0'].image = false;
|
|
531
|
+
errorData['0'].imagePreview = false;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if(type !== 'embedded' && (!this.state.formData['template-name'] || this.state.formData['template-name'] === '')) {
|
|
535
|
+
errorData['template-name'] = true;
|
|
536
|
+
isValid = false;
|
|
537
|
+
} else {
|
|
538
|
+
errorData['template-name'] = false;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
if (this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'WECHAT') {
|
|
543
|
+
console.log('Validating Form Now ', this.state.formData);
|
|
544
|
+
_.forEach(this.state.formData, (val, index) => {
|
|
545
|
+
console.log('Validation Index ', index);
|
|
546
|
+
if (index.indexOf('template') > -1 && this.state.formData[index] !== undefined) {
|
|
547
|
+
const content = this.state.formData[index];
|
|
548
|
+
if (content.trim() === '') {
|
|
549
|
+
errorData[index] = true;
|
|
550
|
+
isValid = false;
|
|
551
|
+
} else {
|
|
552
|
+
const tagValidationResponse = this.validateTags(content, tags, injectedTags);
|
|
553
|
+
console.log('tag valid response', tagValidationResponse);
|
|
554
|
+
if (tagValidationResponse.valid) {
|
|
555
|
+
errorData[index] = false;
|
|
556
|
+
} else {
|
|
557
|
+
errorData[index] = true;
|
|
558
|
+
isValid = false;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
} else if (index === 'wechat-template') {
|
|
562
|
+
const content = this.state.formData[index];
|
|
563
|
+
if (content.trim() === '') {
|
|
564
|
+
errorData[index] = true;
|
|
565
|
+
isValid = false;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
console.log('Validation ', this.state.formData, Object.keys(this.state.formData), errorData);
|
|
570
|
+
}
|
|
571
|
+
if(this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === "MOBILEPUSH"){
|
|
572
|
+
let androidValid = true, iosValid = true;
|
|
573
|
+
let isOnlyAndroid = false, isOnlyIos = false;
|
|
574
|
+
|
|
575
|
+
const androidData = {};
|
|
576
|
+
for(let data in this.state.formData[0]){
|
|
577
|
+
if(!!this.state.formData[0][data] && data !== "tabKey" && data !== "base"){
|
|
578
|
+
androidData[data] = this.state.formData[0][data];
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if(_.isEmpty(androidData)){
|
|
582
|
+
isOnlyIos = true;
|
|
583
|
+
}
|
|
584
|
+
const iosData = {};
|
|
585
|
+
for(let data in this.state.formData[1]){
|
|
586
|
+
if(!!this.state.formData[1][data] && data !== "tabKey" && data !== "base"){
|
|
587
|
+
iosData[data] = this.state.formData[1][data];
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if(_.isEmpty(iosData)){
|
|
591
|
+
isOnlyAndroid = true;
|
|
592
|
+
}
|
|
593
|
+
_.forEach(this.state.formData, (tab, index) => {
|
|
594
|
+
let isCurrentTabValid = true;
|
|
595
|
+
let skipValidation = false;
|
|
596
|
+
if (type.toLowerCase() === 'embedded' && ((isOnlyAndroid && parseInt(index) === 1) || (isOnlyIos && parseInt(index) === 0))) {
|
|
597
|
+
skipValidation = true;
|
|
598
|
+
}
|
|
599
|
+
if (!isNaN(index) && tab && !skipValidation) {
|
|
600
|
+
const selector = index > 0 ? `${Number(index) + 1}` : '';
|
|
601
|
+
let message = tab[`message-editor${selector}`];
|
|
602
|
+
|
|
603
|
+
message = message.trim();
|
|
604
|
+
|
|
605
|
+
if (errorData[parseInt(index)]) {
|
|
606
|
+
if (message === "") {
|
|
607
|
+
errorData[parseInt(index)][`message-editor${selector}`] = true;
|
|
608
|
+
isValid = false;
|
|
609
|
+
isCurrentTabValid = false;
|
|
610
|
+
} else {
|
|
611
|
+
errorData[parseInt(index)][`message-editor${selector}`] = false;
|
|
612
|
+
const tagValidationResponse = this.validateTags(message, tags, injectedTags);
|
|
613
|
+
console.log('tag valid response', tagValidationResponse);
|
|
614
|
+
if (tagValidationResponse.valid) {
|
|
615
|
+
errorData[parseInt(index)][`message-editor${selector}`] = false;
|
|
616
|
+
} else {
|
|
617
|
+
errorData[parseInt(index)][`message-editor${selector}`] = true;
|
|
618
|
+
isValid = false;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
const title = tab[`message-title${selector}`].trim();
|
|
624
|
+
if (title === "") {
|
|
625
|
+
errorData[parseInt(index)][`message-title${selector}`] = true;
|
|
626
|
+
isValid = false;
|
|
627
|
+
isCurrentTabValid = false;
|
|
628
|
+
} else {
|
|
629
|
+
errorData[parseInt(index)][`message-title${selector}`] = false;
|
|
630
|
+
const tagValidationResponse = this.validateTags(title, tags, injectedTags);
|
|
631
|
+
console.log('tag valid response', tagValidationResponse);
|
|
632
|
+
if (tagValidationResponse.valid) {
|
|
633
|
+
errorData[parseInt(index)][`message-title${selector}`] = false;
|
|
634
|
+
} else {
|
|
635
|
+
errorData[parseInt(index)][`message-title${selector}`] = true;
|
|
636
|
+
isValid = false;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// if(tab['primary-cta-link'].trim() === ""){
|
|
641
|
+
// errorData[parseInt(index)][`primary-cta-link`] = true;
|
|
642
|
+
// isValid = false;
|
|
643
|
+
// }else {
|
|
644
|
+
// errorData[parseInt(index)]['primary-cta-link'] = false;
|
|
645
|
+
// }
|
|
646
|
+
if(tab['cta-deeplink-select'] === ""){
|
|
647
|
+
errorData[parseInt(index)][`cta-deeplink-select`] = true;
|
|
648
|
+
isValid = false;
|
|
649
|
+
isCurrentTabValid = false;
|
|
650
|
+
}else {
|
|
651
|
+
errorData[parseInt(index)]['cta-deeplink-select'] = false;
|
|
652
|
+
}
|
|
653
|
+
if(tab['cta-deeplink2-select'] === ""){
|
|
654
|
+
errorData[parseInt(index)][`cta-deeplink2-select`] = true;
|
|
655
|
+
isValid = false;
|
|
656
|
+
isCurrentTabValid = false;
|
|
657
|
+
}else {
|
|
658
|
+
errorData[parseInt(index)]['cta-deeplink2-select'] = false;
|
|
659
|
+
}
|
|
660
|
+
// }
|
|
661
|
+
if(tab[`cta-deeplink-text`] === ""){
|
|
662
|
+
errorData[parseInt(index)][`cta-deeplink-text`] = true;
|
|
663
|
+
isValid = false;
|
|
664
|
+
isCurrentTabValid = false;
|
|
665
|
+
}else {
|
|
666
|
+
errorData[parseInt(index)]['cta-deeplink-text'] = false;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if(tab['cta-deeplink2-text'] === ""){
|
|
670
|
+
errorData[parseInt(index)][`cta-deeplink2-text`] = true;
|
|
671
|
+
isValid = false;
|
|
672
|
+
isCurrentTabValid = false;
|
|
673
|
+
}else {
|
|
674
|
+
errorData[parseInt(index)]['cta-deeplink2-text'] = false;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
if(tab['secondary-cta-0-link'] === ""){
|
|
679
|
+
errorData[parseInt(index)][`secondary-cta-0-link`] = true;
|
|
680
|
+
isValid = false;
|
|
681
|
+
isCurrentTabValid = false;
|
|
682
|
+
}else {
|
|
683
|
+
errorData[parseInt(index)]['secondary-cta-0-link'] = false;
|
|
684
|
+
}
|
|
685
|
+
if(tab['secondary-cta-0-label'] === ""){
|
|
686
|
+
errorData[parseInt(index)][`secondary-cta-0-label`] = true;
|
|
687
|
+
isValid = false;
|
|
688
|
+
isCurrentTabValid = false;
|
|
689
|
+
}else {
|
|
690
|
+
errorData[parseInt(index)]['secondary-cta-0-label'] = false;
|
|
691
|
+
}
|
|
692
|
+
if(tab['cta-deeplink-secondary-cta-0-text'] === ""){
|
|
693
|
+
errorData[parseInt(index)][`cta-deeplink-secondary-cta-0-text`] = true;
|
|
694
|
+
isValid = false;
|
|
695
|
+
isCurrentTabValid = false;
|
|
696
|
+
}else {
|
|
697
|
+
errorData[parseInt(index)]['cta-deeplink-secondary-cta-0-text'] = false;
|
|
698
|
+
}
|
|
699
|
+
if(tab['cta-deeplink-secondary-cta-0-select'] === ""){
|
|
700
|
+
errorData[parseInt(index)][`cta-deeplink-secondary-cta-0-select`] = true;
|
|
701
|
+
isValid = false;
|
|
702
|
+
isCurrentTabValid = false;
|
|
703
|
+
}else {
|
|
704
|
+
errorData[parseInt(index)]['cta-deeplink-secondary-cta-0-select'] = false;
|
|
705
|
+
}
|
|
706
|
+
if(tab['secondary-cta-1-label'] === ""){
|
|
707
|
+
errorData[parseInt(index)][`secondary-cta-1-label`] = true;
|
|
708
|
+
isValid = false;
|
|
709
|
+
isCurrentTabValid = false;
|
|
710
|
+
}else {
|
|
711
|
+
errorData[parseInt(index)]['secondary-cta-1-label'] = false;
|
|
712
|
+
}
|
|
713
|
+
if(tab['cta-deeplink-secondary-cta-1-text'] === ""){
|
|
714
|
+
errorData[parseInt(index)][`cta-deeplink-secondary-cta-1-text`] = true;
|
|
715
|
+
isValid = false;
|
|
716
|
+
isCurrentTabValid = false;
|
|
717
|
+
}else {
|
|
718
|
+
errorData[parseInt(index)]['cta-deeplink-secondary-cta-1-text'] = false;
|
|
719
|
+
}
|
|
720
|
+
if(tab['cta-deeplink-secondary-cta-1-select'] === ""){
|
|
721
|
+
errorData[parseInt(index)][`cta-deeplink-secondary-cta-1-select`] = true;
|
|
722
|
+
isValid = false;
|
|
723
|
+
isCurrentTabValid = false;
|
|
724
|
+
}else {
|
|
725
|
+
errorData[parseInt(index)]['cta-deeplink-secondary-cta-1-select'] = false;
|
|
726
|
+
}
|
|
727
|
+
if(tab['cta-deeplink-secondary-cta-1-text2'] === ""){
|
|
728
|
+
errorData[parseInt(index)][`cta-deeplink-secondary-cta-1-text2`] = true;
|
|
729
|
+
isValid = false;
|
|
730
|
+
isCurrentTabValid = false;
|
|
731
|
+
}else {
|
|
732
|
+
errorData[parseInt(index)]['cta-deeplink-secondary-cta-1-text2'] = false;
|
|
733
|
+
}
|
|
734
|
+
if(tab['cta-deeplink-secondary-cta-1-select2'] === ""){
|
|
735
|
+
errorData[parseInt(index)][`cta-deeplink-secondary-cta-1-select2`] = true;
|
|
736
|
+
isValid = false;
|
|
737
|
+
isCurrentTabValid = false;
|
|
738
|
+
}else {
|
|
739
|
+
errorData[parseInt(index)]['cta-deeplink-secondary-cta-1-select2'] = false;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
if(typeof tab['image'] !== 'undefined' && tab['image'] === ""){
|
|
743
|
+
errorData[parseInt(index)]['image'] = true;
|
|
744
|
+
isValid = false;
|
|
745
|
+
isCurrentTabValid = false;
|
|
746
|
+
}else{
|
|
747
|
+
errorData[parseInt(index)]['image'] = false;
|
|
748
|
+
}
|
|
749
|
+
_.forEach(Object.keys(tab), (key) => {
|
|
750
|
+
if (key.indexOf('custom-value') > -1) {
|
|
751
|
+
if (tab[key] === "") {
|
|
752
|
+
errorData[parseInt(index)][key] = true;
|
|
753
|
+
isValid = false;
|
|
754
|
+
isCurrentTabValid = false;
|
|
755
|
+
}else {
|
|
756
|
+
errorData[parseInt(index)][key] = false;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
if(index == 0){
|
|
763
|
+
androidValid = isCurrentTabValid;
|
|
764
|
+
} else if(index == 1){
|
|
765
|
+
iosValid = isCurrentTabValid;
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
if(type !== 'embedded' && (!this.state.formData['template-name'] || this.state.formData['template-name'] === '')) {
|
|
769
|
+
errorData['template-name'] = true;
|
|
770
|
+
isValid = false;
|
|
771
|
+
androidValid = false;
|
|
772
|
+
iosValid = false
|
|
773
|
+
} else {
|
|
774
|
+
errorData['template-name'] = false;
|
|
775
|
+
}
|
|
776
|
+
if(isSave && (androidValid || iosValid)){
|
|
777
|
+
const modal = this.state.modal;
|
|
778
|
+
const androidData = {};
|
|
779
|
+
|
|
780
|
+
for(let data in this.state.formData[0]){
|
|
781
|
+
if(!!this.state.formData[0][data] && data !== "tabKey" && data !== "base"){
|
|
782
|
+
androidData[data] = this.state.formData[0][data];
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
if(_.isEmpty(androidData) && this.state.currentTab === 2){
|
|
786
|
+
this.setState({androidValid, iosValid}, () => {
|
|
787
|
+
this.props.setModalContent('ios');
|
|
788
|
+
});
|
|
789
|
+
// modal.body = "Android template is not configured. Save without Android template";
|
|
790
|
+
// modal.id = "ios";
|
|
791
|
+
// modal.type = 'confirm';
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
const iosData = {};
|
|
795
|
+
for(let data in this.state.formData[1]){
|
|
796
|
+
if(!!this.state.formData[1][data] && data !== "tabKey"){
|
|
797
|
+
iosData[data] = this.state.formData[1][data];
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
if(_.isEmpty(iosData) && this.state.currentTab === 1){
|
|
801
|
+
this.setState({androidValid, iosValid}, () => {
|
|
802
|
+
this.props.setModalContent('android');
|
|
803
|
+
});
|
|
804
|
+
// modal.body = "IOS template is not configured, Save without IOS template";
|
|
805
|
+
// modal.id = 'android';
|
|
806
|
+
// modal.type = 'confirm';
|
|
807
|
+
// this.setState({modal, showModal: true, androidValid, iosValid});
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (!androidValid || !iosValid) {
|
|
812
|
+
this.setState({androidValid, iosValid});
|
|
813
|
+
}
|
|
814
|
+
if (isOnlyAndroid && androidValid) {
|
|
815
|
+
isValid = isValid && true;
|
|
816
|
+
} else if (isOnlyIos && iosValid) {
|
|
817
|
+
isValid = isValid && true;
|
|
818
|
+
} else if (!isOnlyIos && !isOnlyAndroid && androidValid && iosValid) {
|
|
819
|
+
isValid = isValid && true;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// Form Data Validation for Email Channel
|
|
824
|
+
if (this.props.schema && this.props.schema.channel && this.props.schema.channel.toUpperCase() === "EMAIL") {
|
|
825
|
+
// Validating Email By iterating all elements of FormBuilder
|
|
826
|
+
_.forEach(this.state.formData, (data, index) => {
|
|
827
|
+
console.log("Form Iteration Data ", data, index);
|
|
828
|
+
if (!this.state.formData["template-subject"] && type.toLowerCase() === 'embedded' && (currentModule.toLowerCase() === 'loyalty' || currentModule.toLowerCase() === 'dvs' || currentModule.toLowerCase() === 'timeline' || currentModule.toLowerCase() === 'library')) {
|
|
829
|
+
errorData["template-subject"] = true;
|
|
830
|
+
isValid = false;
|
|
831
|
+
}
|
|
832
|
+
// Check if template subject present in form data from Loyalty, DVS, Timeline
|
|
833
|
+
if (index === 'template-subject' && type.toLowerCase() === 'embedded' && (currentModule.toLowerCase() === 'loyalty' || currentModule.toLowerCase() === 'dvs' || currentModule.toLowerCase() === 'timeline' || currentModule.toLowerCase() === 'library')) {
|
|
834
|
+
if (data.trim() === '') {
|
|
835
|
+
errorData[index] = true;
|
|
836
|
+
isValid = false;
|
|
837
|
+
} else {
|
|
838
|
+
errorData[index] = false;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// Check if Template name present in full mode
|
|
843
|
+
if(type !== 'embedded' && index === 'template-name' && data === '') {
|
|
844
|
+
errorData[index] = true;
|
|
845
|
+
isValid = false;
|
|
846
|
+
} else if(type !== 'embedded' && index === 'template-name' && data !== '') {
|
|
847
|
+
errorData[index] = false;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// Check formData if selected version present or not
|
|
851
|
+
if(index === 'template-version' && data === '') {
|
|
852
|
+
errorData[index] = true;
|
|
853
|
+
isValid = false;
|
|
854
|
+
} else if(index === 'template-version' && data !== '') {
|
|
855
|
+
errorData[index] = false;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// Check error for the versions
|
|
859
|
+
if (!isNaN(index) || index === 'base') {
|
|
860
|
+
if (errorData[index] === undefined) {
|
|
861
|
+
errorData[index] = {};
|
|
862
|
+
}
|
|
863
|
+
let errorString = "";
|
|
864
|
+
for (var i = 0; i < data.selectedLanguages.length; i+= 1) {
|
|
865
|
+
const currentLang = data.selectedLanguages[i];
|
|
866
|
+
const content = data[currentLang]['template-content'];
|
|
867
|
+
const tagValidationResponse = this.validateTags(content, tags, injectedTags);
|
|
868
|
+
if (errorData[index][currentLang] === undefined) {
|
|
869
|
+
errorData[index][currentLang] = {};
|
|
870
|
+
}
|
|
871
|
+
console.log('tag valid response', tagValidationResponse);
|
|
872
|
+
if (tagValidationResponse.valid) {
|
|
873
|
+
errorData[index][currentLang]['template-content'] = false;
|
|
874
|
+
} else {
|
|
875
|
+
errorData[index][currentLang]['template-content'] = true;
|
|
876
|
+
isValid = false;
|
|
877
|
+
if (showMessages && !isNaN(index)) {
|
|
878
|
+
if (tagValidationResponse.missingTags.length > 0 || tagValidationResponse.unsupportedTags.length > 0) {
|
|
879
|
+
errorString += `Content is not valid for language: ${currentLang}\n`;
|
|
880
|
+
}
|
|
881
|
+
if (tagValidationResponse.missingTags.length > 0) {
|
|
882
|
+
errorString += `Missing tags are: ${tagValidationResponse.missingTags.toString()}\n`;
|
|
883
|
+
}
|
|
884
|
+
if (tagValidationResponse.unsupportedTags.length > 0) {
|
|
885
|
+
errorString += `Unsupported tags are: ${tagValidationResponse.unsupportedTags.toString()}\n`;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
if (errorString !== "") {
|
|
891
|
+
this.openNotificationWithIcon('error', errorString);
|
|
892
|
+
}
|
|
893
|
+
_.forEach(errorData[index], (versionData, key) => {
|
|
894
|
+
if (data.selectedLanguages.indexOf(key) === -1) {
|
|
895
|
+
delete errorData[index][key];
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
// for (let count = 0; count < this.state.tabCount; count += 1) {
|
|
901
|
+
// const index = count + 1;
|
|
902
|
+
// // const content = this.state.formData[count][`template-content${index > 1 ? index : ''}`];
|
|
903
|
+
// // const tagValidationResponse = this.validateTags(content, tags, injectedTags);
|
|
904
|
+
// // console.log('tag valid response', tagValidationResponse);
|
|
905
|
+
// // if (tagValidationResponse.valid) {
|
|
906
|
+
// // errorData[count][`template-content${index > 1 ? index : ''}`] = false;
|
|
907
|
+
// // } else {
|
|
908
|
+
// // errorData[count][`template-content${index > 1 ? index : ''}`] = true;
|
|
909
|
+
// // isValid = false;
|
|
910
|
+
// // }
|
|
911
|
+
// }
|
|
912
|
+
// if (type.toLowerCase() === 'embedded' && (currentModule.toLowerCase() === 'loyalty' || currentModule.toLowerCase() === 'dvs' || currentModule.toLowerCase() === 'timeline')) {
|
|
913
|
+
// if (this.state.formData['template-subject'] && this.state.formData['template-subject'].trim() === '') {
|
|
914
|
+
// errorData['template-subject'] = true;
|
|
915
|
+
// isValid = false;
|
|
916
|
+
// }
|
|
917
|
+
// }
|
|
918
|
+
// if(type !== 'embedded' && (!this.state.formData['template-name'] || this.state.formData['template-name'] === '')) {
|
|
919
|
+
// errorData['template-name'] = true;
|
|
920
|
+
// isValid = false;
|
|
921
|
+
// } else {
|
|
922
|
+
// errorData['template-name'] = false;
|
|
923
|
+
// }
|
|
924
|
+
}
|
|
925
|
+
this.setState({isFormValid : isValid, errorData});
|
|
926
|
+
console.log('final validity', this.state.formData, this.state, isValid);
|
|
927
|
+
this.props.onFormValidityChange(isValid);
|
|
928
|
+
return isValid;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
indexOfEnd(targetString, string) {
|
|
932
|
+
var io = targetString.indexOf(string);
|
|
933
|
+
return io == -1 ? -1 : io + string.length;
|
|
934
|
+
}
|
|
935
|
+
continueSaveForm = (id) => {
|
|
936
|
+
|
|
937
|
+
};
|
|
938
|
+
saveForm(saveForm) {
|
|
939
|
+
console.log('Is Form Valid ', this.state.isFormValid, saveForm);
|
|
940
|
+
if (this.props.isNewVersionFlow && !saveForm) {
|
|
941
|
+
this.props.getValidationData();
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
if (this.state.isFormValid) {
|
|
945
|
+
this.props.onSubmit(this.state.formData);
|
|
946
|
+
} else {
|
|
947
|
+
this.setState({checkValidation: true});
|
|
948
|
+
this.validateForm(null, null, true);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
transformInjectedTags(tags) {
|
|
953
|
+
_.forEach(tags, (tag) => {
|
|
954
|
+
const temp = tag;
|
|
955
|
+
let subKey = '';
|
|
956
|
+
Object.keys(tag).map( (k) => {
|
|
957
|
+
if (k.indexOf("subtags") !== -1) {
|
|
958
|
+
subKey = k;
|
|
959
|
+
}
|
|
960
|
+
return true;
|
|
961
|
+
});
|
|
962
|
+
if (subKey !== '') {
|
|
963
|
+
temp['tag-header'] = true;
|
|
964
|
+
if (subKey !== 'subtags') {
|
|
965
|
+
temp.subtags = _.cloneDeep(temp[subKey]);
|
|
966
|
+
delete temp[subKey];
|
|
967
|
+
}
|
|
968
|
+
temp.subtags = this.transformInjectedTags(temp.subtags);
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
return tags;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
checkIfSupportedTag(checkingTag, injectedTags) {
|
|
975
|
+
let result = false;
|
|
976
|
+
_.forEach(injectedTags, (tag, key) => {
|
|
977
|
+
if (tag.subtags) {
|
|
978
|
+
if (this.checkIfSupportedTag(checkingTag, tag.subtags)) {
|
|
979
|
+
result = true;
|
|
980
|
+
}
|
|
981
|
+
} else if (checkingTag === key) {
|
|
982
|
+
result = true;
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
console.log('injected tags support result', checkingTag, injectedTags, result);
|
|
986
|
+
return result;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
skipTags(tag) {
|
|
990
|
+
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]"];
|
|
991
|
+
|
|
992
|
+
//const regexGroups = [];
|
|
993
|
+
let skipped = false;
|
|
994
|
+
_.forEach(regexGroups, (group) => {
|
|
995
|
+
//const groupRegex = /dynamic_expiry_date_after_\(\d+\)_days.FORMAT_\d/g;
|
|
996
|
+
const groupRegex = new RegExp(group, "g");
|
|
997
|
+
let match = groupRegex.exec(tag);
|
|
998
|
+
if (match !== null ) {
|
|
999
|
+
skipped = true;
|
|
1000
|
+
return true;
|
|
1001
|
+
}
|
|
1002
|
+
return true;
|
|
1003
|
+
});
|
|
1004
|
+
return skipped;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
validateTags(content, tagsParam, injectedTagsParams) {
|
|
1008
|
+
const type = (this.props.location && this.props.location.query.type) ? this.props.location.query.type : 'full';
|
|
1009
|
+
let currentModule = this.props.location.query.module ? this.props.location.query.module : 'default';
|
|
1010
|
+
if (this.props.tagModule) {
|
|
1011
|
+
currentModule = this.props.tagModule;
|
|
1012
|
+
}
|
|
1013
|
+
const tags = tagsParam ? tagsParam : this.props.tags;
|
|
1014
|
+
const injectedTags = this.transformInjectedTags(injectedTagsParams ? injectedTagsParams : this.props.injectedTags);
|
|
1015
|
+
const excludedTags = ['user_id_b64', 'outbox_id_b64'];
|
|
1016
|
+
console.log('form builder injected tags', injectedTags);
|
|
1017
|
+
console.log('validating tags', content, tags, type, module);
|
|
1018
|
+
const response = {};
|
|
1019
|
+
response.valid = true;
|
|
1020
|
+
response.missingTags = [];
|
|
1021
|
+
response.unsupportedTags = [];
|
|
1022
|
+
_.forEach(tags, (tag) => {
|
|
1023
|
+
_.forEach(tag.definition.supportedModules, (module) => {
|
|
1024
|
+
if (module.mandatory && (currentModule === module.context)) {
|
|
1025
|
+
if (content.indexOf(`{{${tag.definition.value}}}`) === -1) {
|
|
1026
|
+
response.valid = false;
|
|
1027
|
+
response.missingTags.push(tag.definition.value);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
});
|
|
1032
|
+
const regex = /{{[(A-Z\w\(\)@!#$%^&*~.,/\\]+}}/g;
|
|
1033
|
+
let match = regex.exec(content);
|
|
1034
|
+
while (match !== null) {
|
|
1035
|
+
const tagValue = match[0].substring(this.indexOfEnd(match[0], '{{'), match[0].indexOf('}}'));
|
|
1036
|
+
match = regex.exec(content);
|
|
1037
|
+
let ifSupported = false;
|
|
1038
|
+
_.forEach(tags, (tag) => {
|
|
1039
|
+
if (tag.definition.value === tagValue) {
|
|
1040
|
+
ifSupported = true;
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
const ifSkipped = this.skipTags(tagValue);
|
|
1044
|
+
if (ifSkipped) {
|
|
1045
|
+
ifSupported = true;
|
|
1046
|
+
let isUnsubscribeSkipped = tagValue.indexOf("unsubscribe") != -1 ;
|
|
1047
|
+
if (isUnsubscribeSkipped) {
|
|
1048
|
+
const missingTagIndex = response.missingTags.indexOf("unsubscribe");
|
|
1049
|
+
if(missingTagIndex != -1) { //skip regex tags for mandatory tags also
|
|
1050
|
+
response.missingTags.splice(missingTagIndex, 1);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
ifSupported = ifSupported || this.checkIfSupportedTag(tagValue, injectedTags);
|
|
1055
|
+
if (!ifSupported) {
|
|
1056
|
+
response.unsupportedTags.push(tagValue);
|
|
1057
|
+
response.valid = false;
|
|
1058
|
+
}
|
|
1059
|
+
if (response.unsupportedTags.length == 0 && response.missingTags.length == 0 ) {
|
|
1060
|
+
response.valid = true;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return response;
|
|
1064
|
+
}
|
|
1065
|
+
/* eslint-enable */
|
|
1066
|
+
initializeParentSection(section, formDataObj, isContainer, index, ifError) {
|
|
1067
|
+
let formData = formDataObj;
|
|
1068
|
+
_.forEach(section.childSections, (childSection) => {
|
|
1069
|
+
if (childSection.type === 'col-label') {
|
|
1070
|
+
formData = this.initializeColLabelSection(childSection, formData, isContainer, index, ifError);
|
|
1071
|
+
} else if (childSection.type === 'multicols') {
|
|
1072
|
+
formData = this.initializeMultiColSection(childSection, formData, isContainer, index, ifError);
|
|
1073
|
+
} else {
|
|
1074
|
+
formData = this.initializeParentSection(childSection, formData, isContainer, index, ifError);
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
return formData;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
initializeEditErrorData(formData, tabCount) {
|
|
1081
|
+
const errorData = {};
|
|
1082
|
+
for (let idx = 0; idx < tabCount; idx += 1 ) {
|
|
1083
|
+
_.forEach(formData[0], (val, key) => {
|
|
1084
|
+
if (!errorData[idx]) {
|
|
1085
|
+
errorData[idx] = {};
|
|
1086
|
+
}
|
|
1087
|
+
if (key === 'tabKey' || key === 'base' || key === 'selectedLanguages') {
|
|
1088
|
+
return true;
|
|
1089
|
+
}
|
|
1090
|
+
if (this.props.isNewVersionFlow && formData[0].selectedLanguages.indexOf(key) > -1) {
|
|
1091
|
+
_.forEach(formData[0].selectedLanguages, (lang) => {
|
|
1092
|
+
if (errorData[idx] === undefined) {
|
|
1093
|
+
errorData[idx] = {};
|
|
1094
|
+
}
|
|
1095
|
+
if (errorData[idx][lang] === undefined) {
|
|
1096
|
+
errorData[idx][lang] = {};
|
|
1097
|
+
}
|
|
1098
|
+
errorData[idx][lang]['template-content'] = false;
|
|
1099
|
+
});
|
|
1100
|
+
} else {
|
|
1101
|
+
errorData[idx][key] = false;
|
|
1102
|
+
}
|
|
1103
|
+
return true;
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
this.setState({errorData});
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
initializeMultiColSection(section, formDataObj, isContainer, index, ifError, paneIndex) {
|
|
1110
|
+
console.log('initializeMultiColSection', section, formDataObj, isContainer, index, ifError, paneIndex);
|
|
1111
|
+
const formData = _.cloneDeep(formDataObj);
|
|
1112
|
+
const newFormData = {};
|
|
1113
|
+
newFormData[index] = {};
|
|
1114
|
+
_.forEach(section.inputFields, (inputField) => {
|
|
1115
|
+
console.log('Input field ', inputField);
|
|
1116
|
+
_.forEach(inputField.cols, (col) => {
|
|
1117
|
+
console.log('Multi col init ', col, formData[index], index);
|
|
1118
|
+
if (isContainer && !formData[index]) {
|
|
1119
|
+
formData[index] = {};
|
|
1120
|
+
}
|
|
1121
|
+
if (isContainer && this.props.isNewVersionFlow) {
|
|
1122
|
+
// if (formData[index] && formData[index].selectedLanguages && formData[index].selectedLanguages.length > 0) {
|
|
1123
|
+
// for (let i = 0; i < formData[index].selectedLanguages.length; i += 1 ) {
|
|
1124
|
+
// formData[index][formData[index].selectedLanguages[i]] = {};
|
|
1125
|
+
// }
|
|
1126
|
+
// } else {
|
|
1127
|
+
// formData[index][`${this.props.baseLanguage ? this.props.baseLanguage : 'en'}`] = {};
|
|
1128
|
+
// }
|
|
1129
|
+
_.forEach(this.props.supportedLanguages, (language) => {
|
|
1130
|
+
if (!formData[index][language.iso_code] && this.props.baseLanguage === language.iso_code) {
|
|
1131
|
+
formData[index][language.iso_code] = {};
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
// if (!ifError && (col.id.indexOf('template-label-') === -1 && col.id.indexOf('tagList-') === -1)) {
|
|
1136
|
+
// this.formElements.push(col.id);
|
|
1137
|
+
// }
|
|
1138
|
+
if (!col.onlyDisplay && !ifError) {
|
|
1139
|
+
if (col.id.indexOf('tagList-') === -1) {
|
|
1140
|
+
this.formElements.push(col.id);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
if (!this.props.isNewVersionFlow) {
|
|
1144
|
+
if (isContainer && formData[index][col.id] === undefined) {
|
|
1145
|
+
if (ifError) {
|
|
1146
|
+
formData[index][col.id] = false;
|
|
1147
|
+
} else if (isContainer && formData[index][col.id] === undefined && col.value) {
|
|
1148
|
+
formData[index][col.id] = col.value;
|
|
1149
|
+
} else {
|
|
1150
|
+
formData[index][col.id] = '';
|
|
1151
|
+
}
|
|
1152
|
+
} else if (!isContainer && ifError && formData[col.id] === undefined) {
|
|
1153
|
+
formData[col.id] = false;
|
|
1154
|
+
} else if (!isContainer && !ifError && formData[col.id] === undefined) {
|
|
1155
|
+
formData[col.id] = '';
|
|
1156
|
+
}
|
|
1157
|
+
} else {
|
|
1158
|
+
console.log('new flow ', col, this.props.supportedLanguages, this.props.baseLanguage, index);
|
|
1159
|
+
if (!(col.id.indexOf('template-content') > -1 && col.id !== 'template-content')) {
|
|
1160
|
+
if (isContainer && formData[index] && formData[index][this.props.baseLanguage] && formData[index][this.props.baseLanguage][col.id] === undefined) {
|
|
1161
|
+
if (ifError) {
|
|
1162
|
+
formData[index][this.props.baseLanguage][col.id] = false;
|
|
1163
|
+
} else if (isContainer && formData[index][this.props.baseLanguage][col.id] === undefined && col.value) {
|
|
1164
|
+
formData[index][this.props.baseLanguage][col.id] = col.value;
|
|
1165
|
+
} else {
|
|
1166
|
+
formData[index][this.props.baseLanguage][col.id] = '';
|
|
1167
|
+
}
|
|
1168
|
+
} else if (!isContainer && ifError && formData[col.id] === undefined) {
|
|
1169
|
+
formData[col.id] = false;
|
|
1170
|
+
} else if (!isContainer && !ifError && formData[col.id] === undefined) {
|
|
1171
|
+
formData[col.id] = '';
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
console.log('New Form Data ', formData);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
if (col.type === 'checkbox') {
|
|
1178
|
+
if (isContainer) {
|
|
1179
|
+
formData[index][col.id] = false;
|
|
1180
|
+
} else if (!isContainer && formData[col.id] === undefined) {
|
|
1181
|
+
formData[col.id] = false;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
});
|
|
1185
|
+
});
|
|
1186
|
+
return formData;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
initializeColLabelSection(section, formDataObj, isContainer, index, ifError) {
|
|
1190
|
+
const formData = formDataObj;
|
|
1191
|
+
_.forEach(section.inputFields, (inputField) => {
|
|
1192
|
+
if (isContainer && !formData[index]) {
|
|
1193
|
+
formData[index] = {};
|
|
1194
|
+
}
|
|
1195
|
+
if (!ifError && (inputField.id.indexOf('template-label-') === -1 && inputField.id.indexOf('tagList-') === -1)) {
|
|
1196
|
+
this.formElements.push(inputField.id);
|
|
1197
|
+
}
|
|
1198
|
+
if (!inputField.onlyDisplay) {
|
|
1199
|
+
if (isContainer && !this.props.isNewVersionFlow && formData[index][inputField.id] === undefined) {
|
|
1200
|
+
if (ifError) {
|
|
1201
|
+
formData[index][inputField.id] = false;
|
|
1202
|
+
} else {
|
|
1203
|
+
formData[index][inputField.id] = '';
|
|
1204
|
+
}
|
|
1205
|
+
} else if (isContainer && this.props.isNewVersionFlow && formData[index][this.props.baseLanguage][inputField.id] === undefined) {
|
|
1206
|
+
if (ifError) {
|
|
1207
|
+
formData[index][this.props.baseLanguage][inputField.id] = false;
|
|
1208
|
+
} else {
|
|
1209
|
+
formData[index][this.props.baseLanguage][inputField.id] = '';
|
|
1210
|
+
}
|
|
1211
|
+
} else if (!isContainer && ifError && this.state.formData[inputField.id] === undefined) {
|
|
1212
|
+
formData[inputField.id] = false;
|
|
1213
|
+
} else if (!isContainer && !ifError && this.state.formData[inputField.id] === undefined) {
|
|
1214
|
+
formData[inputField.id] = '';
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
if (inputField.type === 'checkbox') {
|
|
1218
|
+
if (isContainer) {
|
|
1219
|
+
formData[index][inputField.id] = false;
|
|
1220
|
+
} else {
|
|
1221
|
+
formData[inputField.id] = false;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
return formData;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
initializeStandAloneSections(schema, formDataObj, ifError) {
|
|
1229
|
+
let formData = _.cloneDeep(formDataObj);
|
|
1230
|
+
if (schema.standalone) {
|
|
1231
|
+
_.forEach(schema.standalone.sections, (section) => {
|
|
1232
|
+
if (section) {
|
|
1233
|
+
if (section.type === 'multicols') {
|
|
1234
|
+
formData = this.initializeMultiColSection(section, formData, false, -1, ifError);
|
|
1235
|
+
} else if (section.type === 'col-label') {
|
|
1236
|
+
formData = this.initializeColLabelSection(section, formData, false, -1, ifError);
|
|
1237
|
+
} else if (section.type === 'parent') {
|
|
1238
|
+
formData = this.initializeParentSection(section, formData, false, -1, ifError);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
return formData;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
initializeContainers(schema, formDataObj, ifError) {
|
|
1247
|
+
let formData = _.cloneDeep(formDataObj);
|
|
1248
|
+
if (this.props.isNewVersionFlow) {
|
|
1249
|
+
_.forEach(schema.containers, (val, index) => {
|
|
1250
|
+
if (val.type === 'tabs') {
|
|
1251
|
+
console.log('Initial COntainer ', val);
|
|
1252
|
+
this.setState({usingTabContainer: true});
|
|
1253
|
+
_.forEach(val.panes, (pane, paneIndex) => {
|
|
1254
|
+
_.forEach(pane.sections, (section) => {
|
|
1255
|
+
if (section.type === 'multicols') {
|
|
1256
|
+
console.log('initializeContainers', section, index);
|
|
1257
|
+
formData = this.initializeMultiColSection(section, formData, true, index, ifError, paneIndex);
|
|
1258
|
+
} else if (section.type === 'col-label') {
|
|
1259
|
+
formData = this.initializeColLabelSection(section, formData, true, index, ifError);
|
|
1260
|
+
} else if (section.type === 'parent') {
|
|
1261
|
+
formData = this.initializeParentSection(section, formData, true, index, ifError);
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
});
|
|
1265
|
+
if (ifError) {
|
|
1266
|
+
formData[val.id] = false;
|
|
1267
|
+
}
|
|
1268
|
+
formData[val.id] = '';
|
|
1269
|
+
}
|
|
1270
|
+
if (val.type === 'checkbox') {
|
|
1271
|
+
formData[val.id] = false;
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
} else {
|
|
1275
|
+
_.forEach(schema.containers, (val) => {
|
|
1276
|
+
if (val.type === 'tabs') {
|
|
1277
|
+
console.log('Initial COntainer ', val);
|
|
1278
|
+
this.setState({usingTabContainer: true});
|
|
1279
|
+
_.forEach(val.panes, (pane, index) => {
|
|
1280
|
+
_.forEach(pane.sections, (section) => {
|
|
1281
|
+
if (section.type === 'multicols') {
|
|
1282
|
+
console.log('initializeContainers', section, index);
|
|
1283
|
+
formData = this.initializeMultiColSection(section, formData, true, index, ifError);
|
|
1284
|
+
} else if (section.type === 'col-label') {
|
|
1285
|
+
formData = this.initializeColLabelSection(section, formData, true, index, ifError);
|
|
1286
|
+
} else if (section.type === 'parent') {
|
|
1287
|
+
formData = this.initializeParentSection(section, formData, true, index, ifError);
|
|
1288
|
+
}
|
|
1289
|
+
});
|
|
1290
|
+
});
|
|
1291
|
+
if (ifError) {
|
|
1292
|
+
formData[val.id] = false;
|
|
1293
|
+
}
|
|
1294
|
+
formData[val.id] = '';
|
|
1295
|
+
}
|
|
1296
|
+
if (val.type === 'checkbox') {
|
|
1297
|
+
formData[val.id] = false;
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
return formData;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
initialiseForm(schema, makeFormEmpty, resetTabKeys) {
|
|
1305
|
+
console.log('outgoing init form xxx', schema, makeFormEmpty, this.state.formData, resetTabKeys);
|
|
1306
|
+
console.log('init form xxx', schema, makeFormEmpty, this.state.formData, resetTabKeys);
|
|
1307
|
+
let formData = makeFormEmpty ? {} : _.cloneDeep(this.state.formData);
|
|
1308
|
+
let errorData = {};
|
|
1309
|
+
this.formElements = [];
|
|
1310
|
+
if (_.isEmpty(schema)) {
|
|
1311
|
+
return;
|
|
1312
|
+
}
|
|
1313
|
+
errorData = this.initializeStandAloneSections(schema, errorData, true);
|
|
1314
|
+
formData = this.initializeStandAloneSections(schema, formData);
|
|
1315
|
+
formData = this.initializeContainers(schema, formData);
|
|
1316
|
+
errorData = this.initializeContainers(schema, errorData, true);
|
|
1317
|
+
|
|
1318
|
+
console.log('After Init ', errorData, formData);
|
|
1319
|
+
if (!this.props.isEdit) {
|
|
1320
|
+
if (!formData[0]) {
|
|
1321
|
+
formData[0] = {};
|
|
1322
|
+
}
|
|
1323
|
+
if (!errorData[0]) {
|
|
1324
|
+
errorData[0] = {};
|
|
1325
|
+
}
|
|
1326
|
+
formData[0].base = true;
|
|
1327
|
+
formData[0].tabKey = formData[0].tabKey ? formData[0].tabKey : _.uniqueId();
|
|
1328
|
+
errorData.base = errorData[0];
|
|
1329
|
+
formData.base = formData[0];
|
|
1330
|
+
if (this.state.currentTab === 1) {
|
|
1331
|
+
this.setState({tabKey: formData.base.tabKey});
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
const tempFormData = _.cloneDeep(formData);
|
|
1335
|
+
if (!this.props.isNewVersionFlow) {
|
|
1336
|
+
_.forEach(formData, (element, key) => {
|
|
1337
|
+
if (typeof element !== 'object' && this.formElements.indexOf(key) === -1) {
|
|
1338
|
+
delete tempFormData[key];
|
|
1339
|
+
} else if (typeof element === "object") {
|
|
1340
|
+
_.forEach(element, (innerElement, innerKey) => {
|
|
1341
|
+
if (innerKey !== "tabKey" && innerKey !== "base" && innerKey !== 'name' && innerKey !== 'imagePreview' && this.formElements.indexOf(innerKey) === -1) {
|
|
1342
|
+
delete tempFormData[key][innerKey];
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
formData = _.cloneDeep(tempFormData);
|
|
1349
|
+
this.setState({formData, errorData}, () => {
|
|
1350
|
+
this.validateForm();
|
|
1351
|
+
if (this.props.isSchemaChanged || resetTabKeys) {
|
|
1352
|
+
this.resetTabKeys(formData, this.props.tabCount, true);
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
cloneVersionData(ifError) {
|
|
1358
|
+
console.log('cloning data', this.state.formData, this.state.tabCount, ifError);
|
|
1359
|
+
if (this.state.tabCount === 0) {
|
|
1360
|
+
this.initialiseForm(this.props.schema, true);
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
let formData = {};
|
|
1364
|
+
if (ifError) {
|
|
1365
|
+
formData = Object.assign({}, this.state.errorData);
|
|
1366
|
+
} else {
|
|
1367
|
+
formData = Object.assign({}, this.state.formData);
|
|
1368
|
+
}
|
|
1369
|
+
let newTabIndex = 0;
|
|
1370
|
+
if (ifError) {
|
|
1371
|
+
newTabIndex = this.state.tabCount - 1;
|
|
1372
|
+
} else {
|
|
1373
|
+
newTabIndex = this.state.tabCount;
|
|
1374
|
+
}
|
|
1375
|
+
formData[newTabIndex] = {};
|
|
1376
|
+
console.log('Step 1', formData);
|
|
1377
|
+
const newTabCount = newTabIndex + 1;
|
|
1378
|
+
_.forEach(formData[0], (val, key) => {
|
|
1379
|
+
console.log('Step 1.1', val, key);
|
|
1380
|
+
if (key === 'base') {
|
|
1381
|
+
return true;
|
|
1382
|
+
}
|
|
1383
|
+
if (key === 'tabKey') {
|
|
1384
|
+
return true;
|
|
1385
|
+
}
|
|
1386
|
+
if (typeof val === 'string') {
|
|
1387
|
+
if (ifError) {
|
|
1388
|
+
formData[newTabIndex][`${key}${newTabCount}`] = false;
|
|
1389
|
+
} else {
|
|
1390
|
+
console.log('IsNewFlow ', this.props.isNewVersionFlow);
|
|
1391
|
+
if (this.props.isNewVersionFlow) {
|
|
1392
|
+
if (key.indexOf('activeTab') > -1) {
|
|
1393
|
+
formData[newTabIndex][`${key}`] = this.props.baseLanguage;
|
|
1394
|
+
} else {
|
|
1395
|
+
formData[newTabIndex][`${key}${newTabCount}`] = '';
|
|
1396
|
+
}
|
|
1397
|
+
} else {
|
|
1398
|
+
formData[newTabIndex][`${key}${newTabCount}`] = '';
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
} else if (typeof val === 'boolean') {
|
|
1402
|
+
formData[newTabIndex][`${key}${newTabCount}`] = false;
|
|
1403
|
+
} else if (typeof val === 'object') {
|
|
1404
|
+
if (this.props.isNewVersionFlow) {
|
|
1405
|
+
if (key.indexOf('selectedLanguages') > -1) {
|
|
1406
|
+
formData[newTabIndex][key] = [this.props.baseLanguage];
|
|
1407
|
+
} else {
|
|
1408
|
+
console.log('log line ', val);
|
|
1409
|
+
if (key === this.props.baseLanguage) {
|
|
1410
|
+
formData[newTabIndex][key] = {};
|
|
1411
|
+
_.forEach(val, (subVal, index) => {
|
|
1412
|
+
console.log('Subvalue ', subVal, index);
|
|
1413
|
+
// if (subVal === 'is_drag_drop' || subVal === 'lang_id' || subVal === 'iso_code' === 'language') {
|
|
1414
|
+
// console.log('SubVal 1234567890- ', formData[0][this.props.baseLanguage]);
|
|
1415
|
+
// formData[newTabIndex][key][index] = formData[0][this.props.baseLanguage][subVal];
|
|
1416
|
+
// } else {
|
|
1417
|
+
if (index === 'tabKey') {
|
|
1418
|
+
formData[newTabIndex][key][index] = _.uniqueId();
|
|
1419
|
+
} else if (index === 'template-content') {
|
|
1420
|
+
formData[newTabIndex][key][index] = "";
|
|
1421
|
+
} else {
|
|
1422
|
+
formData[newTabIndex][key][index] = _.cloneDeep(formData[0][key][index]);
|
|
1423
|
+
}
|
|
1424
|
+
// }
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
} else {
|
|
1429
|
+
formData[newTabIndex][key] = {};
|
|
1430
|
+
_.forEach(val, (subVal, index) => {
|
|
1431
|
+
console.log('Subvalue ', subVal, index);
|
|
1432
|
+
formData[newTabIndex][key][index] = '';
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
return true;
|
|
1437
|
+
});
|
|
1438
|
+
let id = (this.props.isNewVersionFlow && formData[newTabIndex][this.props.baseLanguage].tabKey) ? formData[newTabIndex][this.props.baseLanguage].tabKey : _.uniqueId();
|
|
1439
|
+
console.log('Step 2', formData);
|
|
1440
|
+
if (!ifError) {
|
|
1441
|
+
let validId = false;
|
|
1442
|
+
while (!validId) {
|
|
1443
|
+
validId = true;
|
|
1444
|
+
for (let idx = 0; idx < this.state.tabCount; idx += 1) {
|
|
1445
|
+
if (id === formData[idx].tabKey) {
|
|
1446
|
+
validId = false;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
if (validId) {
|
|
1450
|
+
break;
|
|
1451
|
+
}
|
|
1452
|
+
id = _.uniqueId();
|
|
1453
|
+
}
|
|
1454
|
+
formData[newTabIndex].tabKey = id;
|
|
1455
|
+
}
|
|
1456
|
+
// if (!this.props.isEdit) {
|
|
1457
|
+
if (ifError) {
|
|
1458
|
+
console.log('If error ', ifError);
|
|
1459
|
+
this.setState({errorData: formData});
|
|
1460
|
+
} else {
|
|
1461
|
+
console.log('formData after cloning', formData, newTabIndex + 1);
|
|
1462
|
+
this.props.onChange(formData, newTabCount, newTabIndex + 1);
|
|
1463
|
+
console.log('After OnChange');
|
|
1464
|
+
this.setState({tabCount: newTabCount, formData, currentTab: newTabIndex + 1, tabKey: id}, () => {
|
|
1465
|
+
this.cloneVersionData(true);
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
changeVersionName(data) {
|
|
1471
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
1472
|
+
if (formData[this.state.currentTab - 1]) {
|
|
1473
|
+
formData[this.state.currentTab - 1].name = data;
|
|
1474
|
+
this.setState({formData});
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
markFinalTabVersion() {
|
|
1479
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
1480
|
+
if (this.state.usingTabContainer) {
|
|
1481
|
+
console.log('Tab Count ', this.state.tabCount);
|
|
1482
|
+
for (let count = 0; count < this.state.tabCount; count += 1) {
|
|
1483
|
+
if (parseInt(this.state.currentTab - 1, 10) !== count) {
|
|
1484
|
+
formData[count].base = false;
|
|
1485
|
+
} else {
|
|
1486
|
+
formData[count].base = true;
|
|
1487
|
+
formData.base = formData[count];
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
this.setState({formData});
|
|
1491
|
+
|
|
1492
|
+
this.props.onChange(formData, this.state.tabCount);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
resetState(isEdit, usingTabContainer) {
|
|
1497
|
+
this.setState({
|
|
1498
|
+
formData: {},
|
|
1499
|
+
currentTab: 1,
|
|
1500
|
+
usingTabContainer: usingTabContainer || false,
|
|
1501
|
+
tabCount: 1,
|
|
1502
|
+
errorData: {},
|
|
1503
|
+
tabKey: '',
|
|
1504
|
+
}, () => {
|
|
1505
|
+
if (!isEdit) {
|
|
1506
|
+
console.log('init from reset');
|
|
1507
|
+
this.initialiseForm(this.props.schema, true);
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
duplicateVersion(ifError, currentTab) {
|
|
1513
|
+
let formData = {};
|
|
1514
|
+
let tabCount = 0;
|
|
1515
|
+
if (ifError) {
|
|
1516
|
+
formData = _.cloneDeep(this.state.errorData);
|
|
1517
|
+
tabCount = this.state.tabCount - 1;
|
|
1518
|
+
} else {
|
|
1519
|
+
formData = _.cloneDeep(this.state.formData);
|
|
1520
|
+
tabCount = this.state.tabCount;
|
|
1521
|
+
}
|
|
1522
|
+
const newTabCount = tabCount + 1;
|
|
1523
|
+
_.forEach(formData[0], (val, key) => {
|
|
1524
|
+
if (!formData[tabCount]) {
|
|
1525
|
+
formData[tabCount] = {};
|
|
1526
|
+
}
|
|
1527
|
+
if (key === 'base') {
|
|
1528
|
+
formData[tabCount].base = false;
|
|
1529
|
+
return true;
|
|
1530
|
+
}
|
|
1531
|
+
if (key === 'tabKey') {
|
|
1532
|
+
let validId = false;
|
|
1533
|
+
let id = _.uniqueId();
|
|
1534
|
+
while (!validId) {
|
|
1535
|
+
validId = true;
|
|
1536
|
+
for (let idx = 0; idx < this.state.tabCount; idx += 1) {
|
|
1537
|
+
if (id === formData[idx].tabKey) {
|
|
1538
|
+
validId = false;
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
if (validId) {
|
|
1542
|
+
break;
|
|
1543
|
+
}
|
|
1544
|
+
id = _.uniqueId();
|
|
1545
|
+
}
|
|
1546
|
+
formData[tabCount].tabKey = id;
|
|
1547
|
+
return true;
|
|
1548
|
+
}
|
|
1549
|
+
const tempTab = ifError ? currentTab : this.state.currentTab;
|
|
1550
|
+
if (typeof val === 'string') {
|
|
1551
|
+
if (this.props.isNewVersionFlow) {
|
|
1552
|
+
formData[tabCount][`${key}`] = formData[tempTab - 1][`${key}`];
|
|
1553
|
+
} else {
|
|
1554
|
+
formData[tabCount][`${key}${newTabCount}`] = formData[tempTab - 1][`${key}${parseInt(tempTab, 10) === 1 ? '' : tempTab}`];
|
|
1555
|
+
}
|
|
1556
|
+
} else if (typeof val === 'boolean') {
|
|
1557
|
+
if (this.props.isNewVersionFlow) {
|
|
1558
|
+
formData[tabCount][`${key}`] = formData[tempTab - 1][`${key}`];
|
|
1559
|
+
} else {
|
|
1560
|
+
formData[tabCount][`${key}${newTabCount}`] = formData[tempTab - 1][`${key}${parseInt(tempTab, 10) === 1 ? '' : tempTab}`];
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
return true;
|
|
1564
|
+
});
|
|
1565
|
+
if (ifError) {
|
|
1566
|
+
this.setState({errorData: formData});
|
|
1567
|
+
} else {
|
|
1568
|
+
const tempTab = ifError ? currentTab : this.state.currentTab;
|
|
1569
|
+
const version = `Version ${this.state.currentTab}`;
|
|
1570
|
+
formData[tabCount].name = `Copy of ${formData[tempTab - 1].name ? formData[tempTab - 1].name : version}`;
|
|
1571
|
+
formData[tabCount].base = false;
|
|
1572
|
+
const initialTab = this.state.currentTab;
|
|
1573
|
+
this.setState({formData, tabCount: tabCount + 1, currentTab: tabCount + 1, tabKey: formData[tabCount].tabKey}, () => {
|
|
1574
|
+
this.duplicateVersion(true, initialTab);
|
|
1575
|
+
});
|
|
1576
|
+
|
|
1577
|
+
this.props.onChange(formData, tabCount + 1, tabCount + 1);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
deleteVersion(ifError, currentTab) {
|
|
1582
|
+
console.log('trying to delete version in form builder');
|
|
1583
|
+
if (!ifError && this.state.tabCount === 1) {
|
|
1584
|
+
console.log('cannot delete minimum 1 version');
|
|
1585
|
+
return;
|
|
1586
|
+
}
|
|
1587
|
+
let formData = {};
|
|
1588
|
+
let finalCurrentTab = 0;
|
|
1589
|
+
let tabCount = 0;
|
|
1590
|
+
if (ifError) {
|
|
1591
|
+
formData = _.cloneDeep(this.state.errorData);
|
|
1592
|
+
tabCount = this.state.tabCount + 1;
|
|
1593
|
+
finalCurrentTab = currentTab;
|
|
1594
|
+
} else {
|
|
1595
|
+
formData = _.cloneDeep(this.state.formData);
|
|
1596
|
+
tabCount = this.state.tabCount;
|
|
1597
|
+
finalCurrentTab = this.state.currentTab;
|
|
1598
|
+
}
|
|
1599
|
+
// delete formData[this.state.currentTab - 1];
|
|
1600
|
+
let finalActiveTabKey = '';
|
|
1601
|
+
if (tabCount > 1 && currentTab !== tabCount) {
|
|
1602
|
+
finalActiveTabKey = formData[currentTab].tabKey;
|
|
1603
|
+
}
|
|
1604
|
+
console.log('Tab Counts ', currentTab, tabCount);
|
|
1605
|
+
if (tabCount > 1 && currentTab === tabCount) {
|
|
1606
|
+
finalActiveTabKey = formData[currentTab - 2].tabKey;
|
|
1607
|
+
finalCurrentTab = currentTab - 1;
|
|
1608
|
+
}
|
|
1609
|
+
// if (this.state.tabCount > 1 && this.state.currentTab === 1) {
|
|
1610
|
+
// finalActiveTabKey = this.state.formData[1].tabKey;
|
|
1611
|
+
// }
|
|
1612
|
+
if (tabCount === 1) {
|
|
1613
|
+
finalActiveTabKey = '';
|
|
1614
|
+
}
|
|
1615
|
+
const initialFormData = _.cloneDeep(formData[0]);
|
|
1616
|
+
for (let count = currentTab - 1; count < tabCount - 1; count += 1) {
|
|
1617
|
+
delete formData[count];
|
|
1618
|
+
_.forEach(initialFormData, (val, key) => {
|
|
1619
|
+
if (!formData[count]) {
|
|
1620
|
+
formData[count] = {};
|
|
1621
|
+
}
|
|
1622
|
+
if (key === 'base') {
|
|
1623
|
+
formData[count].base = formData[count + 1].base ? formData[count + 1].base : false;
|
|
1624
|
+
return true;
|
|
1625
|
+
}
|
|
1626
|
+
if (key === 'tabKey') {
|
|
1627
|
+
formData[count].tabKey = formData[count + 1].tabKey;
|
|
1628
|
+
return true;
|
|
1629
|
+
}
|
|
1630
|
+
formData[count][`${key}${count === 0 ? '' : count + 1}`] = formData[count + 1][`${key}${count + 2}`];
|
|
1631
|
+
return true;
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
delete formData[tabCount - 1];
|
|
1635
|
+
if (ifError) {
|
|
1636
|
+
this.setState({errorData: formData});
|
|
1637
|
+
} else {
|
|
1638
|
+
const initialTab = currentTab;
|
|
1639
|
+
if (this.props.isNewVersionFlow) {
|
|
1640
|
+
formData['template-version-options'].splice(`${currentTab - 1}`, 1);
|
|
1641
|
+
formData['template-version'] = formData['template-version-options'][0].value;
|
|
1642
|
+
}
|
|
1643
|
+
this.setState({formData, tabCount: tabCount - 1, tabKey: finalActiveTabKey, currentTab: finalCurrentTab}, () => {
|
|
1644
|
+
this.deleteVersion(true, initialTab);
|
|
1645
|
+
});
|
|
1646
|
+
|
|
1647
|
+
this.props.onChange(formData, tabCount - 1);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
deleteLanguage = () => {
|
|
1652
|
+
if (this.state.formData[`${this.state.currentTab - 1}`].activeTab === this.props.baseLanguage) {
|
|
1653
|
+
console.log('Base Language');
|
|
1654
|
+
} else {
|
|
1655
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
1656
|
+
const currentTab = `${this.state.currentTab - 1}`;
|
|
1657
|
+
const currentLang = formData[`${this.state.currentTab - 1}`].activeTab;
|
|
1658
|
+
const deleteLanguageIndex = formData[currentTab].selectedLanguages.indexOf(currentLang);
|
|
1659
|
+
const baseLangTabKey = formData[currentTab][this.props.baseLanguage].tabKey;
|
|
1660
|
+
console.log('deleting language', currentTab, currentLang);
|
|
1661
|
+
delete formData[currentTab][currentLang];
|
|
1662
|
+
formData[currentTab].activeTab = this.props.baseLanguage;
|
|
1663
|
+
formData[currentTab].selectedLanguages.splice(deleteLanguageIndex, 1);
|
|
1664
|
+
formData[currentTab].tabKey = baseLangTabKey;
|
|
1665
|
+
if (formData[currentTab].base) {
|
|
1666
|
+
delete formData.base[currentLang];
|
|
1667
|
+
delete formData.base.selectedLanguages.splice(deleteLanguageIndex, 1);
|
|
1668
|
+
formData.base.tabKey = baseLangTabKey;
|
|
1669
|
+
formData.base.activeTab = this.props.baseLanguage;
|
|
1670
|
+
}
|
|
1671
|
+
console.log('After Deleting Form data ', formData);
|
|
1672
|
+
this.setState({formData, currentLangTab: this.props.baseLanguage, tabKey: baseLangTabKey}, () => {
|
|
1673
|
+
this.state.currentEvent.call(this.props.parent, formData, deleteLanguageIndex);
|
|
1674
|
+
this.setState({currentEvent: {}, currentEventData: {}});
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
renameVersion(currentTab) {
|
|
1680
|
+
console.log('form builder renaming', currentTab);
|
|
1681
|
+
document.getElementById(`tab-header${currentTab > 1 ? currentTab : ''}`).contentEditable = "true";
|
|
1682
|
+
document.getElementById(`tab-header${currentTab > 1 ? currentTab : ''}`).focus();
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
updateFormData(data, val, event) {
|
|
1686
|
+
console.log('updating data', data, val, event, this.props.addLanguageType);
|
|
1687
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
1688
|
+
console.log('oform data before updating', JSON.stringify(formData));
|
|
1689
|
+
const tabIndex = this.state.currentTab - 1;
|
|
1690
|
+
let currentTab = _.cloneDeep(this.state.currentTab);
|
|
1691
|
+
console.log('setting form data1', JSON.stringify(formData));
|
|
1692
|
+
if (this.state.usingTabContainer && !val.standalone) {
|
|
1693
|
+
const data1 = data;
|
|
1694
|
+
if (event === "addLanguage") {
|
|
1695
|
+
const addLanguageType = this.props.addLanguageType;
|
|
1696
|
+
if (addLanguageType === '') {
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1699
|
+
const currentLang = formData[tabIndex].activeTab;
|
|
1700
|
+
let baseTab = _.cloneDeep(formData[tabIndex][currentLang]);
|
|
1701
|
+
let id = _.uniqueId();
|
|
1702
|
+
let validId = false;
|
|
1703
|
+
switch (addLanguageType) {
|
|
1704
|
+
case "upload":
|
|
1705
|
+
baseTab = _.cloneDeep(formData[tabIndex][currentLang]);
|
|
1706
|
+
console.log('Add Language Event', JSON.stringify(formData), "\n", JSON.stringify(baseTab));
|
|
1707
|
+
baseTab.iso_code = data.iso_code;
|
|
1708
|
+
baseTab.lang_id = data.lang_id;
|
|
1709
|
+
baseTab.language = data.language;
|
|
1710
|
+
while (!validId) {
|
|
1711
|
+
validId = true;
|
|
1712
|
+
for (let idx = 0; idx < formData[tabIndex].selectedLanguages.length; idx += 1) {
|
|
1713
|
+
if (!formData[tabIndex]) {
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
console.log('comparing tab keys', id, formData, formData[tabIndex][formData[tabIndex].selectedLanguages[idx]].tabKey);
|
|
1717
|
+
if (id === formData[tabIndex][formData[tabIndex].selectedLanguages[idx]].tabKey) {
|
|
1718
|
+
validId = false;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
if (validId) {
|
|
1722
|
+
break;
|
|
1723
|
+
}
|
|
1724
|
+
id = _.uniqueId();
|
|
1725
|
+
}
|
|
1726
|
+
baseTab.tabKey = id;
|
|
1727
|
+
//formData[tabIndex].selectedLanguages.push(data.iso_code);
|
|
1728
|
+
formData[tabIndex][data.iso_code] = baseTab;
|
|
1729
|
+
console.log('Add Language Event After', formData);
|
|
1730
|
+
formData[tabIndex].activeTab = data.iso_code;
|
|
1731
|
+
formData[tabIndex].tabKey = baseTab.tabKey;
|
|
1732
|
+
break;
|
|
1733
|
+
case "copyPrimaryLanguage":
|
|
1734
|
+
case "useEditor":
|
|
1735
|
+
baseTab = _.cloneDeep(formData[tabIndex][this.props.baseLanguage]);
|
|
1736
|
+
console.log('Add Language Event', data, val, tabIndex, _.cloneDeep(baseTab));
|
|
1737
|
+
//baseTab['template-content'] = '';
|
|
1738
|
+
baseTab.iso_code = data.iso_code;
|
|
1739
|
+
baseTab.lang_id = data.lang_id;
|
|
1740
|
+
baseTab.language = data.language;
|
|
1741
|
+
validId = false;
|
|
1742
|
+
while (!validId) {
|
|
1743
|
+
validId = true;
|
|
1744
|
+
for (let idx = 0; idx < formData[tabIndex].selectedLanguages.length; idx += 1) {
|
|
1745
|
+
if (!formData[idx]) {
|
|
1746
|
+
continue;
|
|
1747
|
+
}
|
|
1748
|
+
if (id === formData[tabIndex][formData[tabIndex].selectedLanguages[idx]].tabKey) {
|
|
1749
|
+
validId = false;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
if (validId) {
|
|
1753
|
+
break;
|
|
1754
|
+
}
|
|
1755
|
+
id = _.uniqueId();
|
|
1756
|
+
}
|
|
1757
|
+
baseTab.tabKey = id;
|
|
1758
|
+
formData[tabIndex].selectedLanguages.push(data.iso_code);
|
|
1759
|
+
formData[tabIndex][data.iso_code] = baseTab;
|
|
1760
|
+
console.log('Add Language Event After', formData);
|
|
1761
|
+
formData[tabIndex].activeTab = data.iso_code;
|
|
1762
|
+
formData[tabIndex].tabKey = baseTab.tabKey;
|
|
1763
|
+
break;
|
|
1764
|
+
case '':
|
|
1765
|
+
return;
|
|
1766
|
+
default:
|
|
1767
|
+
break;
|
|
1768
|
+
}
|
|
1769
|
+
const that = this;
|
|
1770
|
+
setTimeout(() => {
|
|
1771
|
+
that.setState({tabKey: baseTab.tabKey});
|
|
1772
|
+
}, 0);
|
|
1773
|
+
}
|
|
1774
|
+
console.log('setting form data2', JSON.stringify(formData));
|
|
1775
|
+
if (!this.props.isNewVersionFlow) {
|
|
1776
|
+
formData[tabIndex][val.id] = data1;
|
|
1777
|
+
} else if (this.props.isNewVersionFlow && event !== "addLanguage" && event !== "onContentChange") {
|
|
1778
|
+
formData[tabIndex][this.props.baseLanguage][val.id] = data1;
|
|
1779
|
+
}
|
|
1780
|
+
console.log('setting form data3', JSON.stringify(formData));
|
|
1781
|
+
if (formData[tabIndex].base) {
|
|
1782
|
+
if (!this.props.isNewVersionFlow) {
|
|
1783
|
+
formData.base[val.id] = data1;
|
|
1784
|
+
} else {
|
|
1785
|
+
formData.base[data1.iso_code] = formData[tabIndex][data1.iso_code];
|
|
1786
|
+
formData.base.tabKey = formData[tabIndex].tabKey;
|
|
1787
|
+
formData.base.activeTab = formData[tabIndex].activeTab;
|
|
1788
|
+
formData.base.selectedLanguages = formData[tabIndex].selectedLanguages;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
console.log('setting form data4', JSON.stringify(formData));
|
|
1792
|
+
} else {
|
|
1793
|
+
formData[val.id] = data;
|
|
1794
|
+
}
|
|
1795
|
+
console.log('setting form data5', JSON.stringify(formData));
|
|
1796
|
+
if (this.props.isNewVersionFlow) {
|
|
1797
|
+
console.log('Version Select ', data, val, event);
|
|
1798
|
+
if (event === 'onSelect' && data === 'New Version') {
|
|
1799
|
+
this.callChildEvent(data, val, 'addVersion', event);
|
|
1800
|
+
} else if (event === 'onSelect' && data !== 'New Version') {
|
|
1801
|
+
console.log('Heloo how are you', data, val);
|
|
1802
|
+
console.log(_.findIndex(this.state.formData['template-version-options'], { key: data}));
|
|
1803
|
+
currentTab = _.findIndex(this.state.formData['template-version-options'], { key: data}) + 1;
|
|
1804
|
+
this.setState({currentTab, tabKey: formData[`${currentTab - 1}`].tabKey}, () => {
|
|
1805
|
+
console.log('Current tab of state ', this.state.currentTab);
|
|
1806
|
+
val.injectedEvents[event].call(this, this.state.formData['template-version-options'][currentTab - 1].key, formData, val);
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
console.log('setting form data6', JSON.stringify(formData));
|
|
1810
|
+
if (event === 'onContentChange') {
|
|
1811
|
+
console.log('onContentChange ', data, val, event, data.editor.getData());
|
|
1812
|
+
// formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab]['template-content'] = data.editor.getData();
|
|
1813
|
+
// if (formData[`${this.state.currentTab - 1}`].tabKey === formData.base.tabKey) {
|
|
1814
|
+
// formData.base[formData[`${this.state.currentTab - 1}`].activeTab][`template-content`] = data.editor.getData();
|
|
1815
|
+
//}
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
console.log('setting form data7', JSON.stringify(formData));
|
|
1819
|
+
console.log('setting form data', formData);
|
|
1820
|
+
this.setState({formData}, () => {
|
|
1821
|
+
this.validateForm();
|
|
1822
|
+
});
|
|
1823
|
+
if (event && val.injectedEvents[event]) {
|
|
1824
|
+
if (event === "onRowClick") {
|
|
1825
|
+
val.injectedEvents[event].call(this, data);
|
|
1826
|
+
} else if (this.props.isNewVersionFlow && event !== 'onSelect') {
|
|
1827
|
+
if (event === 'addLanguage') {
|
|
1828
|
+
val.injectedEvents[event].call(this, data, formData, val);
|
|
1829
|
+
this.setState({currentEventVal: {}, currentEvent: {}, currentEventData: {}});
|
|
1830
|
+
} else {
|
|
1831
|
+
val.injectedEvents[event].call(this, true, formData, val);
|
|
1832
|
+
}
|
|
1833
|
+
} else if (!this.props.isNewVersionFlow) {
|
|
1834
|
+
console.log('Event trigger ', event);
|
|
1835
|
+
val.injectedEvents[event].call(this, true, formData, val);
|
|
1836
|
+
}
|
|
1837
|
+
} else if (val.injectedEvents && val.injectedEvents.onChange) {
|
|
1838
|
+
val.injectedEvents.onChange.call(this, true, formData, val);
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
if (!((event === 'onSelect' && data === 'New Version') || event === 'onContentChange')) {
|
|
1842
|
+
console.log('Current tab ', this.state.currentLangTab, currentTab);
|
|
1843
|
+
this.props.onChange(formData, this.state.tabCount, currentTab);
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
hasClass(element, className) {
|
|
1849
|
+
return (` ${element.className} `).indexOf(` ${className} `) > -1;
|
|
1850
|
+
}
|
|
1851
|
+
allowAddSecondaryCta = (val) => {
|
|
1852
|
+
if (val.fieldsCount > 0) {
|
|
1853
|
+
const errorData = _.cloneDeep(this.state.errorData);
|
|
1854
|
+
_.forEach(Object.keys(errorData), (key) => {
|
|
1855
|
+
if (typeof errorData[key] !== "object") {
|
|
1856
|
+
errorData[key] = false;
|
|
1857
|
+
} else {
|
|
1858
|
+
_.forEach(Object.keys(errorData[key]), (innerKey) => {
|
|
1859
|
+
errorData[key][innerKey] = false;
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
if (this.state.formData[this.state.currentTab - 1][`secondary-cta-${val.fieldsCount - 1}-label`] === "") {
|
|
1864
|
+
errorData[this.state.currentTab - 1][`secondary-cta-${val.fieldsCount - 1}-label`] = true;
|
|
1865
|
+
this.setState({errorData, checkValidation: true, isFormValid: false});
|
|
1866
|
+
return false;
|
|
1867
|
+
}
|
|
1868
|
+
if (this.state.formData[this.state.currentTab - 1][`cta-deeplink-secondary-cta-${val.fieldsCount - 1}`] === "") {
|
|
1869
|
+
errorData[this.state.currentTab - 1][`cta-deeplink-secondary-cta-${val.fieldsCount - 1}`] = true;
|
|
1870
|
+
this.setState({errorData, checkValidation: true, isFormValid: false});
|
|
1871
|
+
return false;
|
|
1872
|
+
}
|
|
1873
|
+
if (this.state.formData[this.state.currentTab - 1][`cta-deeplink-secondary-cta-${val.fieldsCount - 1}-select`] === "") {
|
|
1874
|
+
errorData[this.state.currentTab - 1][`cta-deeplink-secondary-cta--${val.fieldsCount - 1}-select`] = true;
|
|
1875
|
+
this.setState({errorData, checkValidation: true, isFormValid: false});
|
|
1876
|
+
return false;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
return true;
|
|
1880
|
+
};
|
|
1881
|
+
callChildEvent(data, val, event, e) {
|
|
1882
|
+
console.log("lks 1", data);
|
|
1883
|
+
console.log("lks 2", val);
|
|
1884
|
+
console.log("lks 3", event);
|
|
1885
|
+
if (!event) {
|
|
1886
|
+
console.log('rogue event');
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
console.log('calling child', data, val, event, e);
|
|
1890
|
+
const tab = this.state.tabCount;
|
|
1891
|
+
// const parent = this._reactInternalInstance._currentElement._owner._instance;
|
|
1892
|
+
if (event === 'onTabChange') {
|
|
1893
|
+
const that = this;
|
|
1894
|
+
this.setState({tabKey: `${data}`});
|
|
1895
|
+
setTimeout(() => {
|
|
1896
|
+
if (this.props.isNewVersionFlow) {
|
|
1897
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
1898
|
+
let activeTabIndex = '1';
|
|
1899
|
+
const elems = document.getElementsByClassName("ant-tabs-tab");
|
|
1900
|
+
console.log('elems', elems);
|
|
1901
|
+
for (let i = 0; i < elems.length; i += 1) {
|
|
1902
|
+
console.log('elems 2', elems.item(i));
|
|
1903
|
+
if (elems.item(i).classList.contains("ant-tabs-tab-active")) {
|
|
1904
|
+
activeTabIndex = i + 1;
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
console.log('current Tab ', JSON.stringify(activeTabIndex), formData, this.state.currentTab, this.state.currentLangTab);
|
|
1908
|
+
formData[(this.state.currentTab - 1)].activeTab = formData[(this.state.currentTab - 1)].selectedLanguages[activeTabIndex - 1];
|
|
1909
|
+
formData[(this.state.currentTab - 1)].tabKey = `${data}`;
|
|
1910
|
+
if (formData[(this.state.currentTab - 1)].base) {
|
|
1911
|
+
formData.base.activeTab = formData[(this.state.currentTab - 1)].selectedLanguages[activeTabIndex - 1];
|
|
1912
|
+
formData.base.tabKey = `${data}`;
|
|
1913
|
+
}
|
|
1914
|
+
console.log('New Form Data ', formData);
|
|
1915
|
+
that.setState({formData, currentLangTab: formData[(this.state.currentTab - 1)].activeTab, tabKey: formData[(this.state.currentTab - 1)][formData[(this.state.currentTab - 1)].activeTab].tabKey}, () => {
|
|
1916
|
+
val.injectedEvents[event].call(that.props.parent, this.state.currentTab, formData);
|
|
1917
|
+
});
|
|
1918
|
+
} else {
|
|
1919
|
+
let activeTabIndex = '1';
|
|
1920
|
+
const elems = document.getElementsByClassName("ant-tabs-tab");
|
|
1921
|
+
console.log('elems', elems);
|
|
1922
|
+
for (let i = 0; i < elems.length; i += 1) {
|
|
1923
|
+
console.log('elems 2', elems.item(i));
|
|
1924
|
+
if (elems.item(i).classList.contains("ant-tabs-tab-active")) {
|
|
1925
|
+
activeTabIndex = i + 1;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
console.log('current Tab ', JSON.stringify(activeTabIndex));
|
|
1929
|
+
that.setState({currentTab: activeTabIndex});
|
|
1930
|
+
val.injectedEvents[event].call(that.props.parent, activeTabIndex);
|
|
1931
|
+
}
|
|
1932
|
+
}, 0);
|
|
1933
|
+
return;
|
|
1934
|
+
} else if (event === 'addVersion') {
|
|
1935
|
+
this.cloneVersionData();
|
|
1936
|
+
this.setState({ popoverVisible: false });
|
|
1937
|
+
const that = this;
|
|
1938
|
+
setTimeout(() => {
|
|
1939
|
+
console.log('Add version ', data, tab, that.state.formData);
|
|
1940
|
+
val.injectedEvents[event].call(that.props.parent, tab);
|
|
1941
|
+
}, 0);
|
|
1942
|
+
return;
|
|
1943
|
+
} else if (event === 'onTagSelect') {
|
|
1944
|
+
val.injectedEvents[event].call(this.props.parent, data, this.state.currentTab, val);
|
|
1945
|
+
return;
|
|
1946
|
+
} else if (event === 'markFinalVersion' || event === 'duplicateVersion' || event === 'deleteVersion' || event === 'renameVersion') {
|
|
1947
|
+
this.setState({ popoverVisible: false });
|
|
1948
|
+
if ((event !== 'deleteVersion' && !this.props.isNewVersionFlow) || ((event === 'deleteVersion') && this.props.schema.channel.toUpperCase() === 'EMAIL')) {
|
|
1949
|
+
val.injectedEvents[event].call(this.props.parent, data, this.state.currentTab);
|
|
1950
|
+
} else {
|
|
1951
|
+
this.setState({currentEvent: val.injectedEvents[event], currentEventData: data});
|
|
1952
|
+
}
|
|
1953
|
+
if (event === 'markFinalVersion') {
|
|
1954
|
+
this.markFinalTabVersion();
|
|
1955
|
+
if (this.props.isNewVersionFlow) {
|
|
1956
|
+
val.injectedEvents[event].call(this.props.parent, data, this.state.currentTab);
|
|
1957
|
+
}
|
|
1958
|
+
} else if (event === 'duplicateVersion') {
|
|
1959
|
+
if (this.props.schema.channel.toUpperCase() === 'EMAIL') {
|
|
1960
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
1961
|
+
formData[this.state.tabCount] = _.cloneDeep(formData[`${this.state.currentTab - 1}`]);
|
|
1962
|
+
_.forEach(formData[this.state.tabCount].selectedLanguages, (lang) => {
|
|
1963
|
+
const tmptabData = formData[this.state.tabCount][lang];
|
|
1964
|
+
_.forEach(formData[this.state.tabCount][lang], (tabData, index) => {
|
|
1965
|
+
console.log('tabData Data ', tabData, index);
|
|
1966
|
+
if (index === 'tabKey') {
|
|
1967
|
+
tmptabData.tabKey = _.uniqueId();
|
|
1968
|
+
}
|
|
1969
|
+
});
|
|
1970
|
+
});
|
|
1971
|
+
formData[this.state.tabCount].tabKey = formData[this.state.tabCount][formData[this.state.tabCount].activeTab].tabKey;
|
|
1972
|
+
console.log('Duplicatte Version ', formData);
|
|
1973
|
+
this.setState({formData, tabKey: formData[this.state.tabCount].tabKey}, () => {
|
|
1974
|
+
val.injectedEvents[event].call(this.props.parent, formData, this.state.currentTab);
|
|
1975
|
+
});
|
|
1976
|
+
} else {
|
|
1977
|
+
this.duplicateVersion();
|
|
1978
|
+
}
|
|
1979
|
+
} else if (event === 'deleteVersion') {
|
|
1980
|
+
if (this.props.schema.channel.toUpperCase() === 'EMAIL') {
|
|
1981
|
+
// this.deleteVersion(false, this.state.currentTab);
|
|
1982
|
+
this.setState({currentEvent: val.injectedEvents[event], currentEventData: data }, () => {
|
|
1983
|
+
this.props.setModalContent('delete-version');
|
|
1984
|
+
});
|
|
1985
|
+
} else {
|
|
1986
|
+
this.handleConfirmations();
|
|
1987
|
+
}
|
|
1988
|
+
} else if (event === 'renameVersion') {
|
|
1989
|
+
this.renameVersion(this.state.currentTab);
|
|
1990
|
+
}
|
|
1991
|
+
return;
|
|
1992
|
+
} else if (event === 'discardValues') {
|
|
1993
|
+
val.injectedEvents[event].call(this.props.parent, data);
|
|
1994
|
+
if (this.props.isEdit) {
|
|
1995
|
+
this.resetState(true, this.state.usingTabContainer);
|
|
1996
|
+
} else {
|
|
1997
|
+
this.resetState(false, this.state.usingTabContainer);
|
|
1998
|
+
}
|
|
1999
|
+
return;
|
|
2000
|
+
} else if (event === 'onChange') {
|
|
2001
|
+
if (val.id === 'tab-header') {
|
|
2002
|
+
val.injectedEvents[event].call(this.props.parent, data, this.state.currentTab);
|
|
2003
|
+
this.changeVersionName(data);
|
|
2004
|
+
}
|
|
2005
|
+
return;
|
|
2006
|
+
} else if (event === "addSecondaryCta") {
|
|
2007
|
+
if (!this.allowAddSecondaryCta(val)) {
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
} else if (event === "onContentChange") {
|
|
2011
|
+
val.injectedEvents[event].call(this.props.parent, data, val.id);
|
|
2012
|
+
return;
|
|
2013
|
+
} else if (event === 'deleteLanguage') {
|
|
2014
|
+
this.setState({currentEvent: val.injectedEvents[event], currentEventData: data }, () => {
|
|
2015
|
+
this.props.setModalContent('delete-language');
|
|
2016
|
+
});
|
|
2017
|
+
// const modalContent = {
|
|
2018
|
+
// title: "Alert",
|
|
2019
|
+
// body: "Do you really want to delete this language?",
|
|
2020
|
+
// type: 'confirm',
|
|
2021
|
+
// id: 'email-language-delete-modal',
|
|
2022
|
+
// };
|
|
2023
|
+
// debugger;
|
|
2024
|
+
// if (this.state.formData[`${this.state.currentTab - 1}`].activeTab === this.props.baseLanguage) {
|
|
2025
|
+
// console.log('Base Language');
|
|
2026
|
+
// } else {
|
|
2027
|
+
// const formData = _.cloneDeep(this.state.formData);
|
|
2028
|
+
// const currentTab = `${this.state.currentTab - 1}`;
|
|
2029
|
+
// const currentLang = formData[`${this.state.currentTab - 1}`].activeTab;
|
|
2030
|
+
// const deleteLanguageIndex = formData[currentTab].selectedLanguages.indexOf(currentLang);
|
|
2031
|
+
// console.log('deleting language', currentTab, currentLang);
|
|
2032
|
+
// delete formData[currentTab][currentLang];
|
|
2033
|
+
// formData[currentTab].activeTab = this.props.baseLanguage;
|
|
2034
|
+
// formData[currentTab].selectedLanguages.splice(deleteLanguageIndex, 1);
|
|
2035
|
+
// console.log('After Deleting Form data ', formData);
|
|
2036
|
+
// this.setState({formData, currentLangTab: this.props.baseLanguage}, () => {
|
|
2037
|
+
// val.injectedEvents[event].call(this.props.parent, formData, deleteLanguageIndex);
|
|
2038
|
+
// });
|
|
2039
|
+
// }
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
console.log('Call Event ', event, data);
|
|
2043
|
+
val.injectedEvents[event].call(this.props.parent, data);
|
|
2044
|
+
}
|
|
2045
|
+
openFileDialog = () => {
|
|
2046
|
+
document.getElementById("fileName").click();
|
|
2047
|
+
};
|
|
2048
|
+
handleOk = (ev) => {
|
|
2049
|
+
const id = ev.target.id;
|
|
2050
|
+
console.log('Handle OK ', id);
|
|
2051
|
+
this.setState({showModal: false});
|
|
2052
|
+
if (id === "android" && this.state.androidValid) {
|
|
2053
|
+
this.props.onSubmit(this.state.formData);
|
|
2054
|
+
} else if (id === "ios" && this.state.iosValid) {
|
|
2055
|
+
this.props.onSubmit(this.state.formData);
|
|
2056
|
+
} else if (id === "sms-version-modal") {
|
|
2057
|
+
console.log('Deleting version ', this.state.currentTab);
|
|
2058
|
+
this.state.currentEvent.call(this.props.parent, this.state.currentEventData, this.state.currentTab);
|
|
2059
|
+
this.setState({currentEvent: {}, currentEventData: {}});
|
|
2060
|
+
this.deleteVersion(false, this.state.currentTab);
|
|
2061
|
+
} else if (id === 'template-back-confirm-modal') {
|
|
2062
|
+
const type = this.props.location.query.type;
|
|
2063
|
+
const response = {
|
|
2064
|
+
action: 'moveToTemplates',
|
|
2065
|
+
value: 'ok',
|
|
2066
|
+
};
|
|
2067
|
+
this.props.iframeParent.postMessage(JSON.stringify(response), '*');
|
|
2068
|
+
const isLanguageSupport = this.props.location.query.isLanguageSupport || false;
|
|
2069
|
+
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
2070
|
+
const module = this.props.location.query.module ? this.props.location.query.module : 'default';
|
|
2071
|
+
this.props.router.push({
|
|
2072
|
+
pathname: `/${this.props.schema.channel.toLowerCase()}/`,
|
|
2073
|
+
query: type === 'embedded' ? {type: 'embedded', module, isLanguageSupport, isEdmSupport} : {module, isLanguageSupport, isEdmSupport},
|
|
2074
|
+
});
|
|
2075
|
+
} else if (id === "email-language-delete-modal") {
|
|
2076
|
+
console.log('Delete languages ');
|
|
2077
|
+
this.deleteLanguage();
|
|
2078
|
+
this.props.handleCancelModal();
|
|
2079
|
+
// this.setState({currentEvent: {}, currentEventData: {}});
|
|
2080
|
+
} else if (id === 'email-version-delete-modal') {
|
|
2081
|
+
this.deleteVersion(false, this.state.currentTab);
|
|
2082
|
+
}
|
|
2083
|
+
};
|
|
2084
|
+
handleCancel = (ev) => {
|
|
2085
|
+
const id = ev.target.id;
|
|
2086
|
+
this.setState({showModal: false});
|
|
2087
|
+
if (id === 'template-back-confirm-modal') {
|
|
2088
|
+
const response = {
|
|
2089
|
+
action: 'moveToTemplate',
|
|
2090
|
+
value: 'cancel',
|
|
2091
|
+
};
|
|
2092
|
+
this.props.iframeParent.postMessage(JSON.stringify(response), '*');
|
|
2093
|
+
}
|
|
2094
|
+
if (this.props.handleCancelModal) {
|
|
2095
|
+
this.props.handleCancelModal();
|
|
2096
|
+
}
|
|
2097
|
+
};
|
|
2098
|
+
handleConfirmations = () => {
|
|
2099
|
+
console.log('handling confirmations');
|
|
2100
|
+
this.setState({showModal: true});
|
|
2101
|
+
};
|
|
2102
|
+
|
|
2103
|
+
uploadImages = (e, {files}, val) => {
|
|
2104
|
+
e.preventDefault();
|
|
2105
|
+
const _URL = window.URL || window.webkitURL;
|
|
2106
|
+
const file = files[0];
|
|
2107
|
+
const img = new Image();
|
|
2108
|
+
img.src = _URL.createObjectURL(file);
|
|
2109
|
+
img.onload = () => {
|
|
2110
|
+
const fileParams = {
|
|
2111
|
+
width: this.width,
|
|
2112
|
+
height: this.height,
|
|
2113
|
+
error: file.size / (1e+6) > 5,
|
|
2114
|
+
};
|
|
2115
|
+
this.callChildEvent({file, type: 'image', fileParams}, val, val.submitAction);
|
|
2116
|
+
};
|
|
2117
|
+
const event = e;
|
|
2118
|
+
event.target.value = null;
|
|
2119
|
+
};
|
|
2120
|
+
|
|
2121
|
+
findBaseTab = () => {
|
|
2122
|
+
const activeTabKey = this.state.formData && this.state.formData.base ? this.state.formData.base.tabKey : -1;
|
|
2123
|
+
const formData = _.cloneDeep(this.state.formData);
|
|
2124
|
+
let baseTab = 0;
|
|
2125
|
+
for (let i = 0; i < this.state.tabCount; i += 1) {
|
|
2126
|
+
if (formData[i] && formData[i].tabKey === activeTabKey) {
|
|
2127
|
+
baseTab = i;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
console.log('base tab is ', baseTab);
|
|
2131
|
+
return baseTab;
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2134
|
+
handleOnHoverItem = (isHovering, id) => {
|
|
2135
|
+
if (isHovering) {
|
|
2136
|
+
this.setState({hoveredItem: id});
|
|
2137
|
+
} else {
|
|
2138
|
+
this.setState({hoveredItem: ''});
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
handleOnItemClick = (isClicked, id) => {
|
|
2143
|
+
this.setState({clickedItem: id});
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
populateTemplatesList(data) {
|
|
2147
|
+
if (!data) {
|
|
2148
|
+
return [];
|
|
2149
|
+
}
|
|
2150
|
+
const items = [];
|
|
2151
|
+
data.map( (template) => {
|
|
2152
|
+
// console.log("Templates ", template._id, " Data ", template);
|
|
2153
|
+
const temp = {};
|
|
2154
|
+
temp.id = template._id;
|
|
2155
|
+
if (this.props.schema.channel.toLowerCase() === 'email') {
|
|
2156
|
+
// console.log('Data Prepare');
|
|
2157
|
+
const imgSrc = template && template.versions && template.versions.base ? template.versions.base.preview_http_url : '';
|
|
2158
|
+
const ifPreviewGenerated = template && template.versions && template.versions.base ? template.versions.base.isPreviewGenerated : 0;
|
|
2159
|
+
const content = <img src={imgSrc || ''} alt="" />;
|
|
2160
|
+
console.log('qwerty template preview', imgSrc, template, ifPreviewGenerated, content);
|
|
2161
|
+
temp.content = (
|
|
2162
|
+
<div
|
|
2163
|
+
className="sms-template-content">
|
|
2164
|
+
<div className={`sms-text ${this.state.clickedItem === template._id ? 'sms-text-blurred' : ''}`}>
|
|
2165
|
+
{content}
|
|
2166
|
+
</div>
|
|
2167
|
+
{/*template._id === this.state.clickedItem ? <CapButton onClick={(e) => this.handleEditClick(e, template._id)} className="edit-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectButton) : this.props.intl.formatMessage(messages.editButton)}</CapButton> : ''*/}
|
|
2168
|
+
{/*template._id === this.state.clickedItem ? <CapButton onClick={() => this.handlePreviewClick(template)} className="preview-button" type="cancel">{this.props.intl.formatMessage(messages.previewButton)}</CapButton> : ''*/}
|
|
2169
|
+
</div>);
|
|
2170
|
+
}
|
|
2171
|
+
// temp.footer = (
|
|
2172
|
+
// <div className="footer-container">
|
|
2173
|
+
// <div className="card-title">
|
|
2174
|
+
// <span className="template-name" style={{ fontWeight: `${this.props.schema.channel.toLowerCase() === 'wechat' ? '400' : '600'}` }}>
|
|
2175
|
+
// { template && template.versions && template.versions.history && template.versions.history.length > 1 && this.props.schema.channel.toLowerCase() !== 'mobilepush' && <i style={{fontSize: '16px', margin: '0 8px 0 0', verticalAlign: 'middle'}} className="material-icons">filter_none</i>}
|
|
2176
|
+
// {template.name}
|
|
2177
|
+
// </span>
|
|
2178
|
+
// </div>
|
|
2179
|
+
// </div>
|
|
2180
|
+
// );
|
|
2181
|
+
items.push(temp);
|
|
2182
|
+
return true;
|
|
2183
|
+
});
|
|
2184
|
+
return items;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
handleAddLanguageFlow(data, val, event) {
|
|
2188
|
+
this.setState({currentEventData: data, currentEventVal: val, currentEvent: event, customPopoverVisible: false}, () => {
|
|
2189
|
+
this.props.setModalContent('add-language', data);
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
renderColLabelSection(section, childIndex) {
|
|
2194
|
+
// const schema = this.props.schema
|
|
2195
|
+
const fields = [];
|
|
2196
|
+
_.forEach(section.inputFields, (val) => {
|
|
2197
|
+
const row = [];
|
|
2198
|
+
const columns = [];
|
|
2199
|
+
const type = val.type;
|
|
2200
|
+
const styling = val.styling;
|
|
2201
|
+
if (!this.props.isNewVersionFlow && !val.standalone && !val.onlyDisplay && this.props.usingTabContainer && !this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2202
|
+
return true;
|
|
2203
|
+
}
|
|
2204
|
+
if (!val.onlyDisplay && !val.standalone && (!this.state.formData[`${this.state.currentTab - 1}`] || (!this.state.formData[`${this.state.currentTab - 1}`][val.id] && this.state.formData[`${this.state.currentTab - 1}`][val.id] === null))) {
|
|
2205
|
+
return true;
|
|
2206
|
+
}
|
|
2207
|
+
if (!val.onlyDisplay && !val.standalone && (!this.state.errorData[`${this.state.currentTab - 1}`] || (!this.state.errorData[`${this.state.currentTab - 1}`][val.id] && this.state.errorData[`${this.state.currentTab - 1}`][val.id] === null))) {
|
|
2208
|
+
return true;
|
|
2209
|
+
}
|
|
2210
|
+
// console.log('rendering val', val, this.state.formData[`${this.state.currentTab - 1}`][val.id], this.state.usingTabContainer && !val.standalone);
|
|
2211
|
+
columns.push(
|
|
2212
|
+
<Col key="label" span={4}>
|
|
2213
|
+
<Label style={val.labelStyle ? val.labelStyle : {}}>{val.label}</Label>
|
|
2214
|
+
</Col>
|
|
2215
|
+
);
|
|
2216
|
+
let ifError = false;
|
|
2217
|
+
const isVersionEnable = (this.state.usingTabContainer && !val.standalone);
|
|
2218
|
+
if (val.primitive) {
|
|
2219
|
+
if (val.id === "mark-final-version-label") {
|
|
2220
|
+
const baseTab = this.findBaseTab();
|
|
2221
|
+
if ((baseTab + 1) === childIndex) {
|
|
2222
|
+
return true;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
columns.push(
|
|
2226
|
+
<Col key={val.id} span={val.width}>
|
|
2227
|
+
{this.renderPrimitiveElement(val, childIndex)}
|
|
2228
|
+
</Col>
|
|
2229
|
+
);
|
|
2230
|
+
return true;
|
|
2231
|
+
}
|
|
2232
|
+
switch (type) {
|
|
2233
|
+
case "input":
|
|
2234
|
+
if (styling === 'semantic') {
|
|
2235
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2236
|
+
console.log('input error', ifError);
|
|
2237
|
+
columns.push(
|
|
2238
|
+
<Col key={val.id} span={val.width}>
|
|
2239
|
+
<CapInput
|
|
2240
|
+
id={val.id}
|
|
2241
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2242
|
+
className={`input-primary chart-name-input${ifError ? ' error' : ''}`}
|
|
2243
|
+
// fluid={val.fluid}
|
|
2244
|
+
style={val.style ? val.style : {}}
|
|
2245
|
+
placeholder={val.placeholder}
|
|
2246
|
+
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2247
|
+
defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2248
|
+
value={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2249
|
+
disabled={val.disabled}
|
|
2250
|
+
/>
|
|
2251
|
+
</Col>
|
|
2252
|
+
);
|
|
2253
|
+
}
|
|
2254
|
+
break;
|
|
2255
|
+
case "SmsEditor":
|
|
2256
|
+
columns.push(
|
|
2257
|
+
<Col span={5} key="input">
|
|
2258
|
+
<SmsEditor
|
|
2259
|
+
id={val.id}
|
|
2260
|
+
content={this.state.formData[val.id]}
|
|
2261
|
+
onDataChange={(data) => this.updateFormData(data.value, val)}
|
|
2262
|
+
/>
|
|
2263
|
+
</Col>
|
|
2264
|
+
);
|
|
2265
|
+
break;
|
|
2266
|
+
case "textarea":
|
|
2267
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2268
|
+
if (styling === 'semantic') {
|
|
2269
|
+
columns.push(
|
|
2270
|
+
<Col key="input" span={val.width}>
|
|
2271
|
+
<CapTextArea
|
|
2272
|
+
id={val.id}
|
|
2273
|
+
className={`${ifError ? 'error' : ''}`}
|
|
2274
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2275
|
+
autosize={val.autosize ? val.autosizeParams : false}
|
|
2276
|
+
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2277
|
+
style={val.style ? val.style : {}}
|
|
2278
|
+
defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2279
|
+
value={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2280
|
+
rows={20}
|
|
2281
|
+
disabled={val.disabled}
|
|
2282
|
+
cols={20}
|
|
2283
|
+
/>
|
|
2284
|
+
</Col>
|
|
2285
|
+
);
|
|
2286
|
+
}
|
|
2287
|
+
break;
|
|
2288
|
+
case "contentPreview":
|
|
2289
|
+
const content = isVersionEnable ? this.state.formData[this.state.currentTab - 1]['sms-editor'] : this.state.formData['sms-editor'];
|
|
2290
|
+
const charList = updateCharCount(content).char_list;
|
|
2291
|
+
columns.push(<CapColumn id={val.id} className={"preview-chars"} span={val.width}>
|
|
2292
|
+
{charList.map((char) => char)}
|
|
2293
|
+
</CapColumn>);
|
|
2294
|
+
case "checkbox":
|
|
2295
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2296
|
+
if (styling === 'semantic') {
|
|
2297
|
+
columns.push(
|
|
2298
|
+
<Col key="input" span={val.width} offset={val.offset}>
|
|
2299
|
+
<CapCheckbox
|
|
2300
|
+
className={`${ifError ? 'error' : ''}`}
|
|
2301
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2302
|
+
style={val.style ? val.style : {}}
|
|
2303
|
+
onChange={(e) => this.updateFormData(e, val)}
|
|
2304
|
+
checked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2305
|
+
defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2306
|
+
disabled={val.disabled}
|
|
2307
|
+
/>
|
|
2308
|
+
</Col>
|
|
2309
|
+
);
|
|
2310
|
+
}
|
|
2311
|
+
break;
|
|
2312
|
+
case "tag-list":
|
|
2313
|
+
columns.push(
|
|
2314
|
+
<Col key={`input-${val.id}`} span={10} offset={val.offset}>
|
|
2315
|
+
<TagList
|
|
2316
|
+
key={`input-${val.id}`}
|
|
2317
|
+
moduleFilterEnabled={this.props.location && this.props.location.query && this.props.location.query.type !== 'embedded'}
|
|
2318
|
+
label={val.label ? val.label : ''}
|
|
2319
|
+
onTagSelect={(data) => this.callChildEvent(data, val, 'onTagSelect')}
|
|
2320
|
+
onContextChange={this.props.onContextChange}
|
|
2321
|
+
location={this.props.location}
|
|
2322
|
+
tags={this.props.tags ? this.props.tags : []}
|
|
2323
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
2324
|
+
className={val.className ? val.className : ''}
|
|
2325
|
+
id={val.id}
|
|
2326
|
+
userLocale={this.props.userLocale}
|
|
2327
|
+
/>
|
|
2328
|
+
</Col>
|
|
2329
|
+
);
|
|
2330
|
+
break;
|
|
2331
|
+
case "tabs":
|
|
2332
|
+
columns.push(
|
|
2333
|
+
<Col key="input" span={10}>
|
|
2334
|
+
<TagList
|
|
2335
|
+
onTagSelect={(data) => this.callChildEvent(data, val, 'onTagSelect')}
|
|
2336
|
+
/>
|
|
2337
|
+
</Col>
|
|
2338
|
+
);
|
|
2339
|
+
break;
|
|
2340
|
+
case "sms-preview": {
|
|
2341
|
+
let content = "";
|
|
2342
|
+
if (this.state.usingTabContainer && !this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2343
|
+
return true;
|
|
2344
|
+
}
|
|
2345
|
+
content = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`sms-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData[val.id];
|
|
2346
|
+
const unicodeEnabled = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`unicode-validity${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData['unicode-validity'];
|
|
2347
|
+
columns.push(
|
|
2348
|
+
<Col key="input" span={10}>
|
|
2349
|
+
<TemplatePreview
|
|
2350
|
+
channel={val.channel ? val.channel : 'SMS'}
|
|
2351
|
+
content={content}
|
|
2352
|
+
charCounterEnabled={val.charCounterEnabled}
|
|
2353
|
+
unicodeEnabled={unicodeEnabled}
|
|
2354
|
+
>
|
|
2355
|
+
</TemplatePreview>
|
|
2356
|
+
</Col>
|
|
2357
|
+
);
|
|
2358
|
+
break;
|
|
2359
|
+
}
|
|
2360
|
+
case "popover":
|
|
2361
|
+
columns.push(
|
|
2362
|
+
<CapPopover
|
|
2363
|
+
trigger={val.trigger}
|
|
2364
|
+
placement={val.placement}
|
|
2365
|
+
visible={this.state.popoverVisible && (this.props.isNewVersionFlow || this.state.currentTab === childIndex || !childIndex)}
|
|
2366
|
+
onVisibleChange={this.handleVisibleChange}
|
|
2367
|
+
content={
|
|
2368
|
+
_.forEach(val.content.sections, (contentSection) => {
|
|
2369
|
+
this.renderSection(contentSection);
|
|
2370
|
+
})
|
|
2371
|
+
}
|
|
2372
|
+
>
|
|
2373
|
+
{
|
|
2374
|
+
_.forEach(val.value.sections, (popoverSection) => {
|
|
2375
|
+
this.renderSection(popoverSection);
|
|
2376
|
+
})
|
|
2377
|
+
}
|
|
2378
|
+
</CapPopover>
|
|
2379
|
+
);
|
|
2380
|
+
break;
|
|
2381
|
+
case "select": {
|
|
2382
|
+
const options = (this.state.formData[`${val.id}-options`]) ? (this.state.formData[`${val.id}-options`]) : val.options;
|
|
2383
|
+
columns.push(
|
|
2384
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2385
|
+
<CapSelect
|
|
2386
|
+
id={val.id}
|
|
2387
|
+
placeholder={val.placeholder ? val.placeholder : ''}
|
|
2388
|
+
options={options}
|
|
2389
|
+
style={val.style ? val.style : {}}
|
|
2390
|
+
onSelect={(data) => this.updateFormData(data, val, 'onSelect')}
|
|
2391
|
+
value={(this.state.formData[val.id] && this.state.formData[val.id] !== '' ? this.state.formData[val.id] : undefined)}
|
|
2392
|
+
disabled={val.disabled}
|
|
2393
|
+
/>
|
|
2394
|
+
</Col>
|
|
2395
|
+
);
|
|
2396
|
+
}
|
|
2397
|
+
break;
|
|
2398
|
+
case "ckeditor":
|
|
2399
|
+
console.log('CKEditor Data 1', this.state.formData, val.id, this.state.currentTab);
|
|
2400
|
+
columns.push(
|
|
2401
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2402
|
+
<CKEditor
|
|
2403
|
+
id={val.id}
|
|
2404
|
+
content={(this.state.formData[`${this.state.currentTab - 1}`][val.id] ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : '')}
|
|
2405
|
+
events={val.events}
|
|
2406
|
+
getEditorInstanse={val.getEditorInstanse}
|
|
2407
|
+
// this.callChildEvent(data, val, 'addVersion', event);
|
|
2408
|
+
handleContentChange={(event) => this.callChildEvent(event, val, 'onContentChange')}
|
|
2409
|
+
/>
|
|
2410
|
+
</Col>
|
|
2411
|
+
);
|
|
2412
|
+
break;
|
|
2413
|
+
case "edmeditor": {
|
|
2414
|
+
// if (!this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2415
|
+
// return true;
|
|
2416
|
+
// }
|
|
2417
|
+
let langTab = 1;
|
|
2418
|
+
if (val.id.match(/edmeditor/g)) {
|
|
2419
|
+
if (val.length > 9 && val.id.charAt(9)) {
|
|
2420
|
+
langTab = val.id.charAt(9);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
const edmSrc = this.state.formData[`${this.state.currentTab - 1}`][this.state.currentLangTab][`edmeditor${langTab > 1 ? langTab : ''}src`];
|
|
2424
|
+
console.log('Rendering EDM Editor collabel ', edmSrc, this.state.formData[`${this.state.currentTab - 1}`]);
|
|
2425
|
+
if (!edmSrc) {
|
|
2426
|
+
return false;
|
|
2427
|
+
}
|
|
2428
|
+
console.log('Rendering EDM Editor 2 collabel');
|
|
2429
|
+
columns.push(
|
|
2430
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2431
|
+
<EDMEditor
|
|
2432
|
+
id={val.id}
|
|
2433
|
+
getEditorInstanse={this.getEditorInstanse}
|
|
2434
|
+
edmSrc={edmSrc}
|
|
2435
|
+
/>
|
|
2436
|
+
</Col>
|
|
2437
|
+
);
|
|
2438
|
+
}
|
|
2439
|
+
break;
|
|
2440
|
+
default:
|
|
2441
|
+
break;
|
|
2442
|
+
}
|
|
2443
|
+
row.push(
|
|
2444
|
+
<Row>
|
|
2445
|
+
{
|
|
2446
|
+
_.forEach(columns, (value) => {
|
|
2447
|
+
if (value) {
|
|
2448
|
+
return value;
|
|
2449
|
+
}
|
|
2450
|
+
return value;
|
|
2451
|
+
})
|
|
2452
|
+
}
|
|
2453
|
+
</Row>
|
|
2454
|
+
);
|
|
2455
|
+
|
|
2456
|
+
fields.push(row);
|
|
2457
|
+
return true;
|
|
2458
|
+
});
|
|
2459
|
+
_.forEach(section.actionFields, (val) => {
|
|
2460
|
+
const row = [];
|
|
2461
|
+
const columns = [];
|
|
2462
|
+
const type = val.type;
|
|
2463
|
+
const styling = val.styling;
|
|
2464
|
+
switch (type) {
|
|
2465
|
+
case "button":
|
|
2466
|
+
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
2467
|
+
columns.push(
|
|
2468
|
+
<Col>
|
|
2469
|
+
<CapButton
|
|
2470
|
+
onClick={(data) => val.id === 'save-button' ? this.saveForm() : this.callChildEvent(data, val, val.submitAction)}>
|
|
2471
|
+
{val.value}
|
|
2472
|
+
</CapButton>
|
|
2473
|
+
</Col>
|
|
2474
|
+
);
|
|
2475
|
+
}
|
|
2476
|
+
break;
|
|
2477
|
+
default:
|
|
2478
|
+
break;
|
|
2479
|
+
}
|
|
2480
|
+
row.push(columns);
|
|
2481
|
+
fields.push(row);
|
|
2482
|
+
});
|
|
2483
|
+
return fields;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
renderParentSection(section, childIndex) {
|
|
2487
|
+
const cols = [];
|
|
2488
|
+
section.childSections.map( (childSection) => {
|
|
2489
|
+
const renderedChildSection = this.renderSection(childSection, childIndex);
|
|
2490
|
+
cols.push(<Col style={childSection.colStyle ? childSection.colStyle : {}}offset={childSection.offset} span={childSection.width}>{renderedChildSection}</Col>);
|
|
2491
|
+
return true;
|
|
2492
|
+
});
|
|
2493
|
+
const row = (<Row style={section.rowStyle ? section.rowStyle : {}}>
|
|
2494
|
+
{
|
|
2495
|
+
_.forEach(cols, (value) => {
|
|
2496
|
+
if (value) {
|
|
2497
|
+
return value;
|
|
2498
|
+
}
|
|
2499
|
+
return value;
|
|
2500
|
+
})
|
|
2501
|
+
}
|
|
2502
|
+
</Row>);
|
|
2503
|
+
return row;
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
renderSection(section, childIndex) {
|
|
2507
|
+
switch (section.type) {
|
|
2508
|
+
case "col-label":
|
|
2509
|
+
return this.renderColLabelSection(section, childIndex);
|
|
2510
|
+
case "multicols":
|
|
2511
|
+
return this.renderMultiColSection(section, childIndex);
|
|
2512
|
+
case "parent":
|
|
2513
|
+
return this.renderParentSection(section, childIndex);
|
|
2514
|
+
default:
|
|
2515
|
+
break;
|
|
2516
|
+
}
|
|
2517
|
+
return null;
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
renderPrimitiveElement(val, childIndex) {
|
|
2521
|
+
const type = val.type;
|
|
2522
|
+
const tabName = this.state.formData[childIndex - 1] && this.state.formData[childIndex - 1].name ? this.state.formData[childIndex - 1].name : `${val.value} ${childIndex}`;
|
|
2523
|
+
let value = val.dynamicTab ? tabName : val.value;
|
|
2524
|
+
switch (type) {
|
|
2525
|
+
case "span":
|
|
2526
|
+
return <span id={`${val.id}${childIndex > 1 ? childIndex : ''}`}>{val.dynamicTab ? tabName : val.value}</span>;
|
|
2527
|
+
case "div":
|
|
2528
|
+
if (this.state.formData[`${this.state.currentTab - 1}`] && this.state.formData[`${this.state.currentTab - 1}`][val.id] && this.state.formData[`${this.state.currentTab - 1}`][val.id].trim() !== "") {
|
|
2529
|
+
value = this.state.formData[`${this.state.currentTab - 1}`][val.id];
|
|
2530
|
+
}
|
|
2531
|
+
return (<div
|
|
2532
|
+
className={val.className ? val.className : ''}
|
|
2533
|
+
id={`${val.id}${childIndex > 1 ? childIndex : ''}`}
|
|
2534
|
+
onClick={(data) => this.callChildEvent(data, val, val.submitAction)}
|
|
2535
|
+
style={val.style ? val.style : {}}
|
|
2536
|
+
onInput={(e) => { e.stopPropagation(); this.callChildEvent(e.target.textContent, val, 'onChange'); }}
|
|
2537
|
+
>{value}</div>);
|
|
2538
|
+
default:
|
|
2539
|
+
return '';
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
renderMultiColSection(section, childIndex) {
|
|
2544
|
+
const fields = [];
|
|
2545
|
+
let contentSections = [];
|
|
2546
|
+
let popoverSections = [];
|
|
2547
|
+
const self = this;
|
|
2548
|
+
_.forEach(section.inputFields, (field) => {
|
|
2549
|
+
const columns = [];
|
|
2550
|
+
_.forEach(field.cols, (val) => {
|
|
2551
|
+
const type = val.type;
|
|
2552
|
+
const styling = val.styling;
|
|
2553
|
+
const isVersionEnable = (this.state.usingTabContainer && !val.standalone);
|
|
2554
|
+
if (val.id.match(/edmeditor/g)) {
|
|
2555
|
+
console.log('current language first', val.id);
|
|
2556
|
+
}
|
|
2557
|
+
console.log('Multi col Render 1', val.id, !val.standalone, !val.onlyDisplay, (!this.state.formData[`${this.state.currentTab - 1}`] || (!this.state.formData[`${this.state.currentTab - 1}`] && this.state.errorData[`${this.state.currentTab - 1}`][val.id] === null)), this.state.formData[`${this.state.currentTab - 1}`], this.state.currentTab);
|
|
2558
|
+
console.log('Multi col render ', val, this.state.formData, this.state.errorData, this.state.currentTab);
|
|
2559
|
+
if (!this.props.isNewVersionFlow && !val.standalone && !val.onlyDisplay && isVersionEnable && !this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2560
|
+
return true;
|
|
2561
|
+
}
|
|
2562
|
+
if (!val.standalone && !val.onlyDisplay &&
|
|
2563
|
+
(!this.state.formData[`${this.state.currentTab - 1}`] ||
|
|
2564
|
+
(!this.props.isNewVersionFlow && !this.state.formData[`${this.state.currentTab - 1}`] &&
|
|
2565
|
+
this.state.errorData[`${this.state.currentTab - 1}`][val.id] === null)) &&
|
|
2566
|
+
(this.props.isNewVersionFlow && !this.state.formData[`${this.state.currentTab - 1}`] &&
|
|
2567
|
+
this.state.errorData[`${this.state.currentTab - 1}`] && this.state.errorData[`${this.state.currentTab - 1}`][val.id] === null)) {
|
|
2568
|
+
return true;
|
|
2569
|
+
}
|
|
2570
|
+
if (!val.onlyDisplay && !val.standalone &&
|
|
2571
|
+
(!this.props.isNewVersionFlow && (!this.state.errorData[`${this.state.currentTab - 1}`] ||
|
|
2572
|
+
(!this.state.errorData[`${this.state.currentTab - 1}`] &&
|
|
2573
|
+
this.state.errorData[`${this.state.currentTab - 1}`][val.id] === null)))) {
|
|
2574
|
+
return true;
|
|
2575
|
+
}
|
|
2576
|
+
console.log('Render 3');
|
|
2577
|
+
let ifError = false;
|
|
2578
|
+
if (val.primitive) {
|
|
2579
|
+
if (val.id === "mark-final-version-label") {
|
|
2580
|
+
const baseTab = this.findBaseTab();
|
|
2581
|
+
if ((baseTab + 1) === childIndex) {
|
|
2582
|
+
return true;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
columns.push(
|
|
2586
|
+
<Col style={val.colStyle ? val.colStyle : {}} offset={val.offset} key={val.id} span={val.width}>
|
|
2587
|
+
{this.renderPrimitiveElement(val, childIndex)}
|
|
2588
|
+
</Col>
|
|
2589
|
+
);
|
|
2590
|
+
return true;
|
|
2591
|
+
}
|
|
2592
|
+
console.log('Render 4');
|
|
2593
|
+
switch (type) {
|
|
2594
|
+
case "input":
|
|
2595
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2596
|
+
console.log('input error', ifError);
|
|
2597
|
+
if (styling === 'semantic') {
|
|
2598
|
+
columns.push(
|
|
2599
|
+
<Col key={val.id} span={val.width}>
|
|
2600
|
+
<CapInput
|
|
2601
|
+
id={val.id}
|
|
2602
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2603
|
+
className={`input-primary chart-name-input${ifError ? ' error' : ''}`}
|
|
2604
|
+
// fluid={val.fluid}
|
|
2605
|
+
style={val.style ? val.style : {}}
|
|
2606
|
+
placeholder={val.placeholder}
|
|
2607
|
+
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2608
|
+
value={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2609
|
+
defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2610
|
+
disabled={val.disabled}
|
|
2611
|
+
/>
|
|
2612
|
+
</Col>
|
|
2613
|
+
);
|
|
2614
|
+
}
|
|
2615
|
+
break;
|
|
2616
|
+
case "SmsEditor":
|
|
2617
|
+
columns.push(
|
|
2618
|
+
<Col span={5} key="input">
|
|
2619
|
+
<SmsEditor
|
|
2620
|
+
id={val.id}
|
|
2621
|
+
content={this.state.formData[val.id]}
|
|
2622
|
+
onDataChange={(data) => this.updateFormData(data.value, val)}
|
|
2623
|
+
/>
|
|
2624
|
+
</Col>
|
|
2625
|
+
);
|
|
2626
|
+
break;
|
|
2627
|
+
case "textarea":
|
|
2628
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2629
|
+
if (styling === 'semantic') {
|
|
2630
|
+
columns.push(
|
|
2631
|
+
<Col key="input" span={val.width} offset={val.offset}>
|
|
2632
|
+
<CapTextArea
|
|
2633
|
+
id={val.id}
|
|
2634
|
+
placeholder={val.placeholder ? val.placeholder : ''}
|
|
2635
|
+
disabled={val.disabled}
|
|
2636
|
+
className={`${ifError ? 'error' : ''}`}
|
|
2637
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2638
|
+
autosize={val.autosize ? val.autosizeParams : false}
|
|
2639
|
+
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2640
|
+
style={val.style ? val.style : {}}
|
|
2641
|
+
defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2642
|
+
value={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2643
|
+
rows={10}
|
|
2644
|
+
cols={2}
|
|
2645
|
+
/>
|
|
2646
|
+
</Col>
|
|
2647
|
+
);
|
|
2648
|
+
}
|
|
2649
|
+
break;
|
|
2650
|
+
case "checkbox":
|
|
2651
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2652
|
+
if (styling === 'semantic') {
|
|
2653
|
+
columns.push(
|
|
2654
|
+
<Col key="input" span={val.width} offset={val.offset}>
|
|
2655
|
+
<CapCheckbox
|
|
2656
|
+
className={`${ifError ? 'error' : ''}`}
|
|
2657
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2658
|
+
onChange={(e) => this.updateFormData(e.target.checked, val)}
|
|
2659
|
+
checked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2660
|
+
defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2661
|
+
style={val.style ? val.style : {}}
|
|
2662
|
+
disabled={val.disabled}
|
|
2663
|
+
>
|
|
2664
|
+
{val.label}
|
|
2665
|
+
</CapCheckbox>
|
|
2666
|
+
</Col>
|
|
2667
|
+
);
|
|
2668
|
+
}
|
|
2669
|
+
break;
|
|
2670
|
+
case "radio":
|
|
2671
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2672
|
+
if (styling === 'semantic') {
|
|
2673
|
+
columns.push(
|
|
2674
|
+
<Col key={`input-${val.id}`} span={val.width} offset={val.offset}>
|
|
2675
|
+
<CapRadio
|
|
2676
|
+
className={`${ifError ? 'error' : ''}`}
|
|
2677
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2678
|
+
onChange={(e) => this.updateFormData(e.target.checked, val)}
|
|
2679
|
+
checked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2680
|
+
defaultChecked={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
2681
|
+
style={val.style ? val.style : {}}
|
|
2682
|
+
>
|
|
2683
|
+
{val.label}
|
|
2684
|
+
</CapRadio>
|
|
2685
|
+
</Col>
|
|
2686
|
+
);
|
|
2687
|
+
}
|
|
2688
|
+
break;
|
|
2689
|
+
case 'radioGroup':
|
|
2690
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2691
|
+
if (styling === 'semantic') {
|
|
2692
|
+
columns.push(
|
|
2693
|
+
<Col key={`input-${val.id}`} span={val.width} offset={val.offset}>
|
|
2694
|
+
<CapRadioGroup
|
|
2695
|
+
key={`${val.id}-radio-group`}
|
|
2696
|
+
className={`${ifError ? 'error' : ''}`}
|
|
2697
|
+
errorMessage={val.errorMessage ? val.errorMessage : ''}
|
|
2698
|
+
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
2699
|
+
style={val.style ? val.style : {}}
|
|
2700
|
+
value={this.state.formData[`${self.state.currentTab - 1}`] && this.state.formData[`${self.state.currentTab - 1}`][val.id] !== "" ? this.state.formData[`${self.state.currentTab - 1}`][val.id] : val.value}
|
|
2701
|
+
name={val.name ? val.name : `${val.id}-name`}
|
|
2702
|
+
options={val.options}
|
|
2703
|
+
disabled={val.disabled}
|
|
2704
|
+
>
|
|
2705
|
+
</CapRadioGroup>
|
|
2706
|
+
{/*{ifError ?*/}
|
|
2707
|
+
{/*<div className="error"> {val.errorMessage}</div>*/}
|
|
2708
|
+
{/*:*/}
|
|
2709
|
+
{/*""*/}
|
|
2710
|
+
{/*}*/}
|
|
2711
|
+
</Col>
|
|
2712
|
+
);
|
|
2713
|
+
}
|
|
2714
|
+
break;
|
|
2715
|
+
case 'image':
|
|
2716
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2717
|
+
columns.push(
|
|
2718
|
+
<Col key={`input-${val.id}${self.state.currentTab - 1}`} style={val.style} span={val.width} offset={val.offset}>
|
|
2719
|
+
<div>
|
|
2720
|
+
<div className={`image-container ${ifError ? 'error' : ''}`}>
|
|
2721
|
+
{self.state && !!self.state.formData[`${self.state.currentTab - 1}`].image ?
|
|
2722
|
+
<img src={self.state.formData[`${self.state.currentTab - 1}`].image} alt={val.alt} style={val.style}/>
|
|
2723
|
+
:
|
|
2724
|
+
<div style={{width: "100%", textAlign: "center"}}><span className="image-placeholder">{val.placeholder}</span></div>
|
|
2725
|
+
}
|
|
2726
|
+
</div>
|
|
2727
|
+
{ifError && <span className="error">{val.errorMessage}</span>}
|
|
2728
|
+
</div>
|
|
2729
|
+
</Col>
|
|
2730
|
+
);
|
|
2731
|
+
break;
|
|
2732
|
+
case 'upload':
|
|
2733
|
+
columns.push(
|
|
2734
|
+
<Col span={val.width} offset={val.offset} style={val.style}>
|
|
2735
|
+
<form encType="multipart/form-data" id={val.id}>
|
|
2736
|
+
<input key={val.id} style={{ display: 'none'}} id="fileName" type="file" onChange={(e) => this.uploadImages(e, {files: e.target.files}, val)} accept="image/*" />
|
|
2737
|
+
<CapButton type="secondary" onClick={(e) => this.openFileDialog(e)} style={{float: 'right'}}>
|
|
2738
|
+
{val.label}
|
|
2739
|
+
</CapButton>
|
|
2740
|
+
</form>
|
|
2741
|
+
</Col>
|
|
2742
|
+
);
|
|
2743
|
+
break;
|
|
2744
|
+
case "table":
|
|
2745
|
+
columns.push(
|
|
2746
|
+
<CapTable dataSource={self.props.iosCtasData} loading={self.props.iosCtasData ? !self.props.iosCtasData.length : true} onRowClick={(row) => this.updateFormData(row, val, "onRowClick" )} pagination={val.pagination}>
|
|
2747
|
+
{_.map(val.columns, (col) => <Column {...col}/>)}
|
|
2748
|
+
</CapTable>
|
|
2749
|
+
);
|
|
2750
|
+
break;
|
|
2751
|
+
case "tag-list":
|
|
2752
|
+
columns.push(
|
|
2753
|
+
<Col key={`input-${val.id}`} offset={val.offset} span={val.width ? val.width : ''} style={val.style ? val.style : {marginBottom: '16px'}}>
|
|
2754
|
+
<TagList
|
|
2755
|
+
key={`input-${val.id}`}
|
|
2756
|
+
moduleFilterEnabled={this.props.location && this.props.location.query && this.props.location.query.type !== 'embedded'}
|
|
2757
|
+
label={val.label ? val.label : ''}
|
|
2758
|
+
onTagSelect={(data) => this.callChildEvent(data, val, 'onTagSelect')}
|
|
2759
|
+
onContextChange={this.props.onContextChange}
|
|
2760
|
+
location={this.props.location}
|
|
2761
|
+
tags={this.props.tags ? this.props.tags : []}
|
|
2762
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
2763
|
+
className={val.className ? val.className : ''}
|
|
2764
|
+
id={val.id}
|
|
2765
|
+
userLocale={this.props.userLocale}
|
|
2766
|
+
/>
|
|
2767
|
+
</Col>
|
|
2768
|
+
);
|
|
2769
|
+
break;
|
|
2770
|
+
case "button":
|
|
2771
|
+
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
2772
|
+
columns.push(
|
|
2773
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width} offset={val.offset}>
|
|
2774
|
+
<CapButton
|
|
2775
|
+
type={val.buttonType}
|
|
2776
|
+
icon={val.icon}
|
|
2777
|
+
disabled={val.disabled ? val.disabled : false}
|
|
2778
|
+
onClick={(data) => val.id === 'save-button' ? this.saveForm() : this.callChildEvent(data, val, val.submitAction)}>
|
|
2779
|
+
{val.value}
|
|
2780
|
+
</CapButton>
|
|
2781
|
+
</Col>
|
|
2782
|
+
);
|
|
2783
|
+
}
|
|
2784
|
+
break;
|
|
2785
|
+
|
|
2786
|
+
case "sms-preview": {
|
|
2787
|
+
let content = "";
|
|
2788
|
+
if (this.state.usingTabContainer && !this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2789
|
+
return true;
|
|
2790
|
+
}
|
|
2791
|
+
content = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`sms-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData[val.id];
|
|
2792
|
+
const unicodeEnabled = isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`unicode-validity${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData['unicode-validity'];
|
|
2793
|
+
columns.push(
|
|
2794
|
+
<Col key="input" span={23} offset={1}>
|
|
2795
|
+
<TemplatePreview
|
|
2796
|
+
key={val.id}
|
|
2797
|
+
style={val.customStyling ? val.customStyling : {}}
|
|
2798
|
+
channel={val.channel ? val.channel : 'SMS'}
|
|
2799
|
+
content={content}
|
|
2800
|
+
charCounterEnabled={val.charCounterEnabled}
|
|
2801
|
+
unicodeEnabled={unicodeEnabled}
|
|
2802
|
+
>
|
|
2803
|
+
</TemplatePreview>
|
|
2804
|
+
</Col>
|
|
2805
|
+
);
|
|
2806
|
+
}
|
|
2807
|
+
break;
|
|
2808
|
+
case "line-preview": {
|
|
2809
|
+
console.log("lipak inside imagePreview@@@", this.state.formData['0'].imagePreview);
|
|
2810
|
+
const content = {
|
|
2811
|
+
bodyText: isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][`message-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] : this.state.formData[val.id],
|
|
2812
|
+
bodyImage: this.state.formData[`${this.state.currentTab - 1}`].imagePreview,
|
|
2813
|
+
};
|
|
2814
|
+
if (!this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2815
|
+
return true;
|
|
2816
|
+
}
|
|
2817
|
+
console.log("lipak inside formdata@@@", content);
|
|
2818
|
+
columns.push(
|
|
2819
|
+
<Col key="input" span={23} offset={1}>
|
|
2820
|
+
<TemplatePreview
|
|
2821
|
+
key={val.id}
|
|
2822
|
+
style={val.customStyling ? val.customStyling : {}}
|
|
2823
|
+
channel={val.channel}
|
|
2824
|
+
content={content}
|
|
2825
|
+
>
|
|
2826
|
+
</TemplatePreview>
|
|
2827
|
+
</Col>
|
|
2828
|
+
);
|
|
2829
|
+
}
|
|
2830
|
+
break;
|
|
2831
|
+
case "mobile-push-preview":
|
|
2832
|
+
if (!this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2833
|
+
return true;
|
|
2834
|
+
}
|
|
2835
|
+
columns.push(
|
|
2836
|
+
<Col key="input" span={23} offset={1}>
|
|
2837
|
+
<TemplatePreview
|
|
2838
|
+
key={val.id}
|
|
2839
|
+
device={val.device ? val.device : 'android'}
|
|
2840
|
+
style={val.customStyling ? val.customStyling : {}}
|
|
2841
|
+
channel={val.channel}
|
|
2842
|
+
content={{
|
|
2843
|
+
header: this.state.formData[`${this.state.currentTab - 1}`][val.content.title],
|
|
2844
|
+
bodyText: this.state.formData[`${this.state.currentTab - 1}`][val.content.message],
|
|
2845
|
+
bodyImage: this.state.formData[`${this.state.currentTab - 1}`].image,
|
|
2846
|
+
actions: [
|
|
2847
|
+
{label: this.state.formData[`${this.state.currentTab - 1}`][val.content.secondaryCta1]},
|
|
2848
|
+
{label: this.state.formData[`${this.state.currentTab - 1}`][val.content.secondaryCta2]},
|
|
2849
|
+
],
|
|
2850
|
+
appName: val.content.appName,
|
|
2851
|
+
}}
|
|
2852
|
+
>
|
|
2853
|
+
</TemplatePreview>
|
|
2854
|
+
</Col>
|
|
2855
|
+
);
|
|
2856
|
+
break;
|
|
2857
|
+
case "popover":
|
|
2858
|
+
contentSections = val.content.sections.map( (contentSection) => {
|
|
2859
|
+
const result = this.renderSection(contentSection, childIndex);
|
|
2860
|
+
return result;
|
|
2861
|
+
});
|
|
2862
|
+
popoverSections = val.value.sections.map( (popoverSection) => {
|
|
2863
|
+
const result = this.renderSection(popoverSection, childIndex);
|
|
2864
|
+
return result;
|
|
2865
|
+
});
|
|
2866
|
+
columns.push(
|
|
2867
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width} offset={val.offset}>
|
|
2868
|
+
<CapPopover
|
|
2869
|
+
trigger={val.trigger}
|
|
2870
|
+
placement={val.placement}
|
|
2871
|
+
visible={this.state.popoverVisible && (this.props.isNewVersionFlow || this.state.currentTab === childIndex || !childIndex)}
|
|
2872
|
+
onVisibleChange={this.handleVisibleChange}
|
|
2873
|
+
content={
|
|
2874
|
+
_.forEach(contentSections, (contentSection) => {
|
|
2875
|
+
if (contentSection) {
|
|
2876
|
+
return contentSection;
|
|
2877
|
+
}
|
|
2878
|
+
return contentSection;
|
|
2879
|
+
})
|
|
2880
|
+
}
|
|
2881
|
+
>
|
|
2882
|
+
{
|
|
2883
|
+
_.forEach(popoverSections, (popoverSection) => {
|
|
2884
|
+
if (popoverSection) {
|
|
2885
|
+
return popoverSection;
|
|
2886
|
+
}
|
|
2887
|
+
return popoverSection;
|
|
2888
|
+
})
|
|
2889
|
+
}
|
|
2890
|
+
</CapPopover>
|
|
2891
|
+
</Col>
|
|
2892
|
+
);
|
|
2893
|
+
break;
|
|
2894
|
+
|
|
2895
|
+
case "icon":
|
|
2896
|
+
if (val.id === "base-version-icon") {
|
|
2897
|
+
const baseTab = this.findBaseTab();
|
|
2898
|
+
if ((baseTab + 1) !== childIndex) {
|
|
2899
|
+
return true;
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
columns.push(
|
|
2903
|
+
<Col
|
|
2904
|
+
key={`icon-${val.id}`}
|
|
2905
|
+
id={val.id}
|
|
2906
|
+
offset={val.offset}
|
|
2907
|
+
width={val.width ? val.width : 1}
|
|
2908
|
+
onClick={(data) => this.callChildEvent(data, val, val.submitAction)}
|
|
2909
|
+
className={val.className ? val.className : ''}
|
|
2910
|
+
style={val.colStyle ? val.colStyle : {}}
|
|
2911
|
+
>
|
|
2912
|
+
<i style={val.style ? val.style : {}} className="material-icons">{val.value ? val.value : ''}</i>
|
|
2913
|
+
</Col>
|
|
2914
|
+
);
|
|
2915
|
+
break;
|
|
2916
|
+
case "select": {
|
|
2917
|
+
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2918
|
+
const options = (this.state.formData[`${val.id}-options`]) ? (this.state.formData[`${val.id}-options`]) : val.options;
|
|
2919
|
+
columns.push(
|
|
2920
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2921
|
+
<CapSelect
|
|
2922
|
+
id={val.id}
|
|
2923
|
+
options={options}
|
|
2924
|
+
placeholder={val.placeholder ? val.placeholder : ''}
|
|
2925
|
+
style={val.style ? val.style : {}}
|
|
2926
|
+
onSelect={(data) => this.updateFormData(data, val, 'onSelect')}
|
|
2927
|
+
value={isVersionEnable ? this.state.formData[this.state.currentTab - 1][val.id] : this.state.formData[val.id]}
|
|
2928
|
+
disabled={val.disabled}
|
|
2929
|
+
/>
|
|
2930
|
+
{ifError && val.errorMessage &&
|
|
2931
|
+
<span className={'error'}>{val.errorMessage}</span>
|
|
2932
|
+
}
|
|
2933
|
+
</Col>
|
|
2934
|
+
);
|
|
2935
|
+
}
|
|
2936
|
+
break;
|
|
2937
|
+
case "ckeditor": {
|
|
2938
|
+
if (_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`])) {
|
|
2939
|
+
return true;
|
|
2940
|
+
}
|
|
2941
|
+
let langIndex = 0;
|
|
2942
|
+
if (val.id.indexOf('template-content') > -1 && val.id !== 'template-content') {
|
|
2943
|
+
langIndex = parseInt(val.id.replace('template-content', ''), 10) - 1;
|
|
2944
|
+
}
|
|
2945
|
+
console.log('CKEditor Data 2', this.state.formData, this.state.formData[`${this.state.currentTab - 1}`], val, this.state.currentTab, this.state.currentLangTab, langIndex);
|
|
2946
|
+
const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
|
|
2947
|
+
const content = (!_.isEmpty(this.state.formData) && this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] ? this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] : '');
|
|
2948
|
+
console.log('ckeditor current lang', currentLang, content);
|
|
2949
|
+
if (this.state.formData[`${this.state.currentTab - 1}`][currentLang].is_drag_drop) {
|
|
2950
|
+
// content = "";
|
|
2951
|
+
}
|
|
2952
|
+
columns.push(
|
|
2953
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2954
|
+
<CKEditor
|
|
2955
|
+
id={val.id}
|
|
2956
|
+
content={content}
|
|
2957
|
+
events={val.events}
|
|
2958
|
+
getEditorInstanse={(evt, id) => val.injectedEvents.getEditorInstanse.call(this, evt, id)}
|
|
2959
|
+
handleContentChange={(event) => this.callChildEvent(event, val, 'onContentChange')}
|
|
2960
|
+
/>
|
|
2961
|
+
</Col>
|
|
2962
|
+
);
|
|
2963
|
+
}
|
|
2964
|
+
break;
|
|
2965
|
+
case "edmeditor": {
|
|
2966
|
+
// if (!this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
2967
|
+
// return true;
|
|
2968
|
+
// }
|
|
2969
|
+
let langTab = 1;
|
|
2970
|
+
if (val.id.match(/edmeditor/g)) {
|
|
2971
|
+
console.log('current language found match', val.id);
|
|
2972
|
+
if (val.id.length > 9 && val.id.charAt(9)) {
|
|
2973
|
+
console.log('current language in if');
|
|
2974
|
+
langTab = val.id.charAt(9);
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
const supportedLanguages = this.state.formData[this.state.currentTab - 1].selectedLanguages;
|
|
2978
|
+
// let langIndex = 0;
|
|
2979
|
+
// if (val.id.indexOf('edmeditor') > -1 && val.id !== 'edmeditorsrc') {
|
|
2980
|
+
// const test = val.id.replace('src', '');
|
|
2981
|
+
// langIndex = parseInt(test.replace('edmeditor', ''), 10) - 1;
|
|
2982
|
+
// }
|
|
2983
|
+
// const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
|
|
2984
|
+
const currentLang = supportedLanguages[langTab - 1];
|
|
2985
|
+
const edmSrc = this.state.formData[`${this.state.currentTab - 1}`][currentLang] && this.state.formData[`${this.state.currentTab - 1}`][currentLang][`edmeditor${this.state.currentTab > 1 ? this.state.currentTab : ''}src`];
|
|
2986
|
+
console.log('current language', langTab, supportedLanguages, currentLang, val.id, edmSrc);
|
|
2987
|
+
console.log('Rendering EDM Editor multicol', edmSrc, this.state.formData[`${this.state.currentTab - 1}`]);
|
|
2988
|
+
if (!edmSrc) {
|
|
2989
|
+
return false;
|
|
2990
|
+
}
|
|
2991
|
+
console.log('current language rendered', langTab, val.id);
|
|
2992
|
+
console.log('Rendering EDM Editor 2 multicol');
|
|
2993
|
+
columns.push(
|
|
2994
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
2995
|
+
<EDMEditor
|
|
2996
|
+
id={val.id}
|
|
2997
|
+
getEditorInstanse={this.getEditorInstanse}
|
|
2998
|
+
edmSrc={edmSrc}
|
|
2999
|
+
/>
|
|
3000
|
+
</Col>
|
|
3001
|
+
);
|
|
3002
|
+
}
|
|
3003
|
+
break;
|
|
3004
|
+
case "customPopover": {
|
|
3005
|
+
if (!this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
3006
|
+
return true;
|
|
3007
|
+
}
|
|
3008
|
+
columns.push(
|
|
3009
|
+
<Col style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
3010
|
+
<CustomPopOver
|
|
3011
|
+
id={val.id}
|
|
3012
|
+
popOverList={this.props.supportedLanguages}
|
|
3013
|
+
excludeList={this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages}
|
|
3014
|
+
handlePopOverClick={(data) => this.handleAddLanguageFlow(data, val, "addLanguage")}
|
|
3015
|
+
visible={this.state.customPopoverVisible}
|
|
3016
|
+
onVisibleChange={this.handleCustomPopoverVisibleChange}
|
|
3017
|
+
/>
|
|
3018
|
+
</Col>
|
|
3019
|
+
);
|
|
3020
|
+
}
|
|
3021
|
+
break;
|
|
3022
|
+
default:
|
|
3023
|
+
break;
|
|
3024
|
+
}
|
|
3025
|
+
return true;
|
|
3026
|
+
});
|
|
3027
|
+
const row = (
|
|
3028
|
+
<Row style={field.rowStyle ? field.rowStyle : {}} className={field.rowClassName ? field.rowClassName : ''}>
|
|
3029
|
+
{
|
|
3030
|
+
_.forEach(columns, (value) => {
|
|
3031
|
+
if (value) {
|
|
3032
|
+
return value;
|
|
3033
|
+
}
|
|
3034
|
+
return value;
|
|
3035
|
+
})
|
|
3036
|
+
}
|
|
3037
|
+
</Row>
|
|
3038
|
+
);
|
|
3039
|
+
fields.push(row);
|
|
3040
|
+
});
|
|
3041
|
+
|
|
3042
|
+
_.forEach(section.actionFields, (field) => {
|
|
3043
|
+
const columns = [];
|
|
3044
|
+
_.forEach(field.cols, (val) => {
|
|
3045
|
+
const type = val.type;
|
|
3046
|
+
const styling = val.styling;
|
|
3047
|
+
switch (type) {
|
|
3048
|
+
case "button":
|
|
3049
|
+
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
3050
|
+
columns.push(
|
|
3051
|
+
<Col span={3}>
|
|
3052
|
+
<CapButton
|
|
3053
|
+
type={val.buttonType}
|
|
3054
|
+
icon={val.icon}
|
|
3055
|
+
disabled={val.disabled ? val.disabled : false}
|
|
3056
|
+
onClick={(data) => val.id === 'save-button' ? this.saveForm() : this.callChildEvent(data, val, val.submitAction)}>
|
|
3057
|
+
{val.value}
|
|
3058
|
+
</CapButton>
|
|
3059
|
+
</Col>
|
|
3060
|
+
);
|
|
3061
|
+
}
|
|
3062
|
+
break;
|
|
3063
|
+
default:
|
|
3064
|
+
break;
|
|
3065
|
+
}
|
|
3066
|
+
});
|
|
3067
|
+
const row = (
|
|
3068
|
+
<Row>
|
|
3069
|
+
{
|
|
3070
|
+
_.forEach(columns, (value) => {
|
|
3071
|
+
if (value) {
|
|
3072
|
+
return value;
|
|
3073
|
+
}
|
|
3074
|
+
return value;
|
|
3075
|
+
})
|
|
3076
|
+
}
|
|
3077
|
+
</Row>
|
|
3078
|
+
);
|
|
3079
|
+
fields.push(row);
|
|
3080
|
+
});
|
|
3081
|
+
return fields;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
renderContainer(container) {
|
|
3085
|
+
const containerType = container.type;
|
|
3086
|
+
const renderedPanes = [];
|
|
3087
|
+
let renderedSections = [];
|
|
3088
|
+
let renderedContentSections = [];
|
|
3089
|
+
let paneIndex = 1;
|
|
3090
|
+
let panes = [];
|
|
3091
|
+
let result = [];
|
|
3092
|
+
let extraActionSections = [];
|
|
3093
|
+
let activeTabKey;
|
|
3094
|
+
let paneTabKey;
|
|
3095
|
+
let stateTabKey = '';
|
|
3096
|
+
switch (containerType) {
|
|
3097
|
+
case "tabs":
|
|
3098
|
+
panes = container.panes;
|
|
3099
|
+
_.forEach(panes, (pane, index) => {
|
|
3100
|
+
renderedSections = pane.sections.map((section) => {
|
|
3101
|
+
result = this.renderSection(section, paneIndex);
|
|
3102
|
+
return result;
|
|
3103
|
+
});
|
|
3104
|
+
console.log('tabs rendering', renderedSections);
|
|
3105
|
+
const sectionHeadeers = pane.sectionsHeaders ? pane.sectionsHeaders : container.tabContent && container.tabContent.sections;
|
|
3106
|
+
renderedContentSections = sectionHeadeers.map( (tabContentSection) => {
|
|
3107
|
+
result = this.renderSection(tabContentSection, paneIndex);
|
|
3108
|
+
return result;
|
|
3109
|
+
});
|
|
3110
|
+
// let newTabKey = `${_.uniqueId()}`;
|
|
3111
|
+
if (!this.state.formData[this.state.currentTab - 1]) {
|
|
3112
|
+
return;
|
|
3113
|
+
}
|
|
3114
|
+
activeTabKey = this.state.formData.tabKey;
|
|
3115
|
+
if (this.props.isNewVersionFlow) {
|
|
3116
|
+
activeTabKey = this.state.tabKey;
|
|
3117
|
+
}
|
|
3118
|
+
paneTabKey = this.state.formData[paneIndex - 1] && this.state.formData[paneIndex - 1].tabKey;
|
|
3119
|
+
if (this.props.isNewVersionFlow) {
|
|
3120
|
+
const currentLang = this.state.formData[this.state.currentTab - 1].selectedLanguages[index];
|
|
3121
|
+
paneTabKey = this.state.formData[this.state.currentTab - 1] && this.state.formData[this.state.currentTab - 1][currentLang] && this.state.formData[this.state.currentTab - 1][currentLang].tabKey;
|
|
3122
|
+
}
|
|
3123
|
+
console.log('tabs rendering pushing pane', paneTabKey, renderedSections, index, pane);
|
|
3124
|
+
renderedPanes.push(
|
|
3125
|
+
<TabPane
|
|
3126
|
+
forceRender
|
|
3127
|
+
tab={
|
|
3128
|
+
<div className="form-tab-header" onInput={(e) => e.stopPropagation()}>
|
|
3129
|
+
{
|
|
3130
|
+
_.forEach(renderedContentSections, (value) => {
|
|
3131
|
+
if (value) {
|
|
3132
|
+
return value;
|
|
3133
|
+
}
|
|
3134
|
+
return value;
|
|
3135
|
+
})
|
|
3136
|
+
}
|
|
3137
|
+
</div>
|
|
3138
|
+
}
|
|
3139
|
+
key={paneTabKey && paneTabKey !== '' ? `${paneTabKey}` : index}>
|
|
3140
|
+
{
|
|
3141
|
+
_.forEach(renderedSections, (value) => {
|
|
3142
|
+
if (value) {
|
|
3143
|
+
return value;
|
|
3144
|
+
}
|
|
3145
|
+
return value;
|
|
3146
|
+
})
|
|
3147
|
+
}
|
|
3148
|
+
</TabPane>);
|
|
3149
|
+
paneIndex += 1;
|
|
3150
|
+
});
|
|
3151
|
+
extraActionSections = container.tabBarExtraContent && container.tabBarExtraContent.sections ? container.tabBarExtraContent.sections.map((section) => {
|
|
3152
|
+
result = this.renderSection(section);
|
|
3153
|
+
return result;
|
|
3154
|
+
}) : {};
|
|
3155
|
+
stateTabKey = this.state.tabKey;
|
|
3156
|
+
if (stateTabKey && stateTabKey !== '') {
|
|
3157
|
+
activeTabKey = stateTabKey;
|
|
3158
|
+
}
|
|
3159
|
+
return (
|
|
3160
|
+
<Tabs
|
|
3161
|
+
activeKey={activeTabKey && activeTabKey !== '' ? `${activeTabKey}` : '1'}
|
|
3162
|
+
defaultActiveKey={activeTabKey && activeTabKey !== '' ? `${activeTabKey}` : '1'}
|
|
3163
|
+
onChange={(data, e) => { this.callChildEvent(data, container, 'onTabChange', e); }}
|
|
3164
|
+
onEdit={(data, e) => this.onEdit(data, e)}
|
|
3165
|
+
style={{width: '100%'}}
|
|
3166
|
+
tabBarExtraContent={
|
|
3167
|
+
!_.isEmpty(extraActionSections) && _.forEach(extraActionSections, (value) => {
|
|
3168
|
+
if (value) {
|
|
3169
|
+
return value;
|
|
3170
|
+
}
|
|
3171
|
+
return value;
|
|
3172
|
+
})
|
|
3173
|
+
}>
|
|
3174
|
+
{
|
|
3175
|
+
_.forEach(renderedPanes, (value) => {
|
|
3176
|
+
if (value) {
|
|
3177
|
+
return value;
|
|
3178
|
+
}
|
|
3179
|
+
return value;
|
|
3180
|
+
})
|
|
3181
|
+
}
|
|
3182
|
+
</Tabs>
|
|
3183
|
+
);
|
|
3184
|
+
|
|
3185
|
+
default:
|
|
3186
|
+
break;
|
|
3187
|
+
}
|
|
3188
|
+
return null;
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
renderForm() {
|
|
3192
|
+
const schema = this.props.schema;
|
|
3193
|
+
const allElements = [];
|
|
3194
|
+
let renderedStandAloneSections;
|
|
3195
|
+
let renderedContainers;
|
|
3196
|
+
if (schema.standalone) {
|
|
3197
|
+
const sections = schema.standalone.sections;
|
|
3198
|
+
renderedStandAloneSections = sections.map((section) => {
|
|
3199
|
+
const result = this.renderSection(section);
|
|
3200
|
+
return result;
|
|
3201
|
+
});
|
|
3202
|
+
allElements.push(renderedStandAloneSections);
|
|
3203
|
+
}
|
|
3204
|
+
if (schema.containers) {
|
|
3205
|
+
renderedContainers = schema.containers.map((container) => {
|
|
3206
|
+
if (container.isActive === undefined || (container.isActive)) {
|
|
3207
|
+
const result = this.renderContainer(container);
|
|
3208
|
+
return result;
|
|
3209
|
+
}
|
|
3210
|
+
return null;
|
|
3211
|
+
});
|
|
3212
|
+
console.log('tabs rendering result', renderedContainers);
|
|
3213
|
+
allElements.push(renderedContainers);
|
|
3214
|
+
console.log('tabs rendering all elements', allElements);
|
|
3215
|
+
const modal = this.getModal();
|
|
3216
|
+
allElements.push(modal);
|
|
3217
|
+
}
|
|
3218
|
+
return allElements;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
render() {
|
|
3222
|
+
const cmsTemplateSelectionContent = (
|
|
3223
|
+
<CardGrid
|
|
3224
|
+
className={""}
|
|
3225
|
+
listItem={this.populateTemplatesList(this.props.cmsTemplates)}
|
|
3226
|
+
// filterContent={filterContent}
|
|
3227
|
+
onHoverItem={this.handleOnHoverItem}
|
|
3228
|
+
onItemClick={this.props.handleEdmDefaultTemplateSelection}
|
|
3229
|
+
colNumber={2}
|
|
3230
|
+
>
|
|
3231
|
+
</CardGrid>
|
|
3232
|
+
);
|
|
3233
|
+
|
|
3234
|
+
console.log('form builder state ', this.state, this.props);
|
|
3235
|
+
return (
|
|
3236
|
+
<Row>
|
|
3237
|
+
{
|
|
3238
|
+
this.props.schema ? this.renderForm() : ''
|
|
3239
|
+
}
|
|
3240
|
+
<SlideBox
|
|
3241
|
+
header={(<h3>Layout Selection</h3>)}
|
|
3242
|
+
width={60}
|
|
3243
|
+
content={cmsTemplateSelectionContent}
|
|
3244
|
+
show={this.props.showEdmEmailTemplates}
|
|
3245
|
+
handleClose={this.props.toggleEdmEmailTemplateSelection}
|
|
3246
|
+
loadingText={"Loading EDM Templates"}
|
|
3247
|
+
isLoading={this.props.getCmsTemplatesInProgress}
|
|
3248
|
+
/>
|
|
3249
|
+
</Row>
|
|
3250
|
+
);
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
FormBuilder.defaultProps = {
|
|
3255
|
+
isNewVersionFlow: false,
|
|
3256
|
+
userLocale: 'en',
|
|
3257
|
+
};
|
|
3258
|
+
|
|
3259
|
+
FormBuilder.propTypes = {
|
|
3260
|
+
schema: PropTypes.object.isRequired,
|
|
3261
|
+
onSubmit: PropTypes.func,
|
|
3262
|
+
formData: PropTypes.object,
|
|
3263
|
+
onChange: PropTypes.func,
|
|
3264
|
+
isEdit: PropTypes.bool,
|
|
3265
|
+
usingTabContainer: PropTypes.bool,
|
|
3266
|
+
parent: PropTypes.object,
|
|
3267
|
+
iframeParent: PropTypes.object,
|
|
3268
|
+
location: PropTypes.object,
|
|
3269
|
+
tags: PropTypes.array,
|
|
3270
|
+
injectedTags: PropTypes.object,
|
|
3271
|
+
onFormValidityChange: PropTypes.func,
|
|
3272
|
+
checkValidation: PropTypes.bool,
|
|
3273
|
+
onContextChange: PropTypes.func,
|
|
3274
|
+
tabCount: PropTypes.number,
|
|
3275
|
+
isSchemaChanged: PropTypes.bool,
|
|
3276
|
+
modal: PropTypes.object,
|
|
3277
|
+
isNewVersionFlow: PropTypes.bool,
|
|
3278
|
+
baseLanguage: PropTypes.string,
|
|
3279
|
+
supportedLanguages: PropTypes.array,
|
|
3280
|
+
router: PropTypes.object,
|
|
3281
|
+
currentTab: PropTypes.number,
|
|
3282
|
+
showModal: PropTypes.bool,
|
|
3283
|
+
handleCancelModal: PropTypes.func,
|
|
3284
|
+
cmsTemplates: PropTypes.array,
|
|
3285
|
+
getCmsTemplatesInProgress: PropTypes.bool,
|
|
3286
|
+
showEdmEmailTemplates: PropTypes.bool,
|
|
3287
|
+
toggleEdmEmailTemplateSelection: PropTypes.func,
|
|
3288
|
+
handleEdmDefaultTemplateSelection: PropTypes.func,
|
|
3289
|
+
userLocale: PropTypes.string,
|
|
3290
|
+
setModalContent: PropTypes.func,
|
|
3291
|
+
addLanguageType: PropTypes.string,
|
|
3292
|
+
getValidationData: PropTypes.func,
|
|
3293
|
+
startValidation: PropTypes.bool,
|
|
3294
|
+
// saveForm: PropTypes.bool,
|
|
3295
|
+
stopValidation: PropTypes.func,
|
|
3296
|
+
};
|
|
3297
|
+
|
|
3298
|
+
export default FormBuilder;
|