@capillarytech/creatives-library 2.0.79 → 2.0.81
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/CardGrid/index.js +1 -0
- package/components/EmailPreview/assets/images/iPad.svg +10 -0
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/FormBuilder/index.js +3 -2
- package/components/FormBuilder/test +1845 -0
- package/containers/CallTask/_callTask.scss +5 -0
- package/containers/CallTask/actions.js +15 -0
- package/containers/CallTask/constants.js +7 -0
- package/containers/CallTask/index.js +141 -0
- package/containers/CallTask/messages.js +21 -0
- package/containers/CallTask/reducer.js +23 -0
- package/containers/CallTask/sagas.js +11 -0
- package/containers/CallTask/selectors.js +25 -0
- package/containers/CallTask/tests/actions.test.js +18 -0
- package/containers/CallTask/tests/index.test.js +10 -0
- package/containers/CallTask/tests/reducer.test.js +9 -0
- package/containers/CallTask/tests/sagas.test.js +15 -0
- package/containers/CallTask/tests/selectors.test.js +10 -0
- package/containers/ChannelTemplates/actions.js +20 -0
- package/containers/ChannelTemplates/constants.js +8 -0
- package/containers/ChannelTemplates/index.js +48 -0
- package/containers/ChannelTemplates/messages.js +13 -0
- package/containers/ChannelTemplates/reducer.js +34 -0
- package/containers/ChannelTemplates/sagas.js +32 -0
- package/containers/ChannelTemplates/selectors.js +25 -0
- package/containers/ChannelTemplates/tests/actions.test.js +18 -0
- package/containers/ChannelTemplates/tests/index.test.js +10 -0
- package/containers/ChannelTemplates/tests/reducer.test.js +9 -0
- package/containers/ChannelTemplates/tests/sagas.test.js +15 -0
- package/containers/ChannelTemplates/tests/selectors.test.js +10 -0
- package/containers/CreativesContainer/SlideBoxContent.js +248 -0
- package/containers/CreativesContainer/SlideBoxFooter.js +38 -0
- package/containers/CreativesContainer/SlideBoxHeader.js +65 -0
- package/containers/CreativesContainer/actions.js +27 -0
- package/containers/CreativesContainer/constants.js +13 -0
- package/containers/CreativesContainer/index.js +418 -0
- package/containers/CreativesContainer/index.scss +27 -0
- package/containers/CreativesContainer/messages.js +17 -0
- package/containers/CreativesContainer/reducer.js +29 -0
- package/containers/CreativesContainer/sagas.js +11 -0
- package/containers/CreativesContainer/selectors.js +30 -0
- package/containers/CreativesContainer/tests/actions.test.js +18 -0
- package/containers/CreativesContainer/tests/index.test.js +10 -0
- package/containers/CreativesContainer/tests/reducer.test.js +9 -0
- package/containers/CreativesContainer/tests/sagas.test.js +15 -0
- package/containers/CreativesContainer/tests/selectors.test.js +10 -0
- package/containers/EmailWrapper/actions.js +15 -0
- package/containers/EmailWrapper/constants.js +7 -0
- package/containers/EmailWrapper/index.js +238 -0
- package/containers/EmailWrapper/messages.js +57 -0
- package/containers/EmailWrapper/reducer.js +23 -0
- package/containers/EmailWrapper/sagas.js +11 -0
- package/containers/EmailWrapper/selectors.js +25 -0
- package/containers/EmailWrapper/tests/actions.test.js +18 -0
- package/containers/EmailWrapper/tests/index.test.js +10 -0
- package/containers/EmailWrapper/tests/reducer.test.js +9 -0
- package/containers/EmailWrapper/tests/sagas.test.js +15 -0
- package/containers/EmailWrapper/tests/selectors.test.js +10 -0
- package/containers/Line/Create/index.js +1 -1
- package/containers/MobilePush/Create/selectors.js +1 -1
- package/containers/MobilePush/Edit/selectors.js +1 -1
- package/containers/MobilePush/commonMethods.js +249 -0
- package/containers/MobilePush/eventsMap.js +127 -0
- package/containers/MobilePush/initialSchema.js +1739 -0
- package/containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
- package/containers/MobilepushWrapper/index.js +97 -0
- package/containers/MobilepushWrapper/messages.js +25 -0
- package/containers/MobilepushWrapper/tests/index.test.js +10 -0
- package/containers/Templates/index.js +18 -14
- package/containers/TemplatesV2/_templatesV2.scss +5 -0
- package/containers/TemplatesV2/actions.js +16 -0
- package/containers/TemplatesV2/constants.js +10 -0
- package/containers/TemplatesV2/index.js +207 -0
- package/containers/TemplatesV2/messages.js +29 -0
- package/containers/TemplatesV2/selectors.js +25 -0
- package/containers/TemplatesV2/tests/actions.test.js +18 -0
- package/containers/TemplatesV2/tests/index.test.js +10 -0
- package/containers/TemplatesV2/tests/reducer.test.js +9 -0
- package/containers/TemplatesV2/tests/sagas.test.js +15 -0
- package/containers/TemplatesV2/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/testschema.js +379 -0
- package/containers/WeChat/_wechat.scss +8 -0
- package/containers/WeChat/actions.js +52 -0
- package/containers/WeChat/constants.js +28 -0
- package/containers/WeChat/index.js +1635 -0
- package/containers/WeChat/messages.js +73 -0
- package/containers/WeChat/reducer.js +74 -0
- package/containers/WeChat/sagas.js +86 -0
- package/containers/WeChat/selectors.js +25 -0
- package/containers/WeChat/tests/actions.test.js +18 -0
- package/{components/SmsPreviewV2 → containers/WeChat}/tests/index.test.js +2 -2
- package/containers/WeChat/tests/reducer.test.js +9 -0
- package/containers/WeChat/tests/sagas.test.js +15 -0
- package/containers/WeChat/tests/selectors.test.js +10 -0
- package/index.js +4 -3
- package/package.json +1 -1
- package/v2Containers/MobilePush/Create/index.js +43 -9
- package/v2Containers/MobilePush/Create/messages.js +16 -0
- package/v2Containers/MobilePush/Create/selectors.js +2 -1
- package/v2Containers/MobilePush/Edit/index.js +54 -22
- package/v2Containers/MobilePush/Edit/messages.js +17 -1
- package/v2Containers/MobilePush/Edit/selectors.js +2 -1
- package/v2Containers/MobilePush/commonMethods.js +9 -7
- package/v2Containers/WeChat/MapTemplates/index.js +5 -5
- package/assets/android-message-gui-2.svg +0 -55
- package/components/SmsPreviewV2/_smsPreviewV2.scss +0 -353
- package/components/SmsPreviewV2/index.js +0 -69
- package/components/SmsPreviewV2/messages.js +0 -13
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* EmailWrapper
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { connect } from 'react-redux';
|
|
9
|
+
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
|
10
|
+
import { createStructuredSelector } from 'reselect';
|
|
11
|
+
import { bindActionCreators } from 'redux';
|
|
12
|
+
import _ from 'lodash';
|
|
13
|
+
import { CapRadioCard, CapHeader, CapNotification, CapInput, CapUploader, CapSpin, CapButton} from '@capillarytech/cap-ui-library';
|
|
14
|
+
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
15
|
+
import {selectEmailLayout, selectCmsTemplates, selectEdmEditor, uploadSelector} from '../Templates/selectors';
|
|
16
|
+
import * as templatesActionsCreators from '../Templates/actions';
|
|
17
|
+
import Email from '../Email';
|
|
18
|
+
import CmsTemplatesComponent from '../../components/CmsTemplatesComponent';
|
|
19
|
+
import messages from './messages';
|
|
20
|
+
export class EmailWrapper extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
21
|
+
constructor(props) {
|
|
22
|
+
super(props);
|
|
23
|
+
this.emailUploader = React.createRef();
|
|
24
|
+
this.state = {
|
|
25
|
+
templateName: '',
|
|
26
|
+
routeParams: {
|
|
27
|
+
pathname: `/email/create`,
|
|
28
|
+
query: { module: 'library', type: 'embedded'},
|
|
29
|
+
},
|
|
30
|
+
modeContent: {
|
|
31
|
+
|
|
32
|
+
},
|
|
33
|
+
// selectedCreateMode: '',
|
|
34
|
+
|
|
35
|
+
};
|
|
36
|
+
this.modes = [
|
|
37
|
+
{
|
|
38
|
+
title: <FormattedMessage {...messages.zipUpload}/>,
|
|
39
|
+
content: <FormattedMessage {...messages.zipUploadDesc}/>,
|
|
40
|
+
value: 'upload',
|
|
41
|
+
// onClick: () => {
|
|
42
|
+
// this.emailUploader.current.click();
|
|
43
|
+
// },
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: <FormattedMessage {...messages.useEditor}/>,
|
|
47
|
+
content: <FormattedMessage {...messages.useEditorDesc}/>,
|
|
48
|
+
value: 'editor',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
componentDidUpdate() {
|
|
54
|
+
const {modeContent} = this.state;
|
|
55
|
+
// const isValid = this.isValid();
|
|
56
|
+
const {emailCreateMode, EmailLayout, CmsTemplates, step, SelectedEdmDefaultTemplate, templatesActions} = this.props;
|
|
57
|
+
if (step === "modeSelection" && !this.state.selectedCreateMode && emailCreateMode === 'upload' && !EmailLayout) {
|
|
58
|
+
//document.getElementById('upload-email-template').click();
|
|
59
|
+
} else if (step === "templateSelection" && !this.state.selectedCreateMode) {
|
|
60
|
+
if (emailCreateMode === "editor" && !CmsTemplates) {
|
|
61
|
+
templatesActions.getEdmDefaultTemplates();
|
|
62
|
+
}
|
|
63
|
+
} else if (step === "createTemplateContent" && !this.state.selectedCreateMode) {
|
|
64
|
+
if (emailCreateMode === 'upload' && !_.isEmpty(EmailLayout)) {
|
|
65
|
+
this.setCreateMode('upload');
|
|
66
|
+
} else if (emailCreateMode === "editor" && _.isEmpty(SelectedEdmDefaultTemplate)) {
|
|
67
|
+
this.handleEdmDefaultTemplateSelection(modeContent.id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
componentWillUnmount() {
|
|
74
|
+
this.props.onResetStep();
|
|
75
|
+
this.props.templatesActions.resetTemplateData();
|
|
76
|
+
}
|
|
77
|
+
onTemplateNameChange = (ev) => {
|
|
78
|
+
this.setState({templateName: ev.target.value});
|
|
79
|
+
}
|
|
80
|
+
onChange = (e) => {
|
|
81
|
+
this.props.onEmailModeChange( e.target.value );
|
|
82
|
+
};
|
|
83
|
+
//isValid = () => !_.isEmpty(this.state.templateName)
|
|
84
|
+
setCreateMode = (emailCreateMode) => {
|
|
85
|
+
this.setState({selectedCreateMode: emailCreateMode});
|
|
86
|
+
}
|
|
87
|
+
handleZipUploadError = () => {
|
|
88
|
+
const message = {
|
|
89
|
+
key: "email-upload-error",
|
|
90
|
+
message: this.props.intl.formatMessage(messages.invalidUploadFileError2),
|
|
91
|
+
description: this.props.intl.formatMessage(messages.invalidUploadFileErrorDesc2),
|
|
92
|
+
};
|
|
93
|
+
CapNotification.error(message);
|
|
94
|
+
}
|
|
95
|
+
handleFileUpload = (file) => {
|
|
96
|
+
const { templatesActions, intl, showNextStep, isUploading } = this.props;
|
|
97
|
+
if (!isUploading) {
|
|
98
|
+
const fileExtension = file.name.split('.').pop();
|
|
99
|
+
const supportedZipFormats = ['zip'];
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
if (supportedZipFormats.indexOf(fileExtension.toLowerCase()) !== -1) {
|
|
103
|
+
templatesActions.handleZipUpload(file.originFileObj, () => { //handle upload success
|
|
104
|
+
this.setState({modeContent: { file}}, showNextStep);
|
|
105
|
+
}, this.handleZipUploadError);
|
|
106
|
+
} else if (fileExtension === 'html' || fileExtension === 'htm') {
|
|
107
|
+
const reader = new FileReader();
|
|
108
|
+
reader.onload = () => {
|
|
109
|
+
const text = reader.result;
|
|
110
|
+
this.setState({modeContent: { file}}, () => {
|
|
111
|
+
templatesActions.handleHtmlUpload(text);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// showNextStep();
|
|
115
|
+
};
|
|
116
|
+
reader.readAsText(file.originFileObj);
|
|
117
|
+
} else {
|
|
118
|
+
const message = {
|
|
119
|
+
key: "email-upload-error",
|
|
120
|
+
message: intl.formatMessage(messages.invalidUploadFileError),
|
|
121
|
+
description: intl.formatMessage(messages.invalidUploadFileErrorDesc),
|
|
122
|
+
};
|
|
123
|
+
CapNotification.error(message);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
handleEdmDefaultTemplateSelection = (id) => {
|
|
129
|
+
const {CmsTemplates, templatesActions } = this.props;
|
|
130
|
+
const data = _.find(CmsTemplates, {_id: id});
|
|
131
|
+
|
|
132
|
+
templatesActions.setEdmTemplate(data);
|
|
133
|
+
this.setState({
|
|
134
|
+
selectedCreateMode: 'editor'});
|
|
135
|
+
};
|
|
136
|
+
useFileUpload = ({file}) => {
|
|
137
|
+
this.setState({modeContent: {}}, () => {
|
|
138
|
+
this.handleFileUpload(file);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
useEditor = (id) => {
|
|
142
|
+
this.setState({modeContent: {id}}, this.props.showNextStep);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
isShowEmailCreate = () => !_.isEmpty(this.state.selectedCreateMode) && (!_.isEmpty(this.props.EmailLayout) || this.props.SelectedEdmDefaultTemplate)
|
|
146
|
+
render() {
|
|
147
|
+
const {emailCreateMode, isGetFormData, getFormdata, type, CmsTemplates, step, cap, isFullMode, EmailLayout, setIsLoadingContent} = this.props;
|
|
148
|
+
const {templateName, modeContent} = this.state;
|
|
149
|
+
const isShowEmailCreate = this.isShowEmailCreate();
|
|
150
|
+
return (
|
|
151
|
+
<div>
|
|
152
|
+
<CapSpin spinning={emailCreateMode === "upload" ? this.props.isUploading : false} >
|
|
153
|
+
{step === "modeSelection" || (step === "templateSelection" && emailCreateMode === "upload") ?
|
|
154
|
+
<div>
|
|
155
|
+
{isFullMode &&
|
|
156
|
+
<CapInput
|
|
157
|
+
label={<FormattedMessage {...messages.creativeName}/>}
|
|
158
|
+
onChange={this.onTemplateNameChange}
|
|
159
|
+
value={templateName}
|
|
160
|
+
labelPosition="top"/>
|
|
161
|
+
}
|
|
162
|
+
<CapHeader size="small" title={<FormattedMessage {...messages.createMode}/>}/>
|
|
163
|
+
<CapRadioCard
|
|
164
|
+
panes={this.modes}
|
|
165
|
+
onChange={this.onChange}
|
|
166
|
+
selected={emailCreateMode}
|
|
167
|
+
/>
|
|
168
|
+
<div>
|
|
169
|
+
{emailCreateMode === "upload" &&
|
|
170
|
+
<div style={{ marginLeft: '8px'}}>
|
|
171
|
+
<CapUploader onChange={this.useFileUpload} accept=".zip, .html, .htm" showUploadList={false}>
|
|
172
|
+
<CapButton>Upload</CapButton>
|
|
173
|
+
</CapUploader>
|
|
174
|
+
{!_.isEmpty(EmailLayout) &&
|
|
175
|
+
<div>{_.get(modeContent, "file.name")}</div>
|
|
176
|
+
}
|
|
177
|
+
</div>
|
|
178
|
+
}
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
:
|
|
182
|
+
<div>
|
|
183
|
+
{isShowEmailCreate && <Email
|
|
184
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
185
|
+
key="email-create-template"
|
|
186
|
+
location={this.state.routeParams}
|
|
187
|
+
route={{ name: 'email' }}
|
|
188
|
+
params={{}}
|
|
189
|
+
isGetFormData={isGetFormData}
|
|
190
|
+
getFormdata={getFormdata}
|
|
191
|
+
getFormSubscriptionData={getFormdata}
|
|
192
|
+
getDefaultTags={type}
|
|
193
|
+
defaultData={{templateName}}
|
|
194
|
+
cap={cap}
|
|
195
|
+
/>}
|
|
196
|
+
{CmsTemplates && !isShowEmailCreate && <CmsTemplatesComponent cmsTemplates={CmsTemplates} handleEdmDefaultTemplateSelection={this.useEditor}/>}
|
|
197
|
+
</div>
|
|
198
|
+
}
|
|
199
|
+
</CapSpin>
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
EmailWrapper.propTypes = {
|
|
206
|
+
onEmailModeChange: PropTypes.func.isRequired,
|
|
207
|
+
isGetFormData: PropTypes.bool,
|
|
208
|
+
type: PropTypes.string,
|
|
209
|
+
emailCreateMode: PropTypes.string,
|
|
210
|
+
EmailLayout: PropTypes.object,
|
|
211
|
+
templatesActions: PropTypes.object,
|
|
212
|
+
CmsTemplates: PropTypes.arrayOf(PropTypes.object),
|
|
213
|
+
SelectedEdmDefaultTemplate: PropTypes.object,
|
|
214
|
+
step: PropTypes.string,
|
|
215
|
+
showNextStep: PropTypes.func,
|
|
216
|
+
getFormdata: PropTypes.func,
|
|
217
|
+
intl: intlShape,
|
|
218
|
+
cap: PropTypes.object,
|
|
219
|
+
onResetStep: PropTypes.func,
|
|
220
|
+
isFullMode: PropTypes.bool,
|
|
221
|
+
isUploading: PropTypes.bool,
|
|
222
|
+
setIsLoadingContent: PropTypes.func,
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const mapStateToProps = createStructuredSelector({
|
|
226
|
+
EmailLayout: selectEmailLayout(),
|
|
227
|
+
CmsTemplates: selectCmsTemplates(),
|
|
228
|
+
SelectedEdmDefaultTemplate: selectEdmEditor(),
|
|
229
|
+
isUploading: uploadSelector(),
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
function mapDispatchToProps(dispatch) {
|
|
233
|
+
return {
|
|
234
|
+
templatesActions: bindActionCreators(templatesActionsCreators, dispatch),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export default UserIsAuthenticated(connect(mapStateToProps, mapDispatchToProps)(injectIntl(EmailWrapper)));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* EmailWrapper Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the EmailWrapper component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
export default defineMessages({
|
|
9
|
+
header: {
|
|
10
|
+
id: 'app.containers.EmailWrapper.header',
|
|
11
|
+
defaultMessage: 'This is EmailWrapper container !',
|
|
12
|
+
},
|
|
13
|
+
useEditor: {
|
|
14
|
+
id: 'app.containers.EmailWrapper.useEditor',
|
|
15
|
+
defaultMessage: 'Create using editor',
|
|
16
|
+
},
|
|
17
|
+
useEditorDesc: {
|
|
18
|
+
id: 'app.containers.EmailWrapper.useEditorDesc',
|
|
19
|
+
defaultMessage: 'Create using in-built template',
|
|
20
|
+
},
|
|
21
|
+
zipUpload: {
|
|
22
|
+
id: 'app.containers.EmailWrapper.zipUpload',
|
|
23
|
+
defaultMessage: 'Upload zip file',
|
|
24
|
+
},
|
|
25
|
+
zipUploadDesc: {
|
|
26
|
+
id: 'app.containers.EmailWrapper.zipUploadDesc',
|
|
27
|
+
defaultMessage: 'Upload compressed file (Zip) containing HTML & images',
|
|
28
|
+
},
|
|
29
|
+
creativeName: {
|
|
30
|
+
id: 'app.containers.EmailWrapper.creativeName',
|
|
31
|
+
defaultMessage: 'Creative name',
|
|
32
|
+
},
|
|
33
|
+
createMode: {
|
|
34
|
+
id: 'app.containers.EmailWrapper.createMode',
|
|
35
|
+
defaultMessage: 'How do you want to create ?',
|
|
36
|
+
},
|
|
37
|
+
invalidUploadFileError: {
|
|
38
|
+
id: `app.containers.EmailWrapper.invalidUploadFileError`,
|
|
39
|
+
defaultMessage: `File cannot be uploaded.`,
|
|
40
|
+
},
|
|
41
|
+
invalidUploadFileErrorDesc: {
|
|
42
|
+
id: `app.containers.EmailWrapper.invalidUploadFileDesc`,
|
|
43
|
+
defaultMessage: `Please select another file with valid file format.`,
|
|
44
|
+
},
|
|
45
|
+
invalidUploadFileError2: {
|
|
46
|
+
id: `app.containers.EmailWrapper.invalidUploadFileError`,
|
|
47
|
+
defaultMessage: `File upload failed`,
|
|
48
|
+
},
|
|
49
|
+
invalidUploadFileErrorDesc2: {
|
|
50
|
+
id: `app.containers.EmailWrapper.invalidUploadFileDesc`,
|
|
51
|
+
defaultMessage: `Please select another file with valid file contents`,
|
|
52
|
+
},
|
|
53
|
+
upload: {
|
|
54
|
+
id: `app.containers.EmailWrapper.upload`,
|
|
55
|
+
defaultMessage: `Upload`,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* EmailWrapper reducer
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { fromJS } from 'immutable';
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_ACTION,
|
|
10
|
+
} from './constants';
|
|
11
|
+
|
|
12
|
+
const initialState = fromJS({});
|
|
13
|
+
|
|
14
|
+
function emailWrapperReducer(state = initialState, action) {
|
|
15
|
+
switch (action.type) {
|
|
16
|
+
case DEFAULT_ACTION:
|
|
17
|
+
return state;
|
|
18
|
+
default:
|
|
19
|
+
return state;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default emailWrapperReducer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
2
|
+
|
|
3
|
+
// Individual exports for testing
|
|
4
|
+
export function* defaultSaga() {
|
|
5
|
+
// See example in containers/HomePage/sagas.js
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// All sagas to be loaded
|
|
9
|
+
export default [
|
|
10
|
+
defaultSaga,
|
|
11
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Direct selector to the emailWrapper state domain
|
|
5
|
+
*/
|
|
6
|
+
const selectEmailWrapperDomain = () => (state) => state.get('emailWrapper');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Other specific selectors
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Default selector used by EmailWrapper
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const makeSelectEmailWrapper = () => createSelector(
|
|
18
|
+
selectEmailWrapperDomain(),
|
|
19
|
+
(substate) => substate.toJS()
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default makeSelectEmailWrapper;
|
|
23
|
+
export {
|
|
24
|
+
selectEmailWrapperDomain,
|
|
25
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
defaultAction,
|
|
4
|
+
} from '../actions';
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_ACTION,
|
|
7
|
+
} from '../constants';
|
|
8
|
+
|
|
9
|
+
describe('EmailWrapper actions', () => {
|
|
10
|
+
describe('Default Action', () => {
|
|
11
|
+
it('has a type of DEFAULT_ACTION', () => {
|
|
12
|
+
const expected = {
|
|
13
|
+
type: DEFAULT_ACTION,
|
|
14
|
+
};
|
|
15
|
+
expect(defaultAction()).toEqual(expected);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test sagas
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable redux-saga/yield-effects */
|
|
6
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
7
|
+
// import { defaultSaga } from '../sagas';
|
|
8
|
+
|
|
9
|
+
// const generator = defaultSaga();
|
|
10
|
+
|
|
11
|
+
describe('defaultSaga Saga', () => {
|
|
12
|
+
it('Expect to have unit tests specified', () => {
|
|
13
|
+
expect(true).toEqual(false);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectEmailWrapperDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectEmailWrapperDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectEmailWrapperDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -679,7 +679,7 @@ export class Line extends Component {
|
|
|
679
679
|
console.log("schema line", schema);
|
|
680
680
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'loyalty') {
|
|
681
681
|
schema.standalone.sections.splice(0, 1);
|
|
682
|
-
} else if (this.props.location.query.type === 'embedded' && typeof this.props.location.query.
|
|
682
|
+
} else if (this.props.location.query.type === 'embedded' && typeof this.props.location.query.module !== 'undefined') {
|
|
683
683
|
delete schema.standalone;
|
|
684
684
|
} else {
|
|
685
685
|
schema.standalone.sections.splice(1, 1);
|
|
@@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
|
|
|
3
3
|
/**
|
|
4
4
|
* Direct selector to the create state domain
|
|
5
5
|
*/
|
|
6
|
-
const selectPushMessageCreateDomain = () => (state) => state.get('
|
|
6
|
+
const selectPushMessageCreateDomain = () => (state) => state.get('mobileCreate');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Other specific selectors
|
|
@@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
|
|
|
3
3
|
/**
|
|
4
4
|
* Direct selector to the create state domain
|
|
5
5
|
*/
|
|
6
|
-
const selectMobilePushEditDomain = () => (state) => state.get('
|
|
6
|
+
const selectMobilePushEditDomain = () => (state) => state.get('mobileEdit');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Other specific selectors
|