@capillarytech/creatives-library 2.0.84 → 2.0.86
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 +9 -2
- package/config/app.js +4 -4
- package/config/path.js +1 -0
- package/index.js +4 -4
- package/package.json +2 -3
- package/routes.js +5 -0
- package/v2Components/EmailPreviewV2/index.js +3 -3
- package/v2Components/FormBuilder/index.js +6 -6
- package/v2Components/NavigationBar/index.js +235 -0
- package/v2Components/NavigationBar/messages.js +20 -0
- package/v2Components/NavigationBar/tests/index.test.js +11 -0
- package/v2Components/TopBar/index.js +63 -106
- package/v2Components/TopBar/messages.js +8 -0
- package/v2Containers/CallTask/index.js +1 -1
- package/v2Containers/CallTask/sagas.js +1 -1
- package/v2Containers/Cap/actions.js +12 -0
- package/v2Containers/Cap/constants.js +10 -0
- package/v2Containers/Cap/index.js +26 -142
- package/v2Containers/Cap/reducer.js +14 -0
- package/v2Containers/Cap/sagas.js +24 -0
- package/v2Containers/Cap/tests/selectors.test.js +1 -1
- package/v2Containers/ChannelTemplates/sagas.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -0
- package/v2Containers/CreativesContainer/index.js +15 -2
- package/v2Containers/CreativesContainer/sagas.js +1 -1
- package/v2Containers/Dashboard/sagas.js +1 -1
- package/v2Containers/Ebill/constants.js +11 -11
- package/v2Containers/Ebill/index.js +1 -1
- package/v2Containers/Email/constants.js +24 -24
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/EmailWrapper/sagas.js +1 -1
- package/v2Containers/Line/Create/constants.js +22 -22
- package/v2Containers/Line/Create/index.js +1 -1
- package/v2Containers/Line/Edit/constants.js +16 -16
- package/v2Containers/Login/index.js +2 -2
- package/v2Containers/MobilePush/Create/constants.js +14 -14
- package/v2Containers/MobilePush/Create/index.js +1 -1
- package/v2Containers/MobilePush/Edit/constants.js +23 -23
- package/v2Containers/MobilepushWrapper/index.js +8 -0
- package/v2Containers/Sms/Create/constants.js +6 -6
- package/v2Containers/Sms/Create/index.js +6 -5
- package/v2Containers/Sms/Create/messages.js +8 -0
- package/v2Containers/Sms/Edit/constants.js +8 -8
- package/v2Containers/Sms/Edit/index.js +6 -6
- package/v2Containers/Sms/commonMethods.js +18 -0
- package/v2Containers/TagList/index.js +1 -1
- package/v2Containers/TagList/sagas.js +1 -1
- package/v2Containers/Templates/constants.js +37 -37
- package/v2Containers/Templates/index.js +6 -1
- package/v2Containers/TestPage/constants.js +1 -1
- package/v2Containers/TestPage/sagas.js +1 -1
- package/v2Containers/Testv2/sagas.js +1 -1
- package/v2Containers/WeChat/MapTemplates/constants.js +16 -16
- package/v2Containers/WeChat/MapTemplates/index.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/constants.js +9 -9
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +2 -2
- package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/constants.js +3 -3
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/View/sagas.js +1 -1
- package/assets/android-message-gui-2.svg +0 -55
- package/components/CallTaskPreview/_callTaskPreview.scss +0 -17
- package/components/CallTaskPreview/images/Footer.png +0 -0
- package/components/CallTaskPreview/images/Header.png +0 -0
- package/components/CallTaskPreview/index.js +0 -37
- package/components/CallTaskPreview/messages.js +0 -13
- package/components/CallTaskPreview/tests/index.test.js +0 -15
- package/components/CmsTemplatesComponent/index.js +0 -33
- package/components/CmsTemplatesComponent/messages.js +0 -17
- package/components/CmsTemplatesComponent/tests/index.test.js +0 -10
- package/components/EmailMobilePreview/index.js +0 -129
- package/components/EmailMobilePreview/index.scss +0 -55
- package/components/EmailPreviewV2/_emailPreviewV2.scss +0 -69
- package/components/EmailPreviewV2/index.js +0 -132
- package/components/EmailPreviewV2/messages.js +0 -41
- package/components/EmailPreviewV2/tests/index.test.js +0 -10
- package/components/MobilePushPreviewV2/index.js +0 -120
- package/components/MobilePushPreviewV2/messages.js +0 -13
- package/components/MobilePushPreviewV2/tests/index.test.js +0 -10
- package/components/NewCallTask/_newCallTask.scss +0 -9
- package/components/NewCallTask/index.js +0 -152
- package/components/NewCallTask/messages.js +0 -29
- package/components/NewCallTask/tests/index.test.js +0 -10
- package/components/SmsPreviewV2/_smsPreviewV2.scss +0 -353
- package/components/SmsPreviewV2/index.js +0 -69
- package/components/SmsPreviewV2/messages.js +0 -13
- package/components/SmsPreviewV2/tests/index.test.js +0 -10
|
@@ -22,3 +22,13 @@ export const CLEAR_META_ENTITIES = 'cap/CLEAR_META_ENTITIES';
|
|
|
22
22
|
export const HIDE_TAGS = 'cap/HIDE_TAGS';
|
|
23
23
|
|
|
24
24
|
export const SET_INJECTED_TAGS = 'cap/SET_INJECTED_TAGS';
|
|
25
|
+
|
|
26
|
+
export const GET_TOPBAR_MENU_DATA_REQUEST = 'creatives/cap/GET_TOPBAR_MENU_DATA_REQUEST';
|
|
27
|
+
export const GET_TOPBAR_MENU_DATA_SUCCESS = 'creatives/cap/GET_TOPBAR_MENU_DATA_SUCCESS';
|
|
28
|
+
export const GET_TOPBAR_MENU_DATA_FAILURE = 'creatives/cap/GET_TOPBAR_MENU_DATA_FAILURE';
|
|
29
|
+
export const CLEAR_TOPBAR_MENU_DATA = 'creatives/cap/CLEAR_TOPBAR_MENU_DATA';
|
|
30
|
+
|
|
31
|
+
export const CAMPAIGN_SETTINGS_URL = '/campaign/settings/message?from="/creatives/ui/v2/"';
|
|
32
|
+
export const BRAND_SETTINGS_URL = '/org/index';
|
|
33
|
+
export const PROFILE_SETTINGS_URL = '/org/users/NewProfile';
|
|
34
|
+
export const HELP_URL = 'https://support.capillarytech.com';
|
|
@@ -2,25 +2,27 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Helmet from 'react-helmet';
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
|
-
// import { Link } from 'react-router';
|
|
6
|
-
// import { Icon } from 'semantic-ui-react';
|
|
7
5
|
import { bindActionCreators } from 'redux';
|
|
8
6
|
import styled from 'styled-components';
|
|
9
7
|
import { createStructuredSelector } from 'reselect';
|
|
10
8
|
import _ from 'lodash';
|
|
11
9
|
import moment from 'moment';
|
|
12
10
|
import 'moment/locale/zh-cn';
|
|
13
|
-
import { injectIntl
|
|
11
|
+
import { injectIntl } from 'react-intl';
|
|
14
12
|
import {CapNotification} from '@capillarytech/cap-ui-library';
|
|
15
|
-
import TopBar from '../../v2Components/TopBar';
|
|
16
|
-
// import 'moment/locale/en-us';
|
|
17
|
-
import Sidebar from '../../v2Components/Sidebar';
|
|
18
13
|
import { makeSelectAuthenticated, makeSelectUser } from './selectors';
|
|
19
14
|
import * as actions from './actions';
|
|
20
15
|
import * as locationActions from '../LanguageProvider/actions';
|
|
21
16
|
import * as appActions from '../App/actions';
|
|
22
17
|
import config from '../../config/app';
|
|
23
|
-
import
|
|
18
|
+
import NavigationBar from '../../v2Components/NavigationBar';
|
|
19
|
+
import { engagePlusPublicPath } from '../../config/path';
|
|
20
|
+
import {
|
|
21
|
+
HELP_URL,
|
|
22
|
+
PROFILE_SETTINGS_URL,
|
|
23
|
+
BRAND_SETTINGS_URL,
|
|
24
|
+
CAMPAIGN_SETTINGS_URL,
|
|
25
|
+
} from './constants';
|
|
24
26
|
const gtm = window.dataLayer || [];
|
|
25
27
|
|
|
26
28
|
const CapWrapper = styled.div`
|
|
@@ -36,7 +38,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
36
38
|
constructor(props) {
|
|
37
39
|
super(props);
|
|
38
40
|
this.state = {
|
|
39
|
-
menuData: [],
|
|
40
41
|
switchedOrg: false,
|
|
41
42
|
};
|
|
42
43
|
this.changeOrg = this.changeOrg.bind(this);
|
|
@@ -47,6 +48,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
47
48
|
|
|
48
49
|
componentWillMount() {
|
|
49
50
|
this.props.actions.getUserData();
|
|
51
|
+
this.props.actions.getTopbarMenuData();
|
|
50
52
|
if (this.props.Global.user) {
|
|
51
53
|
const userGtmData = this.getUserGtmData(this.props);
|
|
52
54
|
gtm.push(userGtmData);
|
|
@@ -109,43 +111,9 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
109
111
|
|
|
110
112
|
componentWillUnmount() {
|
|
111
113
|
this.setState({ switchedOrg: false });
|
|
114
|
+
this.props.actions.clearTopbarMenuData();
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
// getSideBarData(reportData) {
|
|
115
|
-
// const tmpMenuData = [];
|
|
116
|
-
// const categoryId = reportData.categories ? Object.keys(reportData.categories) : [];
|
|
117
|
-
// _.forEach(categoryId, (id) => {
|
|
118
|
-
// const groupReport = {
|
|
119
|
-
// group: reportData.categories[id].name,
|
|
120
|
-
// items: [],
|
|
121
|
-
// };
|
|
122
|
-
// _.forEach(reportData.reportList, (report, reportId) => {
|
|
123
|
-
// if (report.category === id) {
|
|
124
|
-
// groupReport.items.push({
|
|
125
|
-
// link: `/report/${reportId}`,
|
|
126
|
-
// text: report.name,
|
|
127
|
-
// });
|
|
128
|
-
// }
|
|
129
|
-
// });
|
|
130
|
-
// tmpMenuData.push(groupReport);
|
|
131
|
-
// });
|
|
132
|
-
// const menuLibrary = {
|
|
133
|
-
// group: 'Library',
|
|
134
|
-
// items: [
|
|
135
|
-
// {
|
|
136
|
-
// link: '/library/charts',
|
|
137
|
-
// text: 'Charts',
|
|
138
|
-
// },
|
|
139
|
-
// {
|
|
140
|
-
// link: '/library/dimension',
|
|
141
|
-
// text: 'Dimensions',
|
|
142
|
-
// },
|
|
143
|
-
// ],
|
|
144
|
-
// };
|
|
145
|
-
// tmpMenuData.push(menuLibrary);
|
|
146
|
-
// this.setState({ menuData: tmpMenuData });
|
|
147
|
-
// }
|
|
148
|
-
|
|
149
117
|
getUserGtmData = (props) => {
|
|
150
118
|
const { user: userData } = props.Global;
|
|
151
119
|
const userName = userData.attributes.USERNAME;
|
|
@@ -174,7 +142,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
174
142
|
}
|
|
175
143
|
|
|
176
144
|
navigateToDashboard() {
|
|
177
|
-
const dashboardUrl = process.env.NODE_ENV === 'production' ? config.production.
|
|
145
|
+
const dashboardUrl = process.env.NODE_ENV === 'production' ? config.production.dashboard_url_v2 : config.development.dashboard_url_v2;
|
|
178
146
|
this.props.router.push({ pathname: dashboardUrl, state: {} });
|
|
179
147
|
this.props.router.go(dashboardUrl);
|
|
180
148
|
}
|
|
@@ -184,94 +152,15 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
184
152
|
}
|
|
185
153
|
changeOrg(orgId) {
|
|
186
154
|
this.props.actions.changeOrg(orgId);
|
|
187
|
-
|
|
155
|
+
this.navigateToDashboard();
|
|
188
156
|
}
|
|
189
157
|
|
|
190
158
|
render() {
|
|
191
|
-
const
|
|
159
|
+
const { Global, location } = this.props;
|
|
160
|
+
const { topbarMenuData, isLoggedIn } = Global;
|
|
161
|
+
const topbarMenuDataOptions = topbarMenuData && topbarMenuData.data ? topbarMenuData.data : [];
|
|
192
162
|
const type = this.props.location.query.type;
|
|
193
|
-
// const changeOrg = this.props.actions.changeOrg;
|
|
194
|
-
// const logout = this.props.actions.logout;
|
|
195
|
-
console.log('props', this.props);
|
|
196
|
-
const proxyOrgList = [];
|
|
197
|
-
let defaultOrgName = '';
|
|
198
|
-
let defaultOrgId = '';
|
|
199
|
-
let userName = '';
|
|
200
|
-
const navigateToDashboard = this.navigateToDashboard;
|
|
201
|
-
if (userData && userData.user && userData.user !== '') {
|
|
202
|
-
console.log('Org name ', userData.user.orgName, userData.user.orgID);
|
|
203
|
-
defaultOrgName = userData.user.orgName;
|
|
204
|
-
defaultOrgId = userData.user.orgID;
|
|
205
|
-
proxyOrgList.push({ text: defaultOrgName, value: defaultOrgId });
|
|
206
|
-
const orgList = userData.user.proxyOrgList;
|
|
207
|
-
if (!_.isEmpty(orgList)) {
|
|
208
|
-
_.forEach(orgList, (item) => {
|
|
209
|
-
const id = item.orgID;
|
|
210
|
-
let name = item.orgName;
|
|
211
|
-
if (id === 486) {
|
|
212
|
-
name = 'Demo Org';
|
|
213
|
-
}
|
|
214
|
-
proxyOrgList.push({ key: id, text: name, value: id });
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
userName = userData.user.firstName;
|
|
218
|
-
}
|
|
219
|
-
const actionComponents = "";
|
|
220
163
|
const toastMessages = this.props.Global.messages;
|
|
221
|
-
const loggedIn = this.props.Global.isLoggedIn;
|
|
222
|
-
const menuData = [
|
|
223
|
-
{
|
|
224
|
-
group: this.props.intl.formatMessage(messages.creativesDashboard),
|
|
225
|
-
items: [
|
|
226
|
-
{
|
|
227
|
-
link: '/sms',
|
|
228
|
-
text: this.props.intl.formatMessage(messages.sms),
|
|
229
|
-
value: 'SMS',
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
link: '/wechat',
|
|
233
|
-
text: this.props.intl.formatMessage(messages.wechat),
|
|
234
|
-
value: 'WECHAT',
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
link: '/mobilepush',
|
|
238
|
-
text: 'Mobile Push',
|
|
239
|
-
value: 'MOBILEPUSH',
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
link: '/assets',
|
|
243
|
-
text: this.props.intl.formatMessage(messages.gallery),
|
|
244
|
-
value: 'GALLERY',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
link: '/email',
|
|
248
|
-
text: this.props.intl.formatMessage(messages.email),
|
|
249
|
-
value: 'EMAIL',
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
link: '/ebill',
|
|
253
|
-
text: this.props.intl.formatMessage(messages.ebill),
|
|
254
|
-
value: 'EBILL',
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
link: '/line',
|
|
258
|
-
text: 'Line',
|
|
259
|
-
value: 'LINE',
|
|
260
|
-
},
|
|
261
|
-
],
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
group: this.props.intl.formatMessage(messages.campaignsDashboard),
|
|
265
|
-
items: [
|
|
266
|
-
{
|
|
267
|
-
link: '/campaign/index',
|
|
268
|
-
text: this.props.intl.formatMessage(messages.campaignsHome),
|
|
269
|
-
value: 'Campaigns Home',
|
|
270
|
-
external: true,
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
},
|
|
274
|
-
];
|
|
275
164
|
return (
|
|
276
165
|
<CapWrapper>
|
|
277
166
|
<Helmet
|
|
@@ -282,24 +171,20 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
282
171
|
]}
|
|
283
172
|
/>
|
|
284
173
|
<div className="wrapper">
|
|
285
|
-
{
|
|
286
|
-
<
|
|
287
|
-
|
|
288
|
-
userName={userName}
|
|
289
|
-
orgName={defaultOrgName}
|
|
290
|
-
orgID={defaultOrgId}
|
|
174
|
+
{isLoggedIn && type !== 'embedded' ?
|
|
175
|
+
<NavigationBar
|
|
176
|
+
userData={Global}
|
|
291
177
|
changeOrg={this.changeOrg}
|
|
292
|
-
navigateToDashboard={navigateToDashboard}
|
|
293
178
|
logout={this.logout}
|
|
179
|
+
settingsUrl={`${engagePlusPublicPath}${CAMPAIGN_SETTINGS_URL}`}
|
|
180
|
+
brandSettingsUrl={BRAND_SETTINGS_URL}
|
|
181
|
+
profileSettingsUrl={PROFILE_SETTINGS_URL}
|
|
182
|
+
helpUrl={HELP_URL}
|
|
183
|
+
loggedIn={isLoggedIn}
|
|
184
|
+
topbarMenuData={topbarMenuDataOptions}
|
|
185
|
+
location={location}
|
|
294
186
|
/> : ''}
|
|
295
187
|
<div className="main">
|
|
296
|
-
{loggedIn && type !== 'embedded' && this.props.location.pathname.indexOf('v2') === -1 ? <div id="cap-sidebar" className={'sidebar'}>
|
|
297
|
-
<Sidebar
|
|
298
|
-
menuData={menuData}
|
|
299
|
-
actionComponents={actionComponents}
|
|
300
|
-
router={this.props.router}
|
|
301
|
-
/>
|
|
302
|
-
</div> : '' }
|
|
303
188
|
<div className="main-content">
|
|
304
189
|
{React.Children.toArray(this.props.children)}
|
|
305
190
|
</div>
|
|
@@ -330,7 +215,6 @@ Cap.propTypes = {
|
|
|
330
215
|
appActions: PropTypes.object,
|
|
331
216
|
locationActions: PropTypes.object,
|
|
332
217
|
location: PropTypes.object,
|
|
333
|
-
intl: intlShape.isRequired,
|
|
334
218
|
};
|
|
335
219
|
|
|
336
220
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -103,6 +103,20 @@ function capReducer(state = fromJS(initialState.cap), action) {
|
|
|
103
103
|
return state.setIn(['metaEntities'], metaEntities);
|
|
104
104
|
case types.SET_INJECTED_TAGS:
|
|
105
105
|
return state.set('injectedTags', action.injectedTags);
|
|
106
|
+
case types.GET_TOPBAR_MENU_DATA_REQUEST:
|
|
107
|
+
return state.set('topbarMenuData', fromJS({ status: 'request' }));
|
|
108
|
+
case types.GET_TOPBAR_MENU_DATA_SUCCESS:
|
|
109
|
+
return state.set(
|
|
110
|
+
'topbarMenuData',
|
|
111
|
+
fromJS({ status: 'success', data: action.data }),
|
|
112
|
+
);
|
|
113
|
+
case types.GET_TOPBAR_MENU_DATA_FAILURE:
|
|
114
|
+
return state.set(
|
|
115
|
+
'topbarMenuData',
|
|
116
|
+
fromJS({ status: 'failure', error: action.error }),
|
|
117
|
+
);
|
|
118
|
+
case types.CLEAR_TOPBAR_MENU_DATA:
|
|
119
|
+
return state.set('topbarMenuData', fromJS({}));
|
|
106
120
|
default:
|
|
107
121
|
return state;
|
|
108
122
|
}
|
|
@@ -112,6 +112,17 @@ export function* fetchSchemaForEntity(queryParams) {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
function* getTopbarMenuData() {
|
|
116
|
+
try {
|
|
117
|
+
yield put({
|
|
118
|
+
type: types.GET_TOPBAR_MENU_DATA_SUCCESS,
|
|
119
|
+
data: getTopbarMenuDataValue(),
|
|
120
|
+
});
|
|
121
|
+
} catch (error) {
|
|
122
|
+
yield put({ type: types.GET_TOPBAR_MENU_DATA_FAILURE, error });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
115
126
|
|
|
116
127
|
function* watchFetchSchemaForEntity() {
|
|
117
128
|
console.log('inside watch get schema');
|
|
@@ -133,6 +144,9 @@ function* watchForFetchUserInfo() {
|
|
|
133
144
|
yield takeLatest(types.GET_USER_DATA_REQUEST, fetchUserInfo);
|
|
134
145
|
}
|
|
135
146
|
|
|
147
|
+
function* watchGetTopbarMenuData() {
|
|
148
|
+
yield takeLatest(types.GET_TOPBAR_MENU_DATA_REQUEST, getTopbarMenuData);
|
|
149
|
+
}
|
|
136
150
|
|
|
137
151
|
export default [
|
|
138
152
|
loginFlow,
|
|
@@ -140,4 +154,14 @@ export default [
|
|
|
140
154
|
watchForLogoutFlow,
|
|
141
155
|
watchForFetchUserInfo,
|
|
142
156
|
watchFetchSchemaForEntity,
|
|
157
|
+
watchGetTopbarMenuData,
|
|
143
158
|
];
|
|
159
|
+
|
|
160
|
+
function getTopbarMenuDataValue() {
|
|
161
|
+
return [
|
|
162
|
+
{ label: 'Campaigns', link: '/campaigns/ui/list', key: 'campaigns' },
|
|
163
|
+
{ label: 'Audience', link: '/audience-manager/list', key: 'audience' },
|
|
164
|
+
{ label: 'Incentive', link: '/coupons/ui/', key: 'incentive' },
|
|
165
|
+
{ label: 'Creatives', link: '/creatives/ui/v2', key: 'creatives' },
|
|
166
|
+
];
|
|
167
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fromJS } from 'immutable';
|
|
2
2
|
|
|
3
|
-
import { makeSelectLocationState } from '
|
|
3
|
+
import { makeSelectLocationState } from 'v2Containers/Cap/selectors';
|
|
4
4
|
|
|
5
5
|
describe('makeSelectLocationState', () => {
|
|
6
6
|
it('should select the route as a plain JS object', () => {
|
|
@@ -6,7 +6,7 @@ import * as Api from '../../services/api';
|
|
|
6
6
|
import * as types from './constants';
|
|
7
7
|
// Individual exports for testing
|
|
8
8
|
export function* defaultSaga() {
|
|
9
|
-
// See example in
|
|
9
|
+
// See example in v2Containers/HomePage/sagas.js
|
|
10
10
|
}
|
|
11
11
|
function* getTemplates(action) {
|
|
12
12
|
try {
|
|
@@ -38,6 +38,8 @@ function SlideBoxContent(props) {
|
|
|
38
38
|
onMobilepushModeChange,
|
|
39
39
|
mobilePushCreateMode,
|
|
40
40
|
templateStep,
|
|
41
|
+
onEnterTemplateName,
|
|
42
|
+
onRemoveTemplateName,
|
|
41
43
|
onCreateNextStep,
|
|
42
44
|
cap,
|
|
43
45
|
onResetStep,
|
|
@@ -222,6 +224,8 @@ function SlideBoxContent(props) {
|
|
|
222
224
|
step={templateStep}
|
|
223
225
|
showNextStep={onCreateNextStep}
|
|
224
226
|
isFullMode={isFullMode}
|
|
227
|
+
onEnterTemplateName={onEnterTemplateName}
|
|
228
|
+
onRemoveTemplateName={onRemoveTemplateName}
|
|
225
229
|
cap={cap}
|
|
226
230
|
onResetStep={onResetStep}
|
|
227
231
|
showTemplateName={showTemplateName}
|
|
@@ -246,6 +250,8 @@ SlideBoxContent.propTypes = {
|
|
|
246
250
|
emailCreateMode: PropTypes.string,
|
|
247
251
|
templateStep: PropTypes.string,
|
|
248
252
|
onCreateNextStep: PropTypes.func,
|
|
253
|
+
onEnterTemplateName: PropTypes.func,
|
|
254
|
+
onRemoveTemplateName: PropTypes.func,
|
|
249
255
|
cap: PropTypes.object,
|
|
250
256
|
onResetStep: PropTypes.func,
|
|
251
257
|
onCallTaskSubmit: PropTypes.func,
|
|
@@ -45,6 +45,7 @@ class Creatives extends React.Component {
|
|
|
45
45
|
showSlideBox: true,
|
|
46
46
|
slidBoxContent: this.getSlideBocContent({mode: props.creativesMode, templateData: props.templateData, isFullMode: props.isFullMode}),
|
|
47
47
|
templateData: this.getTemplateData(props.templateData),
|
|
48
|
+
templateNameExists: false,
|
|
48
49
|
currentChannel: this.props.channel || 'sms',
|
|
49
50
|
};
|
|
50
51
|
this.creativesTemplateSteps = {
|
|
@@ -60,6 +61,13 @@ class Creatives extends React.Component {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
onEnterTemplateName = () => {
|
|
65
|
+
this.setState({templateNameExists: true});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
onRemoveTemplateName = () => {
|
|
69
|
+
this.setState({templateNameExists: false});
|
|
70
|
+
}
|
|
63
71
|
|
|
64
72
|
onSelectTemplate = (template) => {
|
|
65
73
|
this.setState({ slidBoxContent: 'editTemplate', templateData: template });
|
|
@@ -276,7 +284,7 @@ class Creatives extends React.Component {
|
|
|
276
284
|
}
|
|
277
285
|
shouldShowFooter = () => {
|
|
278
286
|
const {isFullMode } = this.props;
|
|
279
|
-
const {slidBoxContent, currentChannel, emailCreateMode, templateStep, mobilePushCreateMode} = this.state;
|
|
287
|
+
const {slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode} = this.state;
|
|
280
288
|
const channel = currentChannel.toUpperCase();
|
|
281
289
|
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
282
290
|
let showFooter = false;
|
|
@@ -303,7 +311,10 @@ class Creatives extends React.Component {
|
|
|
303
311
|
if (slidBoxContent === "editTemplate" && ((channel === constants.EMAIL && currentStep === 'modeSelection'))) {
|
|
304
312
|
showFooter = true;
|
|
305
313
|
}
|
|
306
|
-
if (channel === constants.MOBILE_PUSH &&
|
|
314
|
+
if (channel === constants.MOBILE_PUSH &&
|
|
315
|
+
((slidBoxContent === 'createTemplate' && !isEmpty(mobilePushCreateMode))
|
|
316
|
+
|| (slidBoxContent === 'editTemplate' && currentStep === 'modeSelection')) &&
|
|
317
|
+
templateNameExists) {
|
|
307
318
|
showFooter = true;
|
|
308
319
|
}
|
|
309
320
|
|
|
@@ -421,6 +432,8 @@ class Creatives extends React.Component {
|
|
|
421
432
|
emailCreateMode={emailCreateMode}// upload zip || use editor are values
|
|
422
433
|
templateStep={this.creativesTemplateSteps[templateStep]}
|
|
423
434
|
onCreateNextStep={this.onCreateNextStep}
|
|
435
|
+
onEnterTemplateName={this.onEnterTemplateName}
|
|
436
|
+
onRemoveTemplateName={this.onRemoveTemplateName}
|
|
424
437
|
onResetStep={this.resetStep}
|
|
425
438
|
cap={cap}
|
|
426
439
|
setIsLoadingContent={this.setIsLoadingContent}
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const CREATE_TEMPLATE_REQUEST = 'app/
|
|
8
|
-
export const CREATE_TEMPLATE_SUCCESS = 'app/
|
|
9
|
-
export const CREATE_TEMPLATE_FAILURE = 'app/
|
|
7
|
+
export const CREATE_TEMPLATE_REQUEST = 'app/v2Containers/Ebill/CREATE_TEMPLATE_REQUEST';
|
|
8
|
+
export const CREATE_TEMPLATE_SUCCESS = 'app/v2Containers/Ebill/CREATE_TEMPLATE_SUCCESS';
|
|
9
|
+
export const CREATE_TEMPLATE_FAILURE = 'app/v2Containers/Ebill/CREATE_TEMPLATE_FAILURE';
|
|
10
10
|
|
|
11
|
-
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/
|
|
12
|
-
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/
|
|
13
|
-
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/
|
|
11
|
+
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Ebill/GET_TEMPLATE_DETAILS_REQUEST';
|
|
12
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Ebill/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
13
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Ebill/GET_TEMPLATE_DETAILS_FAILURE';
|
|
14
14
|
|
|
15
|
-
export const GET_CMS_EDITOR_DATA_REQUEST = 'app/
|
|
16
|
-
export const GET_CMS_EDITOR_DATA_SUCCESS = 'app/
|
|
17
|
-
export const GET_CMS_EDITOR_DATA_FAILURE = 'app/
|
|
15
|
+
export const GET_CMS_EDITOR_DATA_REQUEST = 'app/v2Containers/Ebill/GET_CMS_EDITOR_DATA_REQUEST';
|
|
16
|
+
export const GET_CMS_EDITOR_DATA_SUCCESS = 'app/v2Containers/Ebill/GET_CMS_EDITOR_DATA_SUCCESS';
|
|
17
|
+
export const GET_CMS_EDITOR_DATA_FAILURE = 'app/v2Containers/Ebill/GET_CMS_EDITOR_DATA_FAILURE';
|
|
18
18
|
|
|
19
|
-
export const CLEAR_EBILL_CRUD_RESPONSE_REQUEST = 'app/
|
|
20
|
-
export const CLEAR_ALL_VALUES = "app/
|
|
19
|
+
export const CLEAR_EBILL_CRUD_RESPONSE_REQUEST = 'app/v2Containers/Ebill/CLEAR_EBILL_CRUD_RESPONSE_REQUEST';
|
|
20
|
+
export const CLEAR_ALL_VALUES = "app/v2Containers/Ebill/CLEAR_ALL_VALUES";
|
|
@@ -17,7 +17,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
17
17
|
import * as actions from './actions';
|
|
18
18
|
import FormBuilder from '../../v2Components/FormBuilder';
|
|
19
19
|
import { makeSelectMetaEntities, makeSelectAuthenticated, setInjectedTags } from '../Cap/selectors';
|
|
20
|
-
import * as globalActions from '
|
|
20
|
+
import * as globalActions from '../Cap/actions';
|
|
21
21
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
22
22
|
import { makeSelectTemplates } from '../Templates/selectors';
|
|
23
23
|
import {getMessageObject} from '../../utils/messageUtils';
|
|
@@ -4,34 +4,34 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export const CREATE_TEMPLATE_REQUEST = 'app/
|
|
8
|
-
export const CREATE_TEMPLATE_SUCCESS = 'app/
|
|
9
|
-
export const CREATE_TEMPLATE_FAILURE = 'app/
|
|
7
|
+
export const CREATE_TEMPLATE_REQUEST = 'app/v2Containers/Email/CREATE_TEMPLATE_REQUEST';
|
|
8
|
+
export const CREATE_TEMPLATE_SUCCESS = 'app/v2Containers/Email/CREATE_TEMPLATE_SUCCESS';
|
|
9
|
+
export const CREATE_TEMPLATE_FAILURE = 'app/v2Containers/Email/CREATE_TEMPLATE_FAILURE';
|
|
10
10
|
|
|
11
|
-
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/
|
|
12
|
-
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/
|
|
13
|
-
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/
|
|
11
|
+
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Email/GET_TEMPLATE_DETAILS_REQUEST';
|
|
12
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Email/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
13
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Email/GET_TEMPLATE_DETAILS_FAILURE';
|
|
14
14
|
|
|
15
|
-
export const GET_ALL_ASSETS_REQUEST = 'app/
|
|
16
|
-
export const GET_ALL_ASSETS_SUCCESS = 'app/
|
|
17
|
-
export const GET_ALL_ASSETS_FAILURE = 'app/
|
|
15
|
+
export const GET_ALL_ASSETS_REQUEST = 'app/v2Containers/Email/GET_ALL_ASSETS_REQUEST';
|
|
16
|
+
export const GET_ALL_ASSETS_SUCCESS = 'app/v2Containers/Email/GET_ALL_ASSETS_SUCCESS';
|
|
17
|
+
export const GET_ALL_ASSETS_FAILURE = 'app/v2Containers/Email/GET_ALL_ASSETS_FAILURE';
|
|
18
18
|
|
|
19
|
-
export const GET_CMS_EDITOR_DETAILS_REQUEST = 'app/
|
|
20
|
-
export const GET_CMS_EDITOR_DETAILS_SUCCESS = 'app/
|
|
21
|
-
export const GET_CMS_EDITOR_DETAILS_FAILURE = 'app/
|
|
19
|
+
export const GET_CMS_EDITOR_DETAILS_REQUEST = 'app/v2Containers/Email/GET_CMS_EDITOR_DETAILS_REQUEST';
|
|
20
|
+
export const GET_CMS_EDITOR_DETAILS_SUCCESS = 'app/v2Containers/Email/GET_CMS_EDITOR_DETAILS_SUCCESS';
|
|
21
|
+
export const GET_CMS_EDITOR_DETAILS_FAILURE = 'app/v2Containers/Email/GET_CMS_EDITOR_DETAILS_FAILURE';
|
|
22
22
|
|
|
23
|
-
export const GET_CMS_EDITOR_DATA_REQUEST = 'app/
|
|
24
|
-
export const GET_CMS_EDITOR_DATA_SUCCESS = 'app/
|
|
25
|
-
export const GET_CMS_EDITOR_DATA_FAILURE = 'app/
|
|
26
|
-
export const RESET_CMS_EDITOR_DATA = 'app/
|
|
23
|
+
export const GET_CMS_EDITOR_DATA_REQUEST = 'app/v2Containers/Email/GET_CMS_EDITOR_DATA_REQUEST';
|
|
24
|
+
export const GET_CMS_EDITOR_DATA_SUCCESS = 'app/v2Containers/Email/GET_CMS_EDITOR_DATA_SUCCESS';
|
|
25
|
+
export const GET_CMS_EDITOR_DATA_FAILURE = 'app/v2Containers/Email/GET_CMS_EDITOR_DATA_FAILURE';
|
|
26
|
+
export const RESET_CMS_EDITOR_DATA = 'app/v2Containers/Email/RESET_CMS_EDITOR_DATA';
|
|
27
27
|
|
|
28
|
-
export const UPLOAD_ASSET_REQUEST = 'app/
|
|
29
|
-
export const UPLOAD_ASSET_SUCCESS = 'app/
|
|
30
|
-
export const UPLOAD_ASSET_FAILURE = 'app/
|
|
28
|
+
export const UPLOAD_ASSET_REQUEST = 'app/v2Containers/Email/UPLOAD_ASSET_REQUEST';
|
|
29
|
+
export const UPLOAD_ASSET_SUCCESS = 'app/v2Containers/Email/UPLOAD_ASSET_SUCCESS';
|
|
30
|
+
export const UPLOAD_ASSET_FAILURE = 'app/v2Containers/Email/UPLOAD_ASSET_FAILURE';
|
|
31
31
|
|
|
32
|
-
export const CLEAR_EMAIL_CRUD_RESPONSE_REQUEST = "app/
|
|
33
|
-
export const CLEAR_ALL_VALUES = "app/
|
|
32
|
+
export const CLEAR_EMAIL_CRUD_RESPONSE_REQUEST = "app/v2Containers/Email/CLEAR_EMAIL_CRUD_RESPONSE_REQUEST";
|
|
33
|
+
export const CLEAR_ALL_VALUES = "app/v2Containers/Email/CLEAR_ALL_VALUES";
|
|
34
34
|
|
|
35
|
-
export const DUPLICATE_TEMPLATE_REQUEST = 'app/
|
|
36
|
-
export const DUPLICATE_TEMPLATE_SUCCESS = 'app/
|
|
37
|
-
export const DUPLICATE_TEMPLATE_FAILURE = 'app/
|
|
35
|
+
export const DUPLICATE_TEMPLATE_REQUEST = 'app/v2Containers/Email/DUPLICATE_TEMPLATE_REQUEST';
|
|
36
|
+
export const DUPLICATE_TEMPLATE_SUCCESS = 'app/v2Containers/Email/DUPLICATE_TEMPLATE_SUCCESS';
|
|
37
|
+
export const DUPLICATE_TEMPLATE_FAILURE = 'app/v2Containers/Email/DUPLICATE_TEMPLATE_FAILURE';
|
|
@@ -19,7 +19,7 @@ import FormBuilder from '../../v2Components/FormBuilder';
|
|
|
19
19
|
import { makeSelectMetaEntities, selectCurrentOrgDetails, isLoadingMetaEntities, makeSelectAuthenticated, setInjectedTags } from '../Cap/selectors';
|
|
20
20
|
import * as actions from './actions';
|
|
21
21
|
import * as templatesActions from '../Templates/actions';
|
|
22
|
-
import * as globalActions from '
|
|
22
|
+
import * as globalActions from '../Cap/actions';
|
|
23
23
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
24
24
|
import {makeSelectEmail} from './selectors';
|
|
25
25
|
import { makeSelectTemplates } from '../Templates/selectors';
|
|
@@ -7,33 +7,33 @@
|
|
|
7
7
|
export const DEFAULT_ACTION = 'app/Create/DEFAULT_ACTION';
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
export const CREATE_TEMPLATE_REQUEST = 'app/
|
|
11
|
-
export const CREATE_TEMPLATE_SUCCESS = 'app/
|
|
12
|
-
export const CREATE_TEMPLATE_FAILURE = 'app/
|
|
13
|
-
export const UPLOAD_ASSET_REQUEST = 'app/
|
|
14
|
-
export const UPLOAD_ASSET_SUCCESS = 'app/
|
|
15
|
-
export const UPLOAD_ASSET_FAILURE = 'app/
|
|
16
|
-
export const CLEAR_ASSET = 'app/
|
|
10
|
+
export const CREATE_TEMPLATE_REQUEST = 'app/v2Containers/Line/Create/CREATE_TEMPLATE_REQUEST';
|
|
11
|
+
export const CREATE_TEMPLATE_SUCCESS = 'app/v2Containers/Line/Create/CREATE_TEMPLATE_SUCCESS';
|
|
12
|
+
export const CREATE_TEMPLATE_FAILURE = 'app/v2Containers/Line/Create/CREATE_TEMPLATE_FAILURE';
|
|
13
|
+
export const UPLOAD_ASSET_REQUEST = 'app/v2Containers/Line/Create/UPLOAD_ASSET_REQUEST';
|
|
14
|
+
export const UPLOAD_ASSET_SUCCESS = 'app/v2Containers/Line/Create/UPLOAD_ASSET_SUCCESS';
|
|
15
|
+
export const UPLOAD_ASSET_FAILURE = 'app/v2Containers/Line/Create/UPLOAD_ASSET_FAILURE';
|
|
16
|
+
export const CLEAR_ASSET = 'app/v2Containers/Line/Create/CLEAR_ASSET';
|
|
17
17
|
|
|
18
|
-
export const CLEAR_CREATE_RESPONSE_REQUEST = 'app/
|
|
19
|
-
export const CLEAR_CREATE_RESPONSE_SUCCESS = 'app/
|
|
20
|
-
export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/
|
|
18
|
+
export const CLEAR_CREATE_RESPONSE_REQUEST = 'app/v2Containers/Line/Create/CLEAR_CREATE_RESPONSE_REQUEST';
|
|
19
|
+
export const CLEAR_CREATE_RESPONSE_SUCCESS = 'app/v2Containers/Line/Create/CLEAR_CREATE_RESPONSE_SUCCESS';
|
|
20
|
+
export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/v2Containers/Line/Create/CLEAR_CREATE_RESPONSE_FAILURE';
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
// edit
|
|
24
24
|
|
|
25
|
-
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/
|
|
26
|
-
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/
|
|
27
|
-
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/
|
|
25
|
+
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_REQUEST';
|
|
26
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
27
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/line/Edit/GET_TEMPLATE_DETAILS_FAILURE';
|
|
28
28
|
|
|
29
|
-
export const EDIT_TEMPLATE_REQUEST = 'app/
|
|
30
|
-
export const EDIT_TEMPLATE_SUCCESS = 'app/
|
|
31
|
-
export const EDIT_TEMPLATE_FAILURE = 'app/
|
|
29
|
+
export const EDIT_TEMPLATE_REQUEST = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_REQUEST';
|
|
30
|
+
export const EDIT_TEMPLATE_SUCCESS = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_SUCCESS';
|
|
31
|
+
export const EDIT_TEMPLATE_FAILURE = 'app/v2Containers/line/Edit/EDIT_TEMPLATE_FAILURE';
|
|
32
32
|
|
|
33
|
-
export const CLEAR_EDIT_RESPONSE_REQUEST = 'app/
|
|
34
|
-
export const CLEAR_DATA = 'app/
|
|
35
|
-
export const SET_SELECTED_TEMPLATE = 'app/
|
|
33
|
+
export const CLEAR_EDIT_RESPONSE_REQUEST = 'app/v2Containers/line/Edit/CLEAR_EDIT_RESPONSE_REQUEST';
|
|
34
|
+
export const CLEAR_DATA = 'app/v2Containers/Line/Edit/CLEAR_DATA';
|
|
35
|
+
export const SET_SELECTED_TEMPLATE = 'app/v2Containers/Line/Edit/SET_SELECTED_TEMPLATE';
|
|
36
36
|
|
|
37
|
-
export const GET_LINE_TEMPLATES_LIST_REQUEST = 'app/
|
|
38
|
-
export const GET_LINE_TEMPLATES_LIST_SUCCESS = 'app/
|
|
39
|
-
export const GET_LINE_TEMPLATES_LIST_FAILURE = 'app/
|
|
37
|
+
export const GET_LINE_TEMPLATES_LIST_REQUEST = 'app/v2Containers/Line/GET_LINE_TEMPLATES_LIST_REQUEST';
|
|
38
|
+
export const GET_LINE_TEMPLATES_LIST_SUCCESS = 'app/v2Containers/Line/GET_LINE_TEMPLATES_LIST_SUCCESS';
|
|
39
|
+
export const GET_LINE_TEMPLATES_LIST_FAILURE = 'app/v2Containers/Line/GET_LINE_TEMPLATES_LIST_FAILURE';
|
|
@@ -10,7 +10,7 @@ import messages from './messages';
|
|
|
10
10
|
import * as actions from './actions';
|
|
11
11
|
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
12
12
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
13
|
-
import * as globalActions from '
|
|
13
|
+
import * as globalActions from '../../Cap/actions';
|
|
14
14
|
//import { makeSelectCreate, makeSelectCreateResponse, makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse } from './selectors';
|
|
15
15
|
import {makeSelectCreateLine} from './selectors';
|
|
16
16
|
import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
|