@capillarytech/creatives-library 2.0.84 → 2.0.85
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 -2
- package/routes.js +5 -0
- package/v2Components/EmailPreviewV2/index.js +3 -3
- 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/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/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
|
@@ -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,55 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="360px" height="725px" viewBox="0 0 360 725" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
|
|
4
|
-
<title>Artboard Copy 3</title>
|
|
5
|
-
<desc>Created with Sketch.</desc>
|
|
6
|
-
<g id="Artboard-Copy-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
-
<rect id="Rectangle" fill="#FFFFFF" x="0" y="660" width="360" height="65"></rect>
|
|
8
|
-
<g id="Organisms/ui/android/screenshots/wallpaper" transform="translate(120.000000, 0.000000)"></g>
|
|
9
|
-
<g id="Group-5" transform="translate(16.000000, 680.000000)">
|
|
10
|
-
<polygon id="Stroke-1" stroke-opacity="0.0117647061" stroke="#000000" stroke-width="1.33333336e-11" points="0 0 23.999999 0 23.999999 23.999999 0 23.999999"></polygon>
|
|
11
|
-
<polygon id="Fill-3" fill="#7F7F7F" points="18.9999989 12.9999992 12.9999992 12.9999992 12.9999992 18.9999989 10.9999993 18.9999989 10.9999993 12.9999992 4.9999997 12.9999992 4.9999997 10.9999993 10.9999993 10.9999993 10.9999993 4.9999997 12.9999992 4.9999997 12.9999992 10.9999993 18.9999989 10.9999993"></polygon>
|
|
12
|
-
</g>
|
|
13
|
-
<text id="Add-text-to-this-mes" font-family="Roboto-Regular, Roboto" font-size="15" font-weight="normal" letter-spacing="0.3" fill="#959595">
|
|
14
|
-
<tspan x="53" y="697">Add text to this message</tspan>
|
|
15
|
-
</text>
|
|
16
|
-
<g id="Group-5" transform="translate(320.000000, 679.000000)">
|
|
17
|
-
<polygon id="Stroke-1" stroke-opacity="0.0117647061" stroke="#000000" stroke-width="1.33333336e-11" points="0 0 23.999999 0 23.999999 23.999999 0 23.999999"></polygon>
|
|
18
|
-
<polygon id="Fill-3" fill="#757575" points="2.00999988 20.9999987 22.9999986 11.9999993 2.00999988 2.99999982 1.99999988 9.9999994 16.999999 11.9999993 1.99999988 13.9999992"></polygon>
|
|
19
|
-
</g>
|
|
20
|
-
<rect id="Rectangle" stroke="#E6E6E6" fill="#F4F5F7" x="0.5" y="86.5" width="359" height="573"></rect>
|
|
21
|
-
<g id="Group">
|
|
22
|
-
<g id="Toolbar">
|
|
23
|
-
<polygon id="Toolbar-bg" fill="#E51FA3" points="360 0 0 0 0 86 360 86"></polygon>
|
|
24
|
-
<g id="Toolbar-contents" transform="translate(16.000000, 40.000000)">
|
|
25
|
-
<g id="Back">
|
|
26
|
-
<rect id="Bounds" x="0" y="0" width="24" height="24"></rect>
|
|
27
|
-
<polygon id="Shape" fill="#FFFFFF" points="20 11 7.8 11 13.4 5.4 12 4 4 12 12 20 13.4 18.6 7.8 13 20 13"></polygon>
|
|
28
|
-
</g>
|
|
29
|
-
</g>
|
|
30
|
-
</g>
|
|
31
|
-
<g id="Status-bar">
|
|
32
|
-
<rect id="Status-bar-bg" fill="#CF0E8F" x="0" y="0" width="360" height="24"></rect>
|
|
33
|
-
<rect id="bounds" x="242" y="0" width="118" height="24"></rect>
|
|
34
|
-
<g id="battery" transform="translate(337.000000, 4.000000)">
|
|
35
|
-
<polygon id="bounds" points="0 0 16 0 16 16 0 16"></polygon>
|
|
36
|
-
<polygon id="Shape" fill="#FFFFFF" points="9 1.875 9 1 6 1 6 1.875 3 1.875 3 15 12 15 12 1.875"></polygon>
|
|
37
|
-
</g>
|
|
38
|
-
<g id="cellular" transform="translate(317.000000, 4.000000)">
|
|
39
|
-
<polygon id="bounds" points="0 0 16 0 16 16 0 16"></polygon>
|
|
40
|
-
<polygon id="Shape" fill="#FFFFFF" points="0 15 14 15 14 1"></polygon>
|
|
41
|
-
</g>
|
|
42
|
-
<g id="wifi" transform="translate(296.000000, 4.000000)">
|
|
43
|
-
<polygon id="bounds" points="2 0 18 0 18 16 2 16"></polygon>
|
|
44
|
-
<path d="M0.977372085,4.01593123 C3.48821908,2.12256382 6.61301513,1 10,1 C13.3869849,1 16.5117809,2.12256382 19.0226279,4.01593123 L10,15 L0.977372085,4.01593123 Z" id="Shape" fill="#FFFFFF"></path>
|
|
45
|
-
</g>
|
|
46
|
-
</g>
|
|
47
|
-
<g id="Icons-/-Navigation-24px-/-White-/-More" transform="translate(332.000000, 42.000000)">
|
|
48
|
-
<g id="More">
|
|
49
|
-
<rect id="Bounds" x="0" y="0" width="12" height="24"></rect>
|
|
50
|
-
<path d="M6,8 C7.1,8 8,7.1 8,6 C8,4.9 7.1,4 6,4 C4.9,4 4,4.9 4,6 C4,7.1 4.9,8 6,8 L6,8 Z M6,10 C4.9,10 4,10.9 4,12 C4,13.1 4.9,14 6,14 C7.1,14 8,13.1 8,12 C8,10.9 7.1,10 6,10 L6,10 Z M6,16 C4.9,16 4,16.9 4,18 C4,19.1 4.9,20 6,20 C7.1,20 8,19.1 8,18 C8,16.9 7.1,16 6,16 L6,16 Z" id="Shape" fill="#FFFFFF"></path>
|
|
51
|
-
</g>
|
|
52
|
-
</g>
|
|
53
|
-
</g>
|
|
54
|
-
</g>
|
|
55
|
-
</svg>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.call-task-preview {
|
|
2
|
-
.call-task-subject-container {
|
|
3
|
-
padding: 8px;
|
|
4
|
-
background: #444;
|
|
5
|
-
color: white;
|
|
6
|
-
font-size: 12px;
|
|
7
|
-
font-weight: 500;
|
|
8
|
-
}
|
|
9
|
-
.call-task-message-container {
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
height: 150px;
|
|
12
|
-
width: 100%;
|
|
13
|
-
font-size: 12px;
|
|
14
|
-
background: #eee;
|
|
15
|
-
padding: 8px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* CallTaskPreview
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import HeaderPng from './images/Header.png';
|
|
10
|
-
import FooterPng from './images/Footer.png';
|
|
11
|
-
|
|
12
|
-
import './_callTaskPreview.scss';
|
|
13
|
-
|
|
14
|
-
class CallTaskPreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
15
|
-
render() {
|
|
16
|
-
const { subject, messageBody } = this.props;
|
|
17
|
-
return (
|
|
18
|
-
<div className="call-task-preview">
|
|
19
|
-
<img style={{ width: '100%' }} src={HeaderPng} alt="header" />
|
|
20
|
-
<div className="call-task-subject-container">
|
|
21
|
-
{subject}
|
|
22
|
-
</div>
|
|
23
|
-
<div className="call-task-message-container">
|
|
24
|
-
{messageBody}
|
|
25
|
-
</div>
|
|
26
|
-
<img style={{ width: '100%' }} src={FooterPng} alt="footer" />
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
CallTaskPreview.propTypes = {
|
|
33
|
-
subject: PropTypes.string,
|
|
34
|
-
messageBody: PropTypes.string,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default CallTaskPreview;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* CallTaskPreview Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the CallTaskPreview component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'app.components.CallTaskPreview.header',
|
|
11
|
-
defaultMessage: 'This is the CallTaskPreview component !',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { shallow } from "enzyme";
|
|
3
|
-
import CallTaskPreview from "../index";
|
|
4
|
-
|
|
5
|
-
describe("<CallTaskPreview />", () => {
|
|
6
|
-
it("Test if Call task component renders", () => {
|
|
7
|
-
const component = shallow(
|
|
8
|
-
<CallTaskPreview
|
|
9
|
-
subject="this is test"
|
|
10
|
-
body="this is test message body"
|
|
11
|
-
/>
|
|
12
|
-
);
|
|
13
|
-
expect(component).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* CmsTemplatesComponent
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
// import styled from 'styled-components';
|
|
10
|
-
import {CapButton, CapCustomCard} from '@capillarytech/cap-ui-library';
|
|
11
|
-
import { FormattedMessage } from 'react-intl';
|
|
12
|
-
import messages from './messages';
|
|
13
|
-
const {CapCustomCardList} = CapCustomCard;
|
|
14
|
-
function CmsTemplatesComponent(props) {
|
|
15
|
-
const cardDataList = props.cmsTemplates.map((template) => (
|
|
16
|
-
{
|
|
17
|
-
key: template.name,
|
|
18
|
-
title: template.name,
|
|
19
|
-
url: template.versions.base.preview_http_url,
|
|
20
|
-
hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(template._id)}><FormattedMessage {...messages.select}/></CapButton>,
|
|
21
|
-
}));
|
|
22
|
-
return (<div>
|
|
23
|
-
<div className="pagination-container">
|
|
24
|
-
<CapCustomCardList cardList={cardDataList} type="Email" />
|
|
25
|
-
</div>
|
|
26
|
-
</div>);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
CmsTemplatesComponent.propTypes = {
|
|
30
|
-
cmsTemplates: PropTypes.array,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default CmsTemplatesComponent;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* CmsTemplatesComponent Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the CmsTemplatesComponent component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'app.components.CmsTemplatesComponent.header',
|
|
11
|
-
defaultMessage: 'This is the CmsTemplatesComponent component !',
|
|
12
|
-
},
|
|
13
|
-
select: {
|
|
14
|
-
id: 'app.components.CmsTemplatesComponent.select',
|
|
15
|
-
defaultMessage: 'Select',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// import React from 'react';
|
|
2
|
-
// import { shallow } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
// import CmsTemplatesComponent from '../index';
|
|
5
|
-
|
|
6
|
-
describe('<CmsTemplatesComponent />', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(false);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* EmailPreviewV2
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
// import styled from 'styled-components';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import { FormattedMessage } from 'react-intl';
|
|
11
|
-
import {isEmpty} from 'lodash';
|
|
12
|
-
import { connect } from 'react-redux';
|
|
13
|
-
import { bindActionCreators } from 'redux';
|
|
14
|
-
import { createStructuredSelector } from 'reselect';
|
|
15
|
-
import { CapSpin, CapButton } from '@capillarytech/cap-ui-library';
|
|
16
|
-
import moment from 'moment';
|
|
17
|
-
import EmailPreviewV2 from '../EmailPreviewV2';
|
|
18
|
-
import messages from '../EmailPreviewV2/messages';
|
|
19
|
-
import './index.scss';
|
|
20
|
-
import mobileBody from '../../assets/mobile.png';
|
|
21
|
-
|
|
22
|
-
import {selectTemplateContent} from '../../containers/Templates/selectors';
|
|
23
|
-
import * as templateActions from '../../containers/Templates/actions';
|
|
24
|
-
|
|
25
|
-
const deviceAspectRatio = {
|
|
26
|
-
mobile: {
|
|
27
|
-
height: "440",
|
|
28
|
-
width: "230",
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
class EmailMobilePreview extends React.Component {
|
|
33
|
-
constructor() {
|
|
34
|
-
super();
|
|
35
|
-
this.state = {
|
|
36
|
-
showAllDevices: false,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
componentWillMount() {
|
|
40
|
-
const {templateData, templateContent} = this.props;
|
|
41
|
-
if (isEmpty(templateContent) && !isEmpty(templateData) && templateData._id) { // templateData: comes from templates list email preview
|
|
42
|
-
this.props.templateActions.getTemplateDetails(templateData._id); // templateContent: html data to be shown in iframe
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
onClickShowInAllDevices = () => {
|
|
46
|
-
const { onClickShowInAllDevices } = this.props;
|
|
47
|
-
if (onClickShowInAllDevices) {
|
|
48
|
-
onClickShowInAllDevices();
|
|
49
|
-
} else {
|
|
50
|
-
this.setState({
|
|
51
|
-
showAllDevices: true,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
const messageContainerName = 'mobile-message-container';
|
|
57
|
-
const {
|
|
58
|
-
templateContent,
|
|
59
|
-
enableShowAllDevices,
|
|
60
|
-
} = this.props;
|
|
61
|
-
const { showAllDevices } = this.state;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div className="email-mobile-preview-container">
|
|
65
|
-
{showAllDevices ? (
|
|
66
|
-
<EmailPreviewV2 {...this.props} />
|
|
67
|
-
) : (
|
|
68
|
-
<CapSpin spinning={!templateContent}>
|
|
69
|
-
<div id="emailPreivew-container">
|
|
70
|
-
<div id="emailPreivew-content-wrapper">
|
|
71
|
-
<div id="emailPreivew-content">
|
|
72
|
-
<div className="email-preview-container">
|
|
73
|
-
{enableShowAllDevices && (
|
|
74
|
-
<CapButton
|
|
75
|
-
type="flat"
|
|
76
|
-
onClick={this.onClickShowInAllDevices}
|
|
77
|
-
>
|
|
78
|
-
View in all devices
|
|
79
|
-
</CapButton>
|
|
80
|
-
)}
|
|
81
|
-
<div className={"shell align-center"}>
|
|
82
|
-
<img src={mobileBody} alt="capillary" width="60%" />
|
|
83
|
-
<div className={messageContainerName}>
|
|
84
|
-
<iframe srcDoc={templateContent} {...deviceAspectRatio.mobile} >
|
|
85
|
-
<p><FormattedMessage {...messages.noIframeSupport}/></p>
|
|
86
|
-
</iframe>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
{this.props.templateData &&
|
|
94
|
-
[
|
|
95
|
-
<p className="preview-info"><FormattedMessage {...messages.lastModified} />: {moment(this.props.templateData.updatedAt).format('MM-DD-YYYY')}</p>,
|
|
96
|
-
<p style={{marginBottom: '8px'}} className="preview-info"><FormattedMessage {...messages.uploadedBy} /> : {this.props.templateData.updatedByName}</p>,
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
</CapSpin>
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
EmailMobilePreview.propTypes = {
|
|
109
|
-
templateContent: PropTypes.string,
|
|
110
|
-
templateData: PropTypes.object,
|
|
111
|
-
templateActions: PropTypes.object,
|
|
112
|
-
onClickShowInAllDevices: PropTypes.func,
|
|
113
|
-
enableShowAllDevices: PropTypes.bool,
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
EmailMobilePreview.defaultProps = {
|
|
117
|
-
showDeviceSelection: true,
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const mapStateToProps = (state, props) => createStructuredSelector({
|
|
121
|
-
templateContent: props.templateData ? selectTemplateContent() : () => props.templateContent, // when props has templateContent that means preview with content
|
|
122
|
-
});
|
|
123
|
-
function mapDispatchToProps(dispatch) {
|
|
124
|
-
return {
|
|
125
|
-
templateActions: bindActionCreators(templateActions, dispatch),
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export default connect(mapStateToProps, mapDispatchToProps)(EmailMobilePreview);
|