@capillarytech/creatives-library 6.11.4 → 6.11.5
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 +3 -3
- package/config/app.js +2 -2
- package/containers/Cap/sagas.js +3 -2
- package/package.json +1 -1
- package/translations/en.json +15 -14
- package/translations/zh.json +15 -14
- package/v2Containers/Cap/actions.js +1 -1
- package/v2Containers/Cap/constants.js +3 -3
- package/v2Containers/Cap/reducer.js +3 -3
- package/v2Containers/Cap/sagas.js +8 -8
- package/v2Containers/LanguageProvider/index.js +1 -1
package/app.js
CHANGED
|
@@ -37,7 +37,7 @@ const history = syncHistoryWithStore(browserHistory, store, {
|
|
|
37
37
|
selectLocationState: makeSelectLocationState(),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const bugSnagErrorCallback =
|
|
40
|
+
const bugSnagErrorCallback = event => {
|
|
41
41
|
let userId;
|
|
42
42
|
let userName;
|
|
43
43
|
let userEmail;
|
|
@@ -66,7 +66,7 @@ const bugSnagErrorCallback = (event) => {
|
|
|
66
66
|
event.addMetadata('org', {
|
|
67
67
|
name: orgName,
|
|
68
68
|
id: orgId,
|
|
69
|
-
})
|
|
69
|
+
})
|
|
70
70
|
event.setUser(userId, userEmail, userName);
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -87,7 +87,7 @@ export const BugsnagClient = Bugsnag;
|
|
|
87
87
|
const rootRoute = {
|
|
88
88
|
component: (props) => {
|
|
89
89
|
// eslint-disable-next-line react/prop-types
|
|
90
|
-
if (props.location.pathname === 'v2'
|
|
90
|
+
if (props.location.pathname === 'v2') {
|
|
91
91
|
return <CapV2 {...props} />;
|
|
92
92
|
}
|
|
93
93
|
return <Cap {...props} />;
|
package/config/app.js
CHANGED
|
@@ -7,7 +7,7 @@ const config = {
|
|
|
7
7
|
campaigns_api_endpoint: '/iris/v2/campaigns',
|
|
8
8
|
auth_endpoint: '/arya/api/v1/auth',
|
|
9
9
|
arya_endpoint: '/arya/api/v1',
|
|
10
|
-
login_url: '
|
|
10
|
+
login_url: 'auth/login',
|
|
11
11
|
dashboard_url: '/sms',
|
|
12
12
|
dashboard_url_v2: '/v2',
|
|
13
13
|
subscription_api_endpoint: '/arya/api/v1/org-settings/subscription',
|
|
@@ -19,7 +19,7 @@ const config = {
|
|
|
19
19
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
|
20
20
|
arya_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1',
|
|
21
21
|
subscription_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/org-settings/subscription',
|
|
22
|
-
login_url: '
|
|
22
|
+
login_url: 'auth/login',
|
|
23
23
|
dashboard_url: '/sms',
|
|
24
24
|
dashboard_url_v2: '/v2',
|
|
25
25
|
},
|
package/containers/Cap/sagas.js
CHANGED
|
@@ -5,6 +5,7 @@ import * as Api from '../../services/api';
|
|
|
5
5
|
import * as LocalStorage from '../../services/localStorageApi';
|
|
6
6
|
import * as types from './constants';
|
|
7
7
|
import config from '../../config/app';
|
|
8
|
+
import pathConfig from '../../config/path';
|
|
8
9
|
// import {makeSelectOrgId} from './selectors';
|
|
9
10
|
|
|
10
11
|
function* authorize(user) {
|
|
@@ -55,13 +56,13 @@ function* logoutFlow() {
|
|
|
55
56
|
const serverLogout = yield call(Api.logout);
|
|
56
57
|
if (serverLogout.success && serverLogout.success === true) {
|
|
57
58
|
const loginUrl = (process.env.NODE_ENV === 'production') ?
|
|
58
|
-
`${config.production.login_url}` : `${config.development.login_url}`;
|
|
59
|
+
`${pathConfig.publicPath}${config.production.login_url}` : `${pathConfig.publicPath}${config.development.login_url}`;
|
|
59
60
|
yield [put({type: types.LOGOUT_SUCCESS})];
|
|
60
61
|
yield call(LocalStorage.clearItem, 'token');
|
|
61
62
|
yield call(LocalStorage.clearItem, 'orgID');
|
|
62
63
|
yield call(LocalStorage.clearItem, 'user');
|
|
63
64
|
yield call(LocalStorage.clearItem, 'isLoggedIn');
|
|
64
|
-
window.location.href =
|
|
65
|
+
window.location.href = loginUrl;
|
|
65
66
|
}
|
|
66
67
|
} catch (error) {
|
|
67
68
|
yield put({ type: types.LOGOUT_FAILURE, error });
|
package/package.json
CHANGED
package/translations/en.json
CHANGED
|
@@ -86,6 +86,21 @@
|
|
|
86
86
|
"creatives.components.WechatRichmediaTemplatePreview.header": "This is the WechatRichmediaTemplatePreview component !",
|
|
87
87
|
"creatives.components.WechatRichmediaTemplatePreview.reply": "Reply",
|
|
88
88
|
"creatives.components.WechatRichmediaTemplatePreview.select": "Select",
|
|
89
|
+
"creatives.componentsV2.BeeEditor.addLabel": "Add label",
|
|
90
|
+
"creatives.componentsV2.BeeEditor.cancel": "Cancel",
|
|
91
|
+
"creatives.componentsV2.BeeEditor.cta": "CTA",
|
|
92
|
+
"creatives.componentsV2.BeeEditor.customRows": "Custom rows",
|
|
93
|
+
"creatives.componentsV2.BeeEditor.footer": "Footer",
|
|
94
|
+
"creatives.componentsV2.BeeEditor.header": "Header",
|
|
95
|
+
"creatives.componentsV2.BeeEditor.others": "Others",
|
|
96
|
+
"creatives.componentsV2.BeeEditor.rowName": "Row name",
|
|
97
|
+
"creatives.componentsV2.BeeEditor.rowPlaceHolder": "Enter Row name",
|
|
98
|
+
"creatives.componentsV2.BeeEditor.save": "Save",
|
|
99
|
+
"creatives.componentsV2.BeeEditor.select": "Select",
|
|
100
|
+
"creatives.componentsV2.BeeEditor.selectCategoyPlaceholder": "Select category",
|
|
101
|
+
"creatives.componentsV2.BeeEditor.socialPlatform": "Social platform",
|
|
102
|
+
"creatives.componentsV2.BeeEditor.tagPlaceHolder": "Enter tags",
|
|
103
|
+
"creatives.componentsV2.BeeEditor.tags": "Tags (optional)",
|
|
89
104
|
"creatives.componentsV2.BreadCrumbs.header": "This is the BreadCrumbs component !",
|
|
90
105
|
"creatives.componentsV2.CallTaskPreview.header": "This is the CallTaskPreview component !",
|
|
91
106
|
"creatives.componentsV2.CapTagList.Cancel": "Cancel",
|
|
@@ -778,20 +793,6 @@
|
|
|
778
793
|
"creatives.containersV2.Assets.Gallery.uploadedAt": "Uploaded at",
|
|
779
794
|
"creatives.containersV2.Assets.Gallery.uploadedBy": "Uploaded by",
|
|
780
795
|
"creatives.containersV2.Assets.Gallery.uploadedOn": "Uploaded on",
|
|
781
|
-
"creatives.containersV2.BeeEditor.addLabel": "Add label",
|
|
782
|
-
"creatives.containersV2.BeeEditor.cta": "CTA",
|
|
783
|
-
"creatives.containersV2.BeeEditor.customRows": "Create new row",
|
|
784
|
-
"creatives.containersV2.BeeEditor.done": "Done",
|
|
785
|
-
"creatives.containersV2.BeeEditor.footer": "Footer",
|
|
786
|
-
"creatives.containersV2.BeeEditor.header": "Header",
|
|
787
|
-
"creatives.containersV2.BeeEditor.others": "Others",
|
|
788
|
-
"creatives.containersV2.BeeEditor.rowCreationFailureMgs": "Error in row creation",
|
|
789
|
-
"creatives.containersV2.BeeEditor.rowCreationSuccessMgs": "Row created successfully",
|
|
790
|
-
"creatives.containersV2.BeeEditor.rowName": "Row name",
|
|
791
|
-
"creatives.containersV2.BeeEditor.rowPlaceHolder": "Enter Row name",
|
|
792
|
-
"creatives.containersV2.BeeEditor.select": "Select",
|
|
793
|
-
"creatives.containersV2.BeeEditor.selectCategoyPlaceholder": "Select category",
|
|
794
|
-
"creatives.containersV2.BeeEditor.socialPlatform": "Social platform",
|
|
795
796
|
"creatives.containersV2.CallTask.addNewCallTask": "Add new call task",
|
|
796
797
|
"creatives.containersV2.CallTask.callTaskInfo": "Call Tasks are message sent to store staff. The messages are displayed on the Point of Sale (POS) machines for store staff to take action.",
|
|
797
798
|
"creatives.containersV2.CallTask.callTaskTitleIllustartion": "Create a Call Task {templateText}",
|
package/translations/zh.json
CHANGED
|
@@ -86,6 +86,21 @@
|
|
|
86
86
|
"creatives.components.WechatRichmediaTemplatePreview.header": "",
|
|
87
87
|
"creatives.components.WechatRichmediaTemplatePreview.reply": "",
|
|
88
88
|
"creatives.components.WechatRichmediaTemplatePreview.select": "",
|
|
89
|
+
"creatives.componentsV2.BeeEditor.addLabel": "",
|
|
90
|
+
"creatives.componentsV2.BeeEditor.cancel": "",
|
|
91
|
+
"creatives.componentsV2.BeeEditor.cta": "",
|
|
92
|
+
"creatives.componentsV2.BeeEditor.customRows": "",
|
|
93
|
+
"creatives.componentsV2.BeeEditor.footer": "",
|
|
94
|
+
"creatives.componentsV2.BeeEditor.header": "",
|
|
95
|
+
"creatives.componentsV2.BeeEditor.others": "",
|
|
96
|
+
"creatives.componentsV2.BeeEditor.rowName": "",
|
|
97
|
+
"creatives.componentsV2.BeeEditor.rowPlaceHolder": "",
|
|
98
|
+
"creatives.componentsV2.BeeEditor.save": "",
|
|
99
|
+
"creatives.componentsV2.BeeEditor.select": "",
|
|
100
|
+
"creatives.componentsV2.BeeEditor.selectCategoyPlaceholder": "",
|
|
101
|
+
"creatives.componentsV2.BeeEditor.socialPlatform": "",
|
|
102
|
+
"creatives.componentsV2.BeeEditor.tagPlaceHolder": "",
|
|
103
|
+
"creatives.componentsV2.BeeEditor.tags": "",
|
|
89
104
|
"creatives.componentsV2.BreadCrumbs.header": "",
|
|
90
105
|
"creatives.componentsV2.CallTaskPreview.header": "",
|
|
91
106
|
"creatives.componentsV2.CapTagList.Cancel": "",
|
|
@@ -778,20 +793,6 @@
|
|
|
778
793
|
"creatives.containersV2.Assets.Gallery.uploadedAt": "",
|
|
779
794
|
"creatives.containersV2.Assets.Gallery.uploadedBy": "",
|
|
780
795
|
"creatives.containersV2.Assets.Gallery.uploadedOn": "",
|
|
781
|
-
"creatives.containersV2.BeeEditor.addLabel": "",
|
|
782
|
-
"creatives.containersV2.BeeEditor.cta": "",
|
|
783
|
-
"creatives.containersV2.BeeEditor.customRows": "",
|
|
784
|
-
"creatives.containersV2.BeeEditor.done": "",
|
|
785
|
-
"creatives.containersV2.BeeEditor.footer": "",
|
|
786
|
-
"creatives.containersV2.BeeEditor.header": "",
|
|
787
|
-
"creatives.containersV2.BeeEditor.others": "",
|
|
788
|
-
"creatives.containersV2.BeeEditor.rowCreationFailureMgs": "",
|
|
789
|
-
"creatives.containersV2.BeeEditor.rowCreationSuccessMgs": "",
|
|
790
|
-
"creatives.containersV2.BeeEditor.rowName": "",
|
|
791
|
-
"creatives.containersV2.BeeEditor.rowPlaceHolder": "",
|
|
792
|
-
"creatives.containersV2.BeeEditor.select": "",
|
|
793
|
-
"creatives.containersV2.BeeEditor.selectCategoyPlaceholder": "",
|
|
794
|
-
"creatives.containersV2.BeeEditor.socialPlatform": "",
|
|
795
796
|
"creatives.containersV2.CallTask.addNewCallTask": "",
|
|
796
797
|
"creatives.containersV2.CallTask.callTaskInfo": "",
|
|
797
798
|
"creatives.containersV2.CallTask.callTaskTitleIllustartion": "",
|
|
@@ -6,9 +6,9 @@ export const LOGIN_REQUEST = 'cap/LOGIN_REQUEST';
|
|
|
6
6
|
export const LOGIN_SUCCESS = 'cap/LOGIN_SUCCESS';
|
|
7
7
|
export const LOGIN_FAILURE = 'cap/LOGIN_FAILURE';
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
9
|
+
export const LOGOUT_REQUEST = 'cap/LOGOUT_REQUEST';
|
|
10
|
+
export const LOGOUT_SUCCESS = 'cap/LOGOUT_SUCCESS';
|
|
11
|
+
export const LOGOUT_FAILURE = 'cap/LOGOUT_FAILURE';
|
|
12
12
|
export const ADD_MESSAGE = 'cap/ADD_MESSAGE';
|
|
13
13
|
export const REMOVE_MESSAGE = 'cap/REMOVE_MESSAGE';
|
|
14
14
|
export const GET_USER_DATA_REQUEST = 'cap/GET_USER_DATA_REQUEST';
|
|
@@ -22,11 +22,11 @@ function capReducer(state = fromJS(initialState.cap), action) {
|
|
|
22
22
|
return state
|
|
23
23
|
.set('login_progress', false)
|
|
24
24
|
.set('message', action.error.message);
|
|
25
|
-
case types.
|
|
25
|
+
case types.LOGOUT_REQUEST:
|
|
26
26
|
return state.set('login_progress', false);
|
|
27
|
-
case types.
|
|
27
|
+
case types.LOGOUT_SUCCESS:
|
|
28
28
|
return state;
|
|
29
|
-
case types.
|
|
29
|
+
case types.LOGOUT_FAILURE:
|
|
30
30
|
return state;
|
|
31
31
|
case types.SWITCH_ORG_REQUEST:
|
|
32
32
|
return state
|
|
@@ -5,7 +5,7 @@ import * as Api from '../../services/api';
|
|
|
5
5
|
import * as LocalStorage from '../../services/localStorageApi';
|
|
6
6
|
import * as types from './constants';
|
|
7
7
|
import config from '../../config/app';
|
|
8
|
-
|
|
8
|
+
import pathConfig from '../../config/path';
|
|
9
9
|
import { getTopbarMenuDataValue } from '../../v2Containers/App/constants';
|
|
10
10
|
// import {makeSelectOrgId} from './selectors';
|
|
11
11
|
|
|
@@ -42,8 +42,8 @@ function* loginFlow() {
|
|
|
42
42
|
while (condition) {
|
|
43
43
|
const { user } = yield take(types.LOGIN_REQUEST);
|
|
44
44
|
const task = yield fork(authorize, user);
|
|
45
|
-
const action = yield take([types.
|
|
46
|
-
if (action.type === types.
|
|
45
|
+
const action = yield take([types.LOGOUT_REQUEST, types.LOGIN_FAILURE]);
|
|
46
|
+
if (action.type === types.LOGOUT_REQUEST) {
|
|
47
47
|
yield cancel(task);
|
|
48
48
|
}
|
|
49
49
|
// yield call(LocalStorage.clearItem, 'token');
|
|
@@ -57,16 +57,16 @@ function* logoutFlow() {
|
|
|
57
57
|
const serverLogout = yield call(Api.logout);
|
|
58
58
|
if (serverLogout.success && serverLogout.success === true) {
|
|
59
59
|
const loginUrl = (process.env.NODE_ENV === 'production') ?
|
|
60
|
-
`${config.production.login_url}` : `${config.development.login_url}`;
|
|
61
|
-
yield [put({type: types.
|
|
60
|
+
`${pathConfig.publicPath}${config.production.login_url}` : `${pathConfig.publicPath}${config.development.login_url}`;
|
|
61
|
+
yield [put({type: types.LOGOUT_SUCCESS})];
|
|
62
62
|
yield call(LocalStorage.clearItem, 'token');
|
|
63
63
|
yield call(LocalStorage.clearItem, 'orgID');
|
|
64
64
|
yield call(LocalStorage.clearItem, 'user');
|
|
65
65
|
yield call(LocalStorage.clearItem, 'isLoggedIn');
|
|
66
|
-
window.location.href =
|
|
66
|
+
window.location.href = loginUrl;
|
|
67
67
|
}
|
|
68
68
|
} catch (error) {
|
|
69
|
-
yield put({ type: types.
|
|
69
|
+
yield put({ type: types.LOGOUT_FAILURE, error });
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -141,7 +141,7 @@ function* watchForOrgChange() {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
function* watchForLogoutFlow() {
|
|
144
|
-
yield takeLatest(types.
|
|
144
|
+
yield takeLatest(types.LOGOUT_REQUEST, logoutFlow);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
function* watchForFetchUserInfo() {
|
|
@@ -45,7 +45,7 @@ export class LanguageProvider extends React.PureComponent { // eslint-disable-li
|
|
|
45
45
|
let locale = localStorage.getItem('jlocale') || 'en';
|
|
46
46
|
moment.locale(locale);
|
|
47
47
|
if (user) {
|
|
48
|
-
locale = JSON.parse(user).lang
|
|
48
|
+
locale = JSON.parse(user).lang;
|
|
49
49
|
}
|
|
50
50
|
locale = this.getMappedLocale(locale);
|
|
51
51
|
this.props.actions.getLocizMessage(locale);
|