@capillarytech/creatives-library 3.2.4 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +1 -1
- package/components/FormBuilder/index.js +1 -1
- package/components/Header/index.js +4 -3
- package/components/Header/messages.js +4 -0
- package/config/app.js +2 -0
- package/containers/Assets/Gallery/index.js +1 -1
- package/containers/Cap/index.js +4 -5
- package/containers/Email/index.js +2 -2
- package/containers/Email/messages.js +8 -0
- package/containers/LanguageProvider/index.js +28 -4
- package/containers/Templates/index.js +2 -2
- package/containers/Templates/messages.js +24 -4
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +24 -0
- package/i18n.js +16 -9
- package/index.js +6 -0
- package/package.json +1 -4
- package/reducers.js +1 -1
- package/routes.js +2 -1
- package/services/api.js +11 -2
- package/translations/en.json +111 -63
- package/translations/zh.json +108 -60
- package/utils/smsCharCountV2.js +1 -1
- package/v2Components/CapTagList/index.js +2 -2
- package/v2Components/FormBuilder/index.js +7 -4
- package/v2Components/NavigationBar/index.js +9 -10
- package/v2Components/NewCallTask/index.js +3 -1
- package/v2Components/TopBar/index.js +3 -0
- package/v2Components/TopBar/messages.js +8 -0
- package/v2Containers/Assets/Gallery/index.js +1 -1
- package/v2Containers/Assets/Gallery/messages.js +4 -0
- package/v2Containers/CallTask/index.js +3 -1
- package/v2Containers/Cap/index.js +3 -2
- package/v2Containers/CreativesContainer/SlideBoxContent.js +14 -1
- package/v2Containers/CreativesContainer/index.js +6 -1
- package/v2Containers/Email/index.js +10 -7
- package/v2Containers/Email/messages.js +8 -0
- package/v2Containers/EmailWrapper/index.js +12 -9
- package/v2Containers/LanguageProvider/actions.js +9 -4
- package/v2Containers/LanguageProvider/constants.js +7 -1
- package/v2Containers/LanguageProvider/index.js +49 -12
- package/v2Containers/LanguageProvider/reducer.js +11 -9
- package/v2Containers/LanguageProvider/selectors.js +1 -1
- package/v2Containers/MobilePush/Create/index.js +2 -1
- package/v2Containers/MobilePush/Create/messages.js +4 -0
- package/v2Containers/MobilePush/Edit/index.js +2 -1
- package/v2Containers/MobilePush/Edit/messages.js +4 -0
- package/v2Containers/Sms/Create/index.js +3 -1
- package/v2Containers/Sms/Create/messages.js +16 -0
- package/v2Containers/Sms/Edit/index.js +3 -1
- package/v2Containers/Sms/Edit/messages.js +16 -0
- package/v2Containers/TagList/index.js +43 -0
- package/v2Containers/Templates/_templates.scss +9 -1
- package/v2Containers/Templates/index.js +65 -52
- package/v2Containers/TemplatesV2/index.js +54 -54
- package/v2Containers/WeChat/MapTemplates/index.js +0 -1
- package/v2Containers/WeChat/MapTemplates/messages.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +9 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/constants.js +3 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +146 -4
- package/v2Containers/WeChat/RichmediaTemplates/Create/messages.js +86 -57
- package/v2Containers/WeChat/RichmediaTemplates/Create/reducer.js +24 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +45 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/constants.js +4 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/index.js +8 -1
- package/v2Containers/WeChat/Wrapper/_wrapper.scss +9 -1
- package/v2Containers/WeChat/Wrapper/messages.js +5 -5
- package/v2Containers/TemplatesV2/_templatesV2.scss +0 -5
package/app.js
CHANGED
|
@@ -10,7 +10,7 @@ import CapV2 from 'v2Containers/Cap';
|
|
|
10
10
|
import Cap from 'containers/Cap';
|
|
11
11
|
import { LocaleProvider } from 'antd';
|
|
12
12
|
import { makeSelectLocationState } from 'containers/Cap/selectors';
|
|
13
|
-
import LanguageProvider from '
|
|
13
|
+
import LanguageProvider from 'v2Containers/LanguageProvider';
|
|
14
14
|
import FontFaceObserver from 'fontfaceobserver';
|
|
15
15
|
/* eslint-disable import/no-unresolved, import/extensions */
|
|
16
16
|
import '!file-loader?name=[name].[ext]!./favicon.ico';
|
|
@@ -3191,7 +3191,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3191
3191
|
|
|
3192
3192
|
FormBuilder.defaultProps = {
|
|
3193
3193
|
isNewVersionFlow: false,
|
|
3194
|
-
userLocale: 'en',
|
|
3194
|
+
userLocale: localStorage.getItem('jlocale') || 'en',
|
|
3195
3195
|
};
|
|
3196
3196
|
|
|
3197
3197
|
FormBuilder.propTypes = {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { FormattedMessage } from 'react-intl';
|
|
10
|
+
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
|
11
11
|
import { CapRow, CapColumn, CapInput, CapButton } from '@capillarytech/cap-react-ui-library';
|
|
12
12
|
import messages from './messages';
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ function Header(props) {
|
|
|
16
16
|
<div>
|
|
17
17
|
<CapRow className="template-form-header">
|
|
18
18
|
<CapColumn span={10}>
|
|
19
|
-
<CapInput id="template-name" placeholder=
|
|
19
|
+
<CapInput id="template-name" placeholder={props.intl.formatMessage(messages.enterTemplateName)} defaultValue={props.templateName} type="input" onChange={props.templateNameHandler}/>
|
|
20
20
|
</CapColumn>
|
|
21
21
|
<CapColumn span={2} offset={8}>
|
|
22
22
|
<CapButton id="preview-button" type="cancel" onClick={props.previewHandler}> <FormattedMessage {...messages.preview} /> </CapButton>
|
|
@@ -38,6 +38,7 @@ Header.propTypes = {
|
|
|
38
38
|
cancelHandler: PropTypes.func,
|
|
39
39
|
saveHandler: PropTypes.func,
|
|
40
40
|
templateName: PropTypes.string,
|
|
41
|
+
intl: intlShape.isRequired,
|
|
41
42
|
};
|
|
42
43
|
|
|
43
|
-
export default Header;
|
|
44
|
+
export default injectIntl(Header);
|
package/config/app.js
CHANGED
|
@@ -5,6 +5,7 @@ const config = {
|
|
|
5
5
|
production: {
|
|
6
6
|
api_endpoint: '/arya/api/v1/creatives',
|
|
7
7
|
auth_endpoint: '/arya/api/v1/auth',
|
|
8
|
+
arya_endpoint: '/arya/api/v1',
|
|
8
9
|
login_url: 'auth/login',
|
|
9
10
|
dashboard_url: '/sms',
|
|
10
11
|
dashboard_url_v2: '/v2',
|
|
@@ -14,6 +15,7 @@ const config = {
|
|
|
14
15
|
development: {
|
|
15
16
|
api_endpoint: 'https://nightly.capillary.in/arya/api/v1/creatives',
|
|
16
17
|
auth_endpoint: 'https://nightly.capillary.in/arya/api/v1/auth',
|
|
18
|
+
arya_endpoint: 'https://nightly.capillary.in/arya/api/v1',
|
|
17
19
|
subscription_api_endpoint: 'https://nightly.capillary.in/arya/api/v1/org-settings/subscription',
|
|
18
20
|
login_url: 'auth/login',
|
|
19
21
|
dashboard_url: '/sms',
|
|
@@ -382,7 +382,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
382
382
|
<div>
|
|
383
383
|
{/*<Spin spinning={this.props.Gallery.assetUploading || this.props.Gallery.fetchingAllAssets}>*/}
|
|
384
384
|
<Helmet
|
|
385
|
-
title=
|
|
385
|
+
title={this.props.intl.formatMessage(messages.gallery)}
|
|
386
386
|
/>
|
|
387
387
|
{/* this.props.location.query.type !== 'embedded' && <Row style={{marginBottom: '16px'}}>
|
|
388
388
|
<Col>
|
package/containers/Cap/index.js
CHANGED
|
@@ -164,8 +164,10 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
164
164
|
|
|
165
165
|
getMappedLocale(locale) {
|
|
166
166
|
const map = {
|
|
167
|
-
'en': 'en',
|
|
167
|
+
'en': 'en-US',
|
|
168
168
|
'zh-cn': 'zh',
|
|
169
|
+
'en-US': 'en-US',
|
|
170
|
+
'zh': 'zh',
|
|
169
171
|
};
|
|
170
172
|
return map[locale];
|
|
171
173
|
}
|
|
@@ -207,10 +209,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
207
209
|
if (!_.isEmpty(orgList)) {
|
|
208
210
|
_.forEach(orgList, (item) => {
|
|
209
211
|
const id = item.orgID;
|
|
210
|
-
|
|
211
|
-
if (id === 486) {
|
|
212
|
-
name = 'Demo Org';
|
|
213
|
-
}
|
|
212
|
+
const name = item.orgName;
|
|
214
213
|
proxyOrgList.push({ key: id, text: name, value: id });
|
|
215
214
|
});
|
|
216
215
|
}
|
|
@@ -3109,8 +3109,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
3109
3109
|
);
|
|
3110
3110
|
const schema = this.state.schema;
|
|
3111
3111
|
const spinning = this.state.loading || (this.props.Email && "createTemplateInProgress" in this.props.Email && this.props.Email.createTemplateInProgress) || (this.props.Email.assetUploading !== undefined && this.props.Email.assetUploading);
|
|
3112
|
-
const previewHeader = (<h3>
|
|
3113
|
-
const imagePreviewHeader = (<h3>
|
|
3112
|
+
const previewHeader = (<h3>{this.props.intl.formatMessage(messages.h3emailPreview)}</h3>);
|
|
3113
|
+
const imagePreviewHeader = (<h3>{this.props.intl.formatMessage(messages.h3imageSelection)}</h3>);
|
|
3114
3114
|
const imagePreviewContent = (
|
|
3115
3115
|
<div>
|
|
3116
3116
|
<div>
|
|
@@ -278,4 +278,12 @@ export default defineMessages({
|
|
|
278
278
|
id: 'creatives.containers.Email.Create.creatives',
|
|
279
279
|
defaultMessage: "Creatives",
|
|
280
280
|
},
|
|
281
|
+
"h3emailPreview": {
|
|
282
|
+
id: 'creatives.containers.Email.Create.h3emailPreview',
|
|
283
|
+
defaultMessage: "Email preview",
|
|
284
|
+
},
|
|
285
|
+
"h3imageSelection": {
|
|
286
|
+
id: 'creatives.containers.Email.Create.h3imageSelection',
|
|
287
|
+
defaultMessage: "Image selection",
|
|
288
|
+
},
|
|
281
289
|
});
|
|
@@ -9,18 +9,42 @@
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import { ConfigProvider } from 'antd';
|
|
13
|
+
import enUS from 'antd/es/locale-provider/en_US';
|
|
14
|
+
import zhCN from 'antd/es/locale-provider/zh_CN';
|
|
12
15
|
import { connect } from 'react-redux';
|
|
13
16
|
import { createSelector } from 'reselect';
|
|
14
17
|
import { IntlProvider } from 'react-intl';
|
|
15
|
-
|
|
18
|
+
import moment from 'moment';
|
|
16
19
|
import { makeSelectLocale } from './selectors';
|
|
17
20
|
|
|
18
21
|
export class LanguageProvider extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
|
|
22
|
+
getMappedLocale = (locale) => {
|
|
23
|
+
const map = {
|
|
24
|
+
'en': 'en-US',
|
|
25
|
+
'zh-cn': 'zh',
|
|
26
|
+
'en-US': 'en-US',
|
|
27
|
+
'zh': 'zh',
|
|
28
|
+
};
|
|
29
|
+
return map[locale];
|
|
30
|
+
}
|
|
31
|
+
|
|
19
32
|
render() {
|
|
33
|
+
const mappedLocale = {
|
|
34
|
+
'en': enUS,
|
|
35
|
+
'zh-cn': zhCN,
|
|
36
|
+
'en-US': enUS,
|
|
37
|
+
zh: zhCN,
|
|
38
|
+
};
|
|
39
|
+
const jLocale = localStorage.getItem('jlocale') || 'en';
|
|
40
|
+
moment.locale(jLocale);
|
|
41
|
+
const file = mappedLocale[jLocale];
|
|
20
42
|
return (
|
|
21
|
-
<
|
|
22
|
-
{
|
|
23
|
-
|
|
43
|
+
<ConfigProvider locale={file}>
|
|
44
|
+
<IntlProvider locale={this.props.locale} key={this.props.locale} messages={this.props.messages[this.props.locale]}>
|
|
45
|
+
{React.Children.only(this.props.children)}
|
|
46
|
+
</IntlProvider>
|
|
47
|
+
</ConfigProvider>
|
|
24
48
|
);
|
|
25
49
|
}
|
|
26
50
|
}
|
|
@@ -1344,7 +1344,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1344
1344
|
className="search-text"
|
|
1345
1345
|
style={{width: '210px'}}
|
|
1346
1346
|
placeholder={this.props.intl.formatMessage(messages.searchText)}
|
|
1347
|
-
prefix={<i className="material-icons" style={{ margin: '0', fontSize: '16px'}}>
|
|
1347
|
+
prefix={<i className="material-icons" style={{ margin: '0', fontSize: '16px'}}>search</i>}
|
|
1348
1348
|
value={this.state.searchText}
|
|
1349
1349
|
onChange={(e) => this.searchTemplate(e.target.value)}
|
|
1350
1350
|
/>
|
|
@@ -1555,7 +1555,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1555
1555
|
<Breadcrumb>
|
|
1556
1556
|
<BreadcrumbItem>{this.props.intl.formatMessage(messages.campaigns)}</BreadcrumbItem>
|
|
1557
1557
|
<BreadcrumbItem>{this.props.intl.formatMessage(messages.creatives)}</BreadcrumbItem>
|
|
1558
|
-
<BreadcrumbItem>{
|
|
1558
|
+
<BreadcrumbItem>{this.props.intl.formatMessage(messages[this.state.channel]) }</BreadcrumbItem>
|
|
1559
1559
|
</Breadcrumb>
|
|
1560
1560
|
}
|
|
1561
1561
|
</Col>
|
|
@@ -118,10 +118,6 @@ export default defineMessages({
|
|
|
118
118
|
id: 'creatives.containers.Templates.useEditor',
|
|
119
119
|
defaultMessage: "Use Editor",
|
|
120
120
|
},
|
|
121
|
-
"search": {
|
|
122
|
-
id: 'creatives.containers.Templates.search',
|
|
123
|
-
defaultMessage: "Search",
|
|
124
|
-
},
|
|
125
121
|
"blankTemplate": {
|
|
126
122
|
id: 'creatives.containers.Templates.blankTemplate',
|
|
127
123
|
defaultMessage: "Blank template",
|
|
@@ -310,4 +306,28 @@ export default defineMessages({
|
|
|
310
306
|
id: 'creatives.containers.Templates.descriptionTemplates',
|
|
311
307
|
defaultMessage: 'Description of templates',
|
|
312
308
|
},
|
|
309
|
+
"Sms": {
|
|
310
|
+
id: 'creatives.containers.Templates.Sms',
|
|
311
|
+
defaultMessage: 'Sms',
|
|
312
|
+
},
|
|
313
|
+
"mobilepush": {
|
|
314
|
+
id: 'creatives.containers.Templates.mobilepush',
|
|
315
|
+
defaultMessage: 'mobilepush',
|
|
316
|
+
},
|
|
317
|
+
"Gallery": {
|
|
318
|
+
id: 'creatives.containers.Templates.Gallery',
|
|
319
|
+
defaultMessage: 'Gallery',
|
|
320
|
+
},
|
|
321
|
+
"Email": {
|
|
322
|
+
id: 'creatives.containers.Templates.Email',
|
|
323
|
+
defaultMessage: 'Email',
|
|
324
|
+
},
|
|
325
|
+
"Ebill": {
|
|
326
|
+
id: 'creatives.containers.Templates.Ebill',
|
|
327
|
+
defaultMessage: 'Ebill',
|
|
328
|
+
},
|
|
329
|
+
"Line": {
|
|
330
|
+
id: 'creatives.containers.Templates.Line',
|
|
331
|
+
defaultMessage: 'Line',
|
|
332
|
+
},
|
|
313
333
|
});
|
|
@@ -138,4 +138,28 @@ export default defineMessages({
|
|
|
138
138
|
id: 'creatives.containers.Create.Only_followers',
|
|
139
139
|
defaultMessage: 'Only followers',
|
|
140
140
|
},
|
|
141
|
+
'Upload Image': {
|
|
142
|
+
id: 'creatives.containers.Create.Upload_Image',
|
|
143
|
+
defaultMessage: 'Upload Image',
|
|
144
|
+
},
|
|
145
|
+
'Whether to display the graphic cover on the graphic details page': {
|
|
146
|
+
id: 'creatives.containers.Create.graphic_details_page',
|
|
147
|
+
defaultMessage: 'Whether to display the graphic cover on the graphic details page',
|
|
148
|
+
},
|
|
149
|
+
'Source link*': {
|
|
150
|
+
id: 'creatives.containers.Create.Source_link',
|
|
151
|
+
defaultMessage: 'Source link*',
|
|
152
|
+
},
|
|
153
|
+
'to be displayed on the graphic details page': {
|
|
154
|
+
id: 'creatives.containers.Create.to_be_displayed_on_the_graphic_details_page',
|
|
155
|
+
defaultMessage: 'to be displayed on the graphic details page',
|
|
156
|
+
},
|
|
157
|
+
'Insert Image': {
|
|
158
|
+
id: 'creatives.containers.Create.Insert_Image',
|
|
159
|
+
defaultMessage: 'Insert Image',
|
|
160
|
+
},
|
|
161
|
+
'Example: http://example.com': {
|
|
162
|
+
id: 'creatives.containers.Create.http_example',
|
|
163
|
+
defaultMessage: 'Example: http://example.com',
|
|
164
|
+
},
|
|
141
165
|
});
|
package/i18n.js
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* This will setup the i18n language files and locale data for your app.
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const addLocaleData = require('react-intl').addLocaleData;
|
|
8
|
+
const enLocaleData = require('react-intl/locale-data/en');
|
|
9
|
+
const zhLocaleData = require('react-intl/locale-data/zh');
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import zhTranslationMessages from './translations/zh.json';
|
|
11
|
+
const enTranslationMessages = require('./translations/en.json');
|
|
12
|
+
const zhTranslationMessages = require('./translations/zh.json');
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
const DEFAULT_LOCALE = 'en';
|
|
15
|
+
|
|
16
|
+
const appLocales = [
|
|
16
17
|
'en',
|
|
17
18
|
'zh',
|
|
18
19
|
];
|
|
@@ -20,7 +21,7 @@ export const appLocales = [
|
|
|
20
21
|
addLocaleData(enLocaleData);
|
|
21
22
|
addLocaleData(zhLocaleData);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
const formatTranslationMessages = (locale, messages) => {
|
|
24
25
|
const defaultFormattedMessages = locale !== DEFAULT_LOCALE
|
|
25
26
|
? formatTranslationMessages(DEFAULT_LOCALE, enTranslationMessages)
|
|
26
27
|
: {};
|
|
@@ -33,7 +34,13 @@ export const formatTranslationMessages = (locale, messages) => {
|
|
|
33
34
|
}, {});
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
const translationMessages = {
|
|
37
38
|
en: formatTranslationMessages('en', enTranslationMessages),
|
|
38
39
|
zh: formatTranslationMessages('zh', zhTranslationMessages),
|
|
39
40
|
};
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.appLocales = appLocales;
|
|
44
|
+
exports.formatTranslationMessages = formatTranslationMessages;
|
|
45
|
+
exports.translationMessages = translationMessages;
|
|
46
|
+
exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
package/index.js
CHANGED
|
@@ -3,6 +3,10 @@ import capReducer from './v2Containers/Cap/reducer';
|
|
|
3
3
|
import capSaga from './v2Containers/Cap/sagas';
|
|
4
4
|
import Cap from './v2Containers/Cap/index';
|
|
5
5
|
|
|
6
|
+
import LanguageProvider from './v2Containers/LanguageProvider';
|
|
7
|
+
import LanguageProviderReducer from './v2Containers/LanguageProvider/reducer';
|
|
8
|
+
import LanguageProviderSaga from './v2Containers/LanguageProvider/sagas';
|
|
9
|
+
|
|
6
10
|
import templateReducer from './v2Containers/Templates/reducer';
|
|
7
11
|
import templateSaga from './v2Containers/Templates/sagas';
|
|
8
12
|
import Templates from './v2Containers/Templates/index';
|
|
@@ -63,6 +67,7 @@ export {default as EbillSaga} from './v2Containers/Ebill/sagas';
|
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
const CapContainer = {Cap, capReducer, capSaga};
|
|
70
|
+
const LanguageProviderContainer = {LanguageProvider, LanguageProviderReducer, LanguageProviderSaga};
|
|
66
71
|
const TemplatesContainer = {Templates, templateReducer, templateSaga};
|
|
67
72
|
const SmsCreateContainer = {SmsCreate, smsCreateReducer, smsCreateSaga};
|
|
68
73
|
const SmsEditContainer = {SmsEdit, smsEditReducer, smsEditSaga};
|
|
@@ -91,6 +96,7 @@ export {default as WechatRichmediaTemplatePreview} from './v2Components/Template
|
|
|
91
96
|
CreativesContainer.CreativesContainerReducer = CreativesContainerReducer;
|
|
92
97
|
|
|
93
98
|
export { CapContainer,
|
|
99
|
+
LanguageProviderContainer,
|
|
94
100
|
TemplatesContainer,
|
|
95
101
|
SmsCreateContainer,
|
|
96
102
|
SmsEditContainer,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/creatives-library",
|
|
3
3
|
"author": "meharaj",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"description": "Capillary creatives ui",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.es.js",
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
"jquery": "^3.3.1",
|
|
19
19
|
"load-script": "^1.0.0",
|
|
20
20
|
"normalizr": "^3.2.3",
|
|
21
|
-
"perfect-scrollbar": "^0.7.0",
|
|
22
21
|
"react-datepicker": "^0.46.0",
|
|
23
|
-
"react-grid-layout": "^0.14.6",
|
|
24
22
|
"react-router": "^3.2.0",
|
|
25
23
|
"react-router-dom": "^4.2.2",
|
|
26
24
|
"redux": "3.6.0",
|
|
@@ -29,7 +27,6 @@
|
|
|
29
27
|
"redux-immutable": "3.0.8",
|
|
30
28
|
"reselect": "2.5.4",
|
|
31
29
|
"styled-components": "^3.2.1",
|
|
32
|
-
"warning": "3.0.0",
|
|
33
30
|
"whatwg-fetch": "2.0.1"
|
|
34
31
|
}
|
|
35
32
|
}
|
package/reducers.js
CHANGED
|
@@ -7,7 +7,7 @@ import { combineReducers } from 'redux-immutable';
|
|
|
7
7
|
import { fromJS } from 'immutable';
|
|
8
8
|
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
9
9
|
|
|
10
|
-
import languageProviderReducer from '
|
|
10
|
+
import languageProviderReducer from 'v2Containers/LanguageProvider/reducer';
|
|
11
11
|
import capReducer from 'containers/Cap/reducer';
|
|
12
12
|
import appReducer from 'containers/App/reducer';
|
|
13
13
|
import createSmsReducer from 'containers/Sms/Create/reducer';
|
package/routes.js
CHANGED
|
@@ -11,8 +11,8 @@ import * as ebillSagas from 'containers/Ebill/sagas';
|
|
|
11
11
|
import * as emailSagas from 'containers/Email/sagas';
|
|
12
12
|
import * as templateSagas from 'containers/Templates/sagas';
|
|
13
13
|
import * as lineSagas from 'containers/Line/Create/sagas';
|
|
14
|
+
import * as languageSaga from './v2Containers/LanguageProvider/sagas';
|
|
14
15
|
import {updateCharCount} from './utils/smsCharCountV2';
|
|
15
|
-
|
|
16
16
|
const errorLoading = (err) => {
|
|
17
17
|
console.error('Dynamic page loading failed', err); // eslint-disable-line no-console
|
|
18
18
|
};
|
|
@@ -26,6 +26,7 @@ export default function createRoutes(store) {
|
|
|
26
26
|
updateCharCount("", false); // calling here to get unsubscribeurl from api.
|
|
27
27
|
const { injectReducer, injectSagas } = getAsyncInjectors(store); // eslint-disable-line no-unused-vars
|
|
28
28
|
injectSagas(rootSaga.default);
|
|
29
|
+
injectSagas(languageSaga.default);
|
|
29
30
|
return [
|
|
30
31
|
{
|
|
31
32
|
path: '/',
|
package/services/api.js
CHANGED
|
@@ -9,10 +9,12 @@ import getSchema from './getSchema';
|
|
|
9
9
|
import * as API from '../utils/ApiCaller';
|
|
10
10
|
let API_ENDPOINT = config.development.api_endpoint;
|
|
11
11
|
let API_AUTH_ENDPOINT = config.development.auth_endpoint;
|
|
12
|
+
let ARYA_ENDPOINT = config.development.arya_endpoint;
|
|
12
13
|
let SUBSCRIPTION_API_ENDPOINT = config.development.subscription_api_endpoint;
|
|
13
14
|
if (process.env.NODE_ENV === 'production') {
|
|
14
15
|
API_ENDPOINT = config.production.api_endpoint;
|
|
15
16
|
API_AUTH_ENDPOINT = config.production.auth_endpoint;
|
|
17
|
+
ARYA_ENDPOINT = config.production.arya_endpoint;
|
|
16
18
|
SUBSCRIPTION_API_ENDPOINT = config.production.subscription_api_endpoint;
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -58,8 +60,8 @@ function checkStatus(response) {
|
|
|
58
60
|
if ((response.status >= 200 && response.status < 300) || response.status === 500) {
|
|
59
61
|
return response;
|
|
60
62
|
}
|
|
61
|
-
|
|
62
|
-
redirectIfUnauthenticated(response);
|
|
63
|
+
const isLoginPage = window.location.pathname.indexOf('/login') !== -1;
|
|
64
|
+
if (!isLoginPage) redirectIfUnauthenticated(response);
|
|
63
65
|
|
|
64
66
|
const error = new Error(response.statusText);
|
|
65
67
|
error.response = response;
|
|
@@ -319,6 +321,13 @@ export const createLineTemplate = ({template}) => {
|
|
|
319
321
|
return request(url, getAPICallObject('POST', template));
|
|
320
322
|
};
|
|
321
323
|
|
|
324
|
+
export const getLocizMessage = async (locale) => {
|
|
325
|
+
const appName = 'creatives_v2';
|
|
326
|
+
const url = `${ARYA_ENDPOINT}/translations/${appName}/${locale}`;
|
|
327
|
+
const response = await request(url, getAPICallObject('GET'));
|
|
328
|
+
return response;
|
|
329
|
+
};
|
|
330
|
+
|
|
322
331
|
export const getUnsubscribeUrl = () => {
|
|
323
332
|
const body = {
|
|
324
333
|
orgUnitId: -1,
|