@capillarytech/creatives-library 8.0.136-alpha.4 → 8.0.136-beta.3
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/components/BreadCrumbs/index.js +65 -0
- package/components/BreadCrumbs/messages.js +13 -0
- package/components/CapTagList/index.js +235 -0
- package/components/CapTagList/messages.js +45 -0
- package/components/Card/_customCard.scss +40 -0
- package/components/Card/index.js +78 -0
- package/components/Card/tests/__snapshots__/index.test.js.snap +22 -0
- package/components/Card/tests/index.test.js +20 -0
- package/components/CardGrid/index.js +71 -0
- package/components/Ckeditor/index.js +238 -0
- package/components/Ckeditor/messages.js +13 -0
- package/components/Ckeditor/style.scss +3 -0
- package/components/Component/index.js +29 -0
- package/components/CustomPopOver/index.js +81 -0
- package/components/CustomPopOver/messages.js +17 -0
- package/components/DateFilter/index.js +349 -0
- package/components/DateFilter/messages.js +57 -0
- package/components/DateRange/index.js +114 -0
- package/components/DateRange/messages.js +25 -0
- package/components/Edmeditor/index.js +65 -0
- package/components/Edmeditor/messages.js +13 -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 +107 -0
- package/components/EmailPreview/messages.js +33 -0
- package/components/Footer/index.js +27 -0
- package/components/Footer/messages.js +13 -0
- package/components/FormBuilder/_formBuilder.scss +83 -0
- package/components/FormBuilder/index.js +3279 -0
- package/components/FormBuilder/messages.js +61 -0
- package/components/Header/index.js +44 -0
- package/components/Header/messages.js +29 -0
- package/components/ImagePreview/_imagePreview.scss +63 -0
- package/components/ImagePreview/index.js +52 -0
- package/components/ImagePreview/messages.js +17 -0
- package/components/PageHeader/_pageHeader.scss +22 -0
- package/components/PageHeader/index.js +37 -0
- package/components/PageHeader/messages.js +13 -0
- package/components/Pagination/_pagination.scss +5 -0
- package/components/Pagination/index.js +49 -0
- package/components/PreviewSideBar/_previewsidebar.scss +28 -0
- package/components/PreviewSideBar/index.js +152 -0
- package/components/PreviewSideBar/messages.js +41 -0
- package/components/Sidebar/_sidebar.scss +115 -0
- package/components/Sidebar/index.js +214 -0
- package/components/Sidebar/messages.js +21 -0
- package/components/SlideBox/_slideBox.scss +63 -0
- package/components/SlideBox/index.js +47 -0
- package/components/SlideBox/tests/index.test.js +103 -0
- package/components/SmsEditor/index.js +55 -0
- package/components/SmsTest/index.js +117 -0
- package/components/SmsTest/messages.js +21 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +141 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
- package/components/TemplatePreview/_templatePreview.scss +642 -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/home-screen-android.svg +21 -0
- package/components/TemplatePreview/assets/images/home-screen-ios.svg +16 -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/sms_mobile_android.svg +22 -0
- package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +16 -0
- package/components/TemplatePreview/assets/images/user-icon.svg +19 -0
- package/components/TemplatePreview/assets/images/wechat-mobile.svg +78 -0
- package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -0
- package/components/TemplatePreview/index.js +617 -0
- package/components/TemplatePreview/messages.js +78 -0
- package/components/Toastr/index.js +60 -0
- package/components/Toastr/messages.js +13 -0
- package/components/ToastrMessage/index.js +113 -0
- package/components/ToastrMessage/messages.js +17 -0
- package/components/TopBar/_topbar.scss +46 -0
- package/components/TopBar/assets/images/capillary_logo.png +0 -0
- package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
- package/components/TopBar/index.js +113 -0
- package/components/TopBar/messages.js +29 -0
- package/containers/App/actions.js +7 -0
- package/containers/App/constants.js +114 -0
- package/containers/App/index.js +52 -0
- package/containers/App/reducer.js +19 -0
- package/containers/App/sagas.js +31 -0
- package/containers/App/selectors.js +25 -0
- package/containers/App/test/saga.test.js +11 -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 +473 -0
- package/containers/Assets/Gallery/messages.js +93 -0
- package/containers/Assets/Gallery/reducer.js +81 -0
- package/containers/Assets/Gallery/sagas.js +80 -0
- package/containers/Assets/Gallery/selectors.js +25 -0
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +9 -0
- package/containers/Assets/Gallery/tests/actions.test.js +25 -0
- package/containers/Assets/Gallery/tests/reducer.test.js +96 -0
- package/containers/Assets/Gallery/tests/saga.test.js +157 -0
- package/containers/Cap/actions.js +66 -0
- package/containers/Cap/constants.js +25 -0
- package/containers/Cap/index.js +402 -0
- package/containers/Cap/messages.js +75 -0
- package/containers/Cap/reducer.js +113 -0
- package/containers/Cap/sagas.js +159 -0
- package/containers/Cap/selectors.js +75 -0
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +2269 -0
- package/containers/Cap/tests/index.test.js +22 -0
- package/containers/Cap/tests/saga.test.js +284 -0
- package/containers/Dashboard/actions.js +15 -0
- package/containers/Dashboard/constants.js +7 -0
- package/containers/Dashboard/index.js +76 -0
- package/containers/Dashboard/messages.js +13 -0
- package/containers/Dashboard/reducer.js +21 -0
- package/containers/Dashboard/sagas.js +17 -0
- package/containers/Dashboard/selectors.js +25 -0
- package/containers/Dashboard/test/saga.test.js +9 -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 +1278 -0
- package/containers/Ebill/messages.js +77 -0
- package/containers/Ebill/reducer.js +72 -0
- package/containers/Ebill/sagas.js +74 -0
- package/containers/Ebill/selectors.js +25 -0
- package/containers/Ebill/test/saga.test.js +11 -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 +3325 -0
- package/containers/Email/messages.js +289 -0
- package/containers/Email/reducer.js +142 -0
- package/containers/Email/sagas.js +135 -0
- package/containers/Email/selectors.js +31 -0
- package/containers/Email/test/saga.test.js +671 -0
- package/containers/LanguageProvider/actions.js +17 -0
- package/containers/LanguageProvider/constants.js +8 -0
- package/containers/LanguageProvider/index.js +80 -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 +78 -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 +54 -0
- package/containers/Line/Create/actions.js +90 -0
- package/containers/Line/Create/constants.js +39 -0
- package/containers/Line/Create/index.js +836 -0
- package/containers/Line/Create/messages.js +189 -0
- package/containers/Line/Create/reducer.js +99 -0
- package/containers/Line/Create/sagas.js +121 -0
- package/containers/Line/Create/selectors.js +36 -0
- package/containers/Line/Create/tests/saga.test.js +202 -0
- package/containers/Line/Edit/_lineEdit.scss +35 -0
- package/containers/Line/Edit/actions.js +79 -0
- package/containers/Line/Edit/constants.js +27 -0
- package/containers/Line/Edit/index.js +1050 -0
- package/containers/Line/Edit/messages.js +177 -0
- package/containers/Line/Edit/reducer.js +83 -0
- package/containers/Line/Edit/sagas.js +80 -0
- package/containers/Line/Edit/selectors.js +29 -0
- package/containers/Line/Edit/test/saga.test.js +160 -0
- package/containers/Login/assets/images/capillary_logo.png +0 -0
- package/containers/Login/components/LoginForm/index.js +62 -0
- package/containers/Login/components/LoginForm/messages.js +33 -0
- package/containers/Login/index.js +130 -0
- package/containers/Login/messages.js +25 -0
- package/containers/Login/selectors.js +25 -0
- package/containers/MobilePush/Create/_mobilePushCreate.scss +39 -0
- package/containers/MobilePush/Create/actions.js +46 -0
- package/containers/MobilePush/Create/constants.js +23 -0
- package/containers/MobilePush/Create/index.js +2303 -0
- package/containers/MobilePush/Create/messages.js +269 -0
- package/containers/MobilePush/Create/reducer.js +70 -0
- package/containers/MobilePush/Create/sagas.js +74 -0
- package/containers/MobilePush/Create/selectors.js +28 -0
- package/containers/MobilePush/Create/test/saga.test.js +19 -0
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +39 -0
- package/containers/MobilePush/Edit/actions.js +91 -0
- package/containers/MobilePush/Edit/constants.js +35 -0
- package/containers/MobilePush/Edit/index.js +2601 -0
- package/containers/MobilePush/Edit/messages.js +266 -0
- package/containers/MobilePush/Edit/reducer.js +112 -0
- package/containers/MobilePush/Edit/sagas.js +126 -0
- package/containers/MobilePush/Edit/selectors.js +29 -0
- package/containers/MobilePush/Edit/tests/saga.test.js +255 -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 +42 -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 +109 -0
- package/containers/Sms/Create/reducer.js +41 -0
- package/containers/Sms/Create/sagas.js +40 -0
- package/containers/Sms/Create/selectors.js +28 -0
- package/containers/Sms/Create/test/saga.test.js +11 -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 +105 -0
- package/containers/Sms/Edit/reducer.js +50 -0
- package/containers/Sms/Edit/sagas.js +60 -0
- package/containers/Sms/Edit/selectors.js +32 -0
- package/containers/Sms/Edit/test/saga.test.js +13 -0
- package/containers/TagList/_tagList.scss +8 -0
- package/containers/TagList/actions.js +15 -0
- package/containers/TagList/constants.js +32 -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/Templates/_templates.scss +333 -0
- package/containers/Templates/actions.js +103 -0
- package/containers/Templates/constants.js +60 -0
- package/containers/Templates/index.js +1756 -0
- package/containers/Templates/messages.js +337 -0
- package/containers/Templates/reducer.js +142 -0
- package/containers/Templates/sagas.js +163 -0
- package/containers/Templates/selectors.js +28 -0
- package/containers/Templates/test/saga.test.js +241 -0
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
- package/containers/WeChat/MapTemplates/actions.js +52 -0
- package/containers/WeChat/MapTemplates/constants.js +28 -0
- package/containers/WeChat/MapTemplates/index.js +1610 -0
- package/containers/WeChat/MapTemplates/messages.js +157 -0
- package/containers/WeChat/MapTemplates/reducer.js +74 -0
- package/containers/WeChat/MapTemplates/sagas.js +84 -0
- package/containers/WeChat/MapTemplates/selectors.js +25 -0
- package/containers/WeChat/MapTemplates/test/saga.test.js +155 -0
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +1071 -0
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +165 -0
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
- package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +51 -0
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
- package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +136 -0
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +36 -0
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
- package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +12 -0
- package/containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
- package/containers/WeChat/RichmediaTemplates/View/index.js +47 -0
- package/containers/WeChat/RichmediaTemplates/View/messages.js +21 -0
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
- package/index.js +2 -4
- package/package.json +1 -1
- package/routes.js +202 -136
- package/services/getSchema.js +1 -1
- package/services/localStorageApi.js +0 -1
- package/tests/i18n.test.js +1 -1
- package/utils/asyncInjectors.js +78 -0
- package/utils/authWrapper.js +1 -1
- package/utils/callNativeEvent.js +16 -0
- package/utils/checkStore.js +21 -0
- package/utils/common.js +2 -2
- package/utils/customAuthWrapper.js +62 -0
- package/utils/customConnectedAuthWrapper.js +26 -0
- package/utils/tagValidations.js +1 -1
- package/utils/tests/checkStore.test.js +1 -1
- package/utils/tests/customAuth.test.js +1 -1
- package/utils/transformerUtils.js +195 -1
- package/v2Components/CapTagList/index.js +14 -9
- package/v2Components/Carousel/style.scss +1 -1
- package/v2Components/EmailMobilePreview/index.js +2 -2
- package/v2Components/FormBuilder/index.js +2 -2
- package/v2Components/TemplatePreview/index.js +1 -2
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/Line/Container/Text/index.js +6 -6
- package/v2Containers/Sms/Create/index.js +2 -2
- package/v2Containers/Sms/Edit/index.js +1 -1
- package/v2Containers/TagList/index.js +1 -1
- package/v2Containers/TagList/utils.js +1 -1
- package/v2Containers/Templates/index.js +1 -1
- package/v2Containers/Templates/sagas.js +1 -1
- package/constants/unified.js +0 -189
package/routes.js
CHANGED
|
@@ -1,146 +1,212 @@
|
|
|
1
1
|
import withReactRouterV3Compatibility from './hoc/withReactRouterV3Compatibility';
|
|
2
|
-
|
|
2
|
+
import Dashboard from './containers/Dashboard';
|
|
3
|
+
import SmsCreate from './containers/Sms/Create';
|
|
4
|
+
import SmsEdit from './containers/Sms/Edit';
|
|
5
|
+
import Templates from './containers/Templates';
|
|
6
|
+
import Gallary from './containers/Assets/Gallery';
|
|
7
|
+
import WeChatMapTemplate from './containers/WeChat/MapTemplates';
|
|
8
|
+
import WeChatRichmediaCreate from './containers/WeChat/RichmediaTemplates/Create';
|
|
9
|
+
import WeChatRichmediaEdit from './containers/WeChat/RichmediaTemplates/Edit';
|
|
10
|
+
import Email from './containers/Email';
|
|
11
|
+
import Ebill from './containers/Ebill';
|
|
12
|
+
import MobilePushCreate from './containers/MobilePush/Create';
|
|
13
|
+
import MobilePushEdit from './containers/MobilePush/Edit';
|
|
14
|
+
import LineCreate from './containers/Line/Create';
|
|
3
15
|
import SomethingWentWrong from '@capillarytech/cap-ui-library/CapSomethingWentWrong';
|
|
4
|
-
import NotFoundPage from './
|
|
16
|
+
import NotFoundPage from './containers/NotFoundPage';
|
|
5
17
|
import TemplatesV2 from './v2Containers/TemplatesV2';
|
|
18
|
+
import { updateCharCount } from './utils/smsCharCountV2';
|
|
6
19
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
routes
|
|
20
|
+
const routes = [
|
|
21
|
+
{
|
|
22
|
+
exact: true,
|
|
23
|
+
path: '/',
|
|
24
|
+
component: withReactRouterV3Compatibility(Dashboard),
|
|
25
|
+
},
|
|
26
|
+
//sms routes v1
|
|
27
|
+
{
|
|
28
|
+
exact: true,
|
|
29
|
+
path: '/sms/create',
|
|
30
|
+
name: 'create',
|
|
31
|
+
component: withReactRouterV3Compatibility(SmsCreate),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
exact: true,
|
|
35
|
+
path: '/sms/view',
|
|
36
|
+
name: 'view',
|
|
37
|
+
component: withReactRouterV3Compatibility(SmsCreate),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
exact: true,
|
|
41
|
+
path: '/sms/edit/:id',
|
|
42
|
+
name: 'edit',
|
|
43
|
+
component: withReactRouterV3Compatibility(SmsEdit),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
exact: true,
|
|
47
|
+
path: '/sms',
|
|
48
|
+
name: 'sms',
|
|
49
|
+
component: withReactRouterV3Compatibility(Templates),
|
|
50
|
+
},
|
|
51
|
+
//wechat routes v1
|
|
52
|
+
{
|
|
53
|
+
exact: true,
|
|
54
|
+
path: '/wechat',
|
|
55
|
+
name: 'wechat',
|
|
56
|
+
component: withReactRouterV3Compatibility(Templates),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
exact: true,
|
|
60
|
+
path: '/wechat/create',
|
|
61
|
+
name: 'create weChat',
|
|
62
|
+
component: withReactRouterV3Compatibility(WeChatMapTemplate),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
exact: true,
|
|
66
|
+
path: '/wechat/edit/:id',
|
|
67
|
+
name: 'edit weChat',
|
|
68
|
+
component: withReactRouterV3Compatibility(WeChatMapTemplate),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
exact: true,
|
|
72
|
+
path: '/wechat/richmedia/create',
|
|
73
|
+
name: 'wechat_richmedia_create',
|
|
74
|
+
component: withReactRouterV3Compatibility(WeChatRichmediaCreate),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
exact: true,
|
|
78
|
+
path: '/wechat/richmedia/edit/:id',
|
|
79
|
+
name: 'wechat_richmedia_edit',
|
|
80
|
+
component: withReactRouterV3Compatibility(WeChatRichmediaEdit),
|
|
81
|
+
},
|
|
82
|
+
//email routes v1
|
|
83
|
+
{
|
|
84
|
+
exact: true,
|
|
85
|
+
path: '/email',
|
|
86
|
+
name: 'email',
|
|
87
|
+
component: withReactRouterV3Compatibility(Templates),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
exact: true,
|
|
91
|
+
path: '/email/create',
|
|
92
|
+
name: 'EmailCreate',
|
|
93
|
+
component: withReactRouterV3Compatibility(Email),
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
exact: true,
|
|
97
|
+
path: '/email/view',
|
|
98
|
+
name: 'EmailView',
|
|
99
|
+
component: withReactRouterV3Compatibility(Email),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
exact: true,
|
|
103
|
+
path: '/email/edit/:id',
|
|
104
|
+
name: 'EmailEdit',
|
|
105
|
+
component: withReactRouterV3Compatibility(Email),
|
|
106
|
+
},
|
|
107
|
+
//ebill routes v1
|
|
108
|
+
{
|
|
109
|
+
exact: true,
|
|
110
|
+
path: '/ebill',
|
|
111
|
+
name: 'Ebill',
|
|
112
|
+
component: withReactRouterV3Compatibility(Templates),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
exact: true,
|
|
116
|
+
path: '/ebill/create',
|
|
117
|
+
name: 'Ebill',
|
|
118
|
+
component: withReactRouterV3Compatibility(Ebill),
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
exact: true,
|
|
122
|
+
path: '/ebill/edit/:id',
|
|
123
|
+
name: 'Ebill',
|
|
124
|
+
component: withReactRouterV3Compatibility(Ebill),
|
|
125
|
+
},
|
|
126
|
+
//mobilepush routes v1
|
|
127
|
+
{
|
|
128
|
+
exact: true,
|
|
129
|
+
path: '/mobilepush',
|
|
130
|
+
name: 'mobilepush',
|
|
131
|
+
component: withReactRouterV3Compatibility(Templates),
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
exact: true,
|
|
135
|
+
path: '/mobilepush/create/:mode',
|
|
136
|
+
name: 'create',
|
|
137
|
+
component: withReactRouterV3Compatibility(MobilePushCreate),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
exact: true,
|
|
141
|
+
path: '/mobilepush/edit/:id',
|
|
142
|
+
name: 'edit',
|
|
143
|
+
component: withReactRouterV3Compatibility(MobilePushEdit),
|
|
144
|
+
},
|
|
145
|
+
// assets routes v1
|
|
146
|
+
{
|
|
147
|
+
exact: true,
|
|
148
|
+
path: '/assets',
|
|
149
|
+
name: 'GALLERY',
|
|
150
|
+
component: withReactRouterV3Compatibility(Gallary),
|
|
151
|
+
},
|
|
152
|
+
// line routes v1
|
|
153
|
+
{
|
|
154
|
+
exact: true,
|
|
155
|
+
path: '/line',
|
|
156
|
+
name: 'line',
|
|
157
|
+
component: withReactRouterV3Compatibility(Templates),
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
exact: true,
|
|
161
|
+
path: '/line/create/:mode',
|
|
162
|
+
name: 'create line',
|
|
163
|
+
component: withReactRouterV3Compatibility(LineCreate),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
exact: true,
|
|
167
|
+
path: '/line/view/:mode',
|
|
168
|
+
name: 'view',
|
|
169
|
+
component: withReactRouterV3Compatibility(LineCreate),
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
exact: true,
|
|
173
|
+
path: '/line/edit/text/:id',
|
|
174
|
+
name: 'edit_text',
|
|
175
|
+
component: withReactRouterV3Compatibility(LineCreate),
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
exact: true,
|
|
179
|
+
path: '/line/edit/image/:id',
|
|
180
|
+
name: 'edit_image',
|
|
181
|
+
component: withReactRouterV3Compatibility(LineCreate),
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
exact: true,
|
|
185
|
+
path: '/v2/somethingwentwrong',
|
|
186
|
+
name: 'somethingwentwrong',
|
|
187
|
+
component: withReactRouterV3Compatibility(SomethingWentWrong),
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
exact: true,
|
|
191
|
+
path: '/v2',
|
|
192
|
+
name: 'templatesV2',
|
|
193
|
+
component: withReactRouterV3Compatibility(TemplatesV2),
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
exact: true,
|
|
197
|
+
path: '/v2/loyalty',
|
|
198
|
+
name: 'loyalty',
|
|
199
|
+
component: withReactRouterV3Compatibility(TemplatesV2),
|
|
200
|
+
},
|
|
201
|
+
{
|
|
133
202
|
path: '*',
|
|
134
203
|
name: 'notfound',
|
|
135
204
|
component: withReactRouterV3Compatibility(NotFoundPage),
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return routes;
|
|
139
|
-
};
|
|
205
|
+
},
|
|
206
|
+
];
|
|
140
207
|
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
208
|
+
// export function createRoutes(store) {
|
|
209
|
+
// updateCharCount("", false); // TODO:: React18, need to see why this call was made from here and can we remove this?
|
|
210
|
+
// }
|
|
144
211
|
|
|
145
|
-
// Export the routes array
|
|
146
212
|
export default routes;
|
package/services/getSchema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {SMS, EMAIL, MOBILE_PUSH, WECHAT, LINE} from '../v2Containers/CreativesContainer/constants';
|
|
2
2
|
export default function getSchema(channel) {
|
|
3
3
|
let schemaPath = '../containers/';
|
|
4
4
|
switch (channel.toUpperCase()) {
|
package/tests/i18n.test.js
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import conformsTo from 'lodash/conformsTo';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isFunction from 'lodash/isFunction';
|
|
4
|
+
import isObject from 'lodash/isObject';
|
|
5
|
+
import isString from 'lodash/isString';
|
|
6
|
+
import invariant from 'invariant';
|
|
7
|
+
import warning from 'warning';
|
|
8
|
+
import createReducer from 'reducers';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Validate the shape of redux store
|
|
12
|
+
*/
|
|
13
|
+
export function checkStore(store) {
|
|
14
|
+
const shape = {
|
|
15
|
+
dispatch: isFunction,
|
|
16
|
+
subscribe: isFunction,
|
|
17
|
+
getState: isFunction,
|
|
18
|
+
replaceReducer: isFunction,
|
|
19
|
+
runSaga: isFunction,
|
|
20
|
+
asyncReducers: isObject,
|
|
21
|
+
};
|
|
22
|
+
invariant(
|
|
23
|
+
conformsTo(store, shape),
|
|
24
|
+
'(app/utils...) asyncInjectors: Expected a valid redux store'
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Inject an asynchronously loaded reducer
|
|
30
|
+
*/
|
|
31
|
+
export function injectAsyncReducer(store, isValid) {
|
|
32
|
+
return function injectReducer(name, asyncReducer) {
|
|
33
|
+
if (!isValid) checkStore(store);
|
|
34
|
+
|
|
35
|
+
invariant(
|
|
36
|
+
isString(name) && !isEmpty(name) && isFunction(asyncReducer),
|
|
37
|
+
'(app/utils...) injectAsyncReducer: Expected `asyncReducer` to be a reducer function'
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (Reflect.has(store.asyncReducers, name)) return;
|
|
41
|
+
|
|
42
|
+
store.asyncReducers[name] = asyncReducer; // eslint-disable-line no-param-reassign
|
|
43
|
+
store.replaceReducer(createReducer(store.asyncReducers));
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Inject an asynchronously loaded saga
|
|
49
|
+
*/
|
|
50
|
+
export function injectAsyncSagas(store, isValid) {
|
|
51
|
+
return function injectSagas(sagas) {
|
|
52
|
+
if (!isValid) checkStore(store);
|
|
53
|
+
|
|
54
|
+
invariant(
|
|
55
|
+
Array.isArray(sagas),
|
|
56
|
+
'(app/utils...) injectAsyncSagas: Expected `sagas` to be an array of generator functions'
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
warning(
|
|
60
|
+
!isEmpty(sagas),
|
|
61
|
+
'(app/utils...) injectAsyncSagas: Received an empty `sagas` array'
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
sagas.map(store.runSaga);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Helper for creating injectors
|
|
70
|
+
*/
|
|
71
|
+
export function getAsyncInjectors(store) {
|
|
72
|
+
checkStore(store);
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
injectReducer: injectAsyncReducer(store, true),
|
|
76
|
+
injectSagas: injectAsyncSagas(store, true),
|
|
77
|
+
};
|
|
78
|
+
}
|
package/utils/authWrapper.js
CHANGED
|
@@ -8,7 +8,7 @@ import { routerActions } from 'connected-react-router';
|
|
|
8
8
|
// import { routerActions } from 'react-router-redux';
|
|
9
9
|
// import { UserAuthWrapper } from 'redux-auth-wrapper';
|
|
10
10
|
import { createSelector } from 'reselect';
|
|
11
|
-
import { makeSelectAuthenticated } from '../
|
|
11
|
+
import { makeSelectAuthenticated } from '../containers/Cap/selectors';
|
|
12
12
|
// import config from '../config/app';
|
|
13
13
|
const orginUrl = window.location.origin;
|
|
14
14
|
// const loginUrl = '/auth/login';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//https://github.com/facebook/react/issues/11488#issuecomment-470623779
|
|
2
|
+
export default function callNativeEvent({field, value, event}) {
|
|
3
|
+
//cuz in react 16 native events does not work
|
|
4
|
+
const ev = event;
|
|
5
|
+
const input = field;
|
|
6
|
+
const lastValue = input.value;
|
|
7
|
+
input.value = value;
|
|
8
|
+
// hack React15
|
|
9
|
+
ev.simulated = true;
|
|
10
|
+
// hack React16 内部定义了descriptor拦截value,此处重置状态
|
|
11
|
+
const tracker = input._valueTracker;
|
|
12
|
+
if (tracker) {
|
|
13
|
+
tracker.setValue(lastValue);
|
|
14
|
+
}
|
|
15
|
+
input.dispatchEvent(ev);
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { conformsTo, isFunction, isObject } from 'lodash';
|
|
2
|
+
import invariant from 'invariant';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validate the shape of redux store
|
|
6
|
+
*/
|
|
7
|
+
export default function checkStore(store) {
|
|
8
|
+
const shape = {
|
|
9
|
+
dispatch: isFunction,
|
|
10
|
+
subscribe: isFunction,
|
|
11
|
+
getState: isFunction,
|
|
12
|
+
replaceReducer: isFunction,
|
|
13
|
+
runSaga: isFunction,
|
|
14
|
+
injectedReducers: isObject,
|
|
15
|
+
injectedSagas: isObject,
|
|
16
|
+
};
|
|
17
|
+
invariant(
|
|
18
|
+
conformsTo(store, shape),
|
|
19
|
+
'(app/utils...) injectors: Expected a valid redux store',
|
|
20
|
+
);
|
|
21
|
+
}
|
package/utils/common.js
CHANGED
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
BADGES_ISSUE,
|
|
23
23
|
ENABLE_WECHAT,
|
|
24
24
|
LIQUID_SUPPORT,
|
|
25
|
-
ENABLE_NEW_MPUSH
|
|
26
|
-
} from '../constants
|
|
25
|
+
ENABLE_NEW_MPUSH,
|
|
26
|
+
} from '../containers/App/constants';
|
|
27
27
|
import { apiMessageFormatHandler } from './commonUtils';
|
|
28
28
|
|
|
29
29
|
export function getUserNameById(userId, allUserList) {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/* eslint-disable react/no-multi-comp */
|
|
3
|
+
/* eslint-disable react/prefer-stateless-function */
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import hoistStatics from 'hoist-non-react-statics';
|
|
7
|
+
|
|
8
|
+
const AuthenticatingComponentWithRef = React.forwardRef((props, ref) => (
|
|
9
|
+
<div ref={ref} />
|
|
10
|
+
));
|
|
11
|
+
const FailureComponentWithRef = React.forwardRef((props, ref) => (
|
|
12
|
+
<div ref={ref} />
|
|
13
|
+
));
|
|
14
|
+
const defaults = {
|
|
15
|
+
AuthenticatingComponent: AuthenticatingComponentWithRef, // dont render anything while authenticating
|
|
16
|
+
FailureComponent: FailureComponentWithRef, // dont render anything on failure of the predicate
|
|
17
|
+
wrapperDisplayName: 'AuthWrapper',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default args => {
|
|
21
|
+
const { AuthenticatingComponent, FailureComponent, wrapperDisplayName } = {
|
|
22
|
+
...defaults,
|
|
23
|
+
...args,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Wraps the component that needs the auth enforcement
|
|
27
|
+
return function wrapComponent(DecoratedComponent) {
|
|
28
|
+
const displayName =
|
|
29
|
+
DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
|
|
30
|
+
|
|
31
|
+
class UserAuthWrapper extends Component {
|
|
32
|
+
static displayName = `${wrapperDisplayName}(${displayName})`;
|
|
33
|
+
|
|
34
|
+
static propTypes = {
|
|
35
|
+
isAuthenticated: PropTypes.bool,
|
|
36
|
+
isAuthenticating: PropTypes.bool,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
static defaultProps = {
|
|
40
|
+
isAuthenticating: false,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
render() {
|
|
44
|
+
const { isAuthenticated, isAuthenticating, forwardedRef } = this.props;
|
|
45
|
+
if (isAuthenticated) {
|
|
46
|
+
return <DecoratedComponent {...this.props} ref={forwardedRef} />;
|
|
47
|
+
}
|
|
48
|
+
if (isAuthenticating) {
|
|
49
|
+
return <AuthenticatingComponent {...this.props} ref={forwardedRef} />;
|
|
50
|
+
}
|
|
51
|
+
return <FailureComponent {...this.props} ref={forwardedRef} />;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** forwardRef from HOC to the Wrapped Component */
|
|
56
|
+
const UserAuthWrapperWithRef = React.forwardRef((props, ref) => (
|
|
57
|
+
<UserAuthWrapper {...props} forwardedRef={ref} />
|
|
58
|
+
));
|
|
59
|
+
|
|
60
|
+
return hoistStatics(UserAuthWrapperWithRef, DecoratedComponent);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { connect } from 'react-redux';
|
|
2
|
+
|
|
3
|
+
import authWrapper from './customAuthWrapper';
|
|
4
|
+
|
|
5
|
+
const connectedDefaults = {
|
|
6
|
+
authenticatingSelector: () => false,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default args => {
|
|
10
|
+
const { authenticatedSelector, authenticatingSelector } = {
|
|
11
|
+
...connectedDefaults,
|
|
12
|
+
...args,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Passed withRef option set to true for forwarding Ref to Wrapped Component */
|
|
16
|
+
return DecoratedComponent =>
|
|
17
|
+
connect(
|
|
18
|
+
(state, ownProps) => ({
|
|
19
|
+
isAuthenticated: authenticatedSelector(state, ownProps),
|
|
20
|
+
isAuthenticating: authenticatingSelector(state, ownProps),
|
|
21
|
+
}),
|
|
22
|
+
null,
|
|
23
|
+
null,
|
|
24
|
+
{ withRef: true },
|
|
25
|
+
)(authWrapper(args)(DecoratedComponent));
|
|
26
|
+
};
|
package/utils/tagValidations.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import lodashForEach from 'lodash/forEach';
|
|
10
10
|
import lodashCloneDeep from 'lodash/cloneDeep';
|
|
11
|
-
import { ENTRY_TRIGGER_TAG_REGEX } from '../constants
|
|
11
|
+
import { ENTRY_TRIGGER_TAG_REGEX } from '../containers/App/constants';
|
|
12
12
|
|
|
13
13
|
const DEFAULT = 'default';
|
|
14
14
|
const SUBTAGS = 'subtags';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import UserAuthWrapper from '
|
|
3
|
+
import UserAuthWrapper from '../customAuthWrapper';
|
|
4
4
|
|
|
5
5
|
const MockComponent = React.forwardRef((props, ref) => <div ref={ref} {...props}>Mock Component</div>);
|
|
6
6
|
|