@capillarytech/creatives-library 6.8.2 → 6.8.4
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/package.json +1 -1
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +151 -151
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +33 -33
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -10
- package/v2Components/TemplatePreview/_templatePreview.scss +380 -380
- package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +44 -44
- package/v2Components/TemplatePreview/assets/images/home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/home-screen-ios.svg +16 -16
- package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +134 -134
- package/v2Components/TemplatePreview/assets/images/mobile.svg +23 -23
- package/v2Components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -22
- package/v2Components/TemplatePreview/assets/images/user-icon.svg +18 -18
- package/v2Components/TemplatePreview/assets/images/wechat-home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +77 -77
- package/v2Components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -20
- package/v2Components/TemplatePreview/tests/index.test.js +10 -10
- package/v2Containers/Assets/Gallery/index.js +3 -0
- package/v2Containers/Assets/Gallery/selectors.js +9 -4
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +51 -51
- package/v2Containers/CreativesContainer/actions.js +27 -27
- package/v2Containers/CreativesContainer/constants.js +17 -17
- package/v2Containers/CreativesContainer/index.scss +44 -44
- package/v2Containers/CreativesContainer/messages.js +305 -305
- package/v2Containers/CreativesContainer/reducer.js +29 -29
- package/v2Containers/CreativesContainer/sagas.js +11 -11
- package/v2Containers/CreativesContainer/selectors.js +30 -30
- package/v2Containers/CreativesContainer/tests/actions.test.js +18 -18
- package/v2Containers/CreativesContainer/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -9
- package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -15
- package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -10
- package/v2Containers/Templates/_templates.scss +405 -405
- package/v2Containers/Templates/actions.js +117 -117
- package/v2Containers/Templates/constants.js +47 -47
- package/v2Containers/Templates/reducer.js +145 -145
- package/v2Containers/Templates/sagas.js +179 -179
- package/v2Containers/Templates/tests/actions.test.js +18 -18
- package/v2Containers/Templates/tests/index.test.js +10 -10
- package/v2Containers/Templates/tests/reducer.test.js +9 -9
- package/v2Containers/Templates/tests/sagas.test.js +15 -15
- package/v2Containers/Templates/tests/selectors.test.js +10 -10
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -29
- package/v2Containers/TemplatesV2/actions.js +16 -16
- package/v2Containers/TemplatesV2/constants.js +10 -10
- package/v2Containers/TemplatesV2/messages.js +61 -61
- package/v2Containers/TemplatesV2/selectors.js +25 -25
- package/v2Containers/TemplatesV2/tests/actions.test.js +18 -18
- package/v2Containers/TemplatesV2/tests/index.test.js +10 -10
- package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -9
- package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -15
- package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -10
|
@@ -1,179 +1,179 @@
|
|
|
1
|
-
import { call, put, takeLatest, take, cancel } from 'redux-saga/effects';
|
|
2
|
-
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
3
|
-
// import { schema, normalize } from 'normalizr';
|
|
4
|
-
import * as Api from '../../services/api';
|
|
5
|
-
import * as types from './constants';
|
|
6
|
-
|
|
7
|
-
// Individual exports for testing
|
|
8
|
-
export function* getAllTemplates(channel, queryParams) {
|
|
9
|
-
try {
|
|
10
|
-
const result = yield call(Api.getAllTemplates, channel, queryParams);
|
|
11
|
-
const channelTemplates = (channel.channel === 'wechat') ? {templates: [...result.response.mapped, ...result.response.richmedia]} : result.response;
|
|
12
|
-
// const sidebar = result.response.sidebar;
|
|
13
|
-
if (channel.channel === 'wechat' && channel.queryParams && channel.queryParams.sortBy && channel.queryParams.sortBy.toLocaleLowerCase() === ("Most Recent").toLocaleLowerCase()) {
|
|
14
|
-
channelTemplates.templates.sort((a, b) => {
|
|
15
|
-
const dateA = new Date(a.updatedAt);
|
|
16
|
-
const dateB = new Date(b.updatedAt);
|
|
17
|
-
return dateB - dateA;
|
|
18
|
-
});
|
|
19
|
-
} else if (channel.channel === 'wechat' && channel.queryParams && channel.queryParams.sortBy && channel.queryParams.sortBy.toLocaleLowerCase() === ("Alphabetically").toLocaleLowerCase()) {
|
|
20
|
-
channelTemplates.templates.sort((a, b) => b.name - a.name);
|
|
21
|
-
}
|
|
22
|
-
yield put({ type: types.GET_ALL_TEMPLATES_SUCCESS, data: channelTemplates, weCRMTemplate: result.response.unMapped, isReset: channel.queryParams.page === 1 });
|
|
23
|
-
} catch (error) {
|
|
24
|
-
yield put({ type: types.GET_ALL_TEMPLATES_FAILURE, error });
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function* deleteTemplate(channel, id) {
|
|
29
|
-
try {
|
|
30
|
-
const result = yield call(Api.deleteTemplate, channel, id);
|
|
31
|
-
// const sidebar = result.response.sidebar;
|
|
32
|
-
yield put({ type: types.DELETE_TEMPLATE_SUCCESS, data: result.response });
|
|
33
|
-
} catch (error) {
|
|
34
|
-
yield put({ type: types.DELETE_TEMPLATE_FAILURE, error });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function* fetchUserList() {
|
|
39
|
-
try {
|
|
40
|
-
const result = yield call(Api.getUserList);
|
|
41
|
-
yield [
|
|
42
|
-
put({
|
|
43
|
-
type: types.GET_USER_LIST_SUCCESS,
|
|
44
|
-
data: result.data.result,
|
|
45
|
-
}),
|
|
46
|
-
];
|
|
47
|
-
} catch (error) {
|
|
48
|
-
yield [
|
|
49
|
-
put({
|
|
50
|
-
type: types.GET_USER_LIST_FAILURE,
|
|
51
|
-
data: error,
|
|
52
|
-
}),
|
|
53
|
-
];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function* fetchWeCrmAccounts(action) {
|
|
58
|
-
try {
|
|
59
|
-
const result = yield call(Api.fetchWeCrmAccounts, action.source);
|
|
60
|
-
yield [
|
|
61
|
-
put({
|
|
62
|
-
type: types.GET_WECRM_ACCOUNTS_SUCCESS,
|
|
63
|
-
data: result.response,
|
|
64
|
-
}),
|
|
65
|
-
];
|
|
66
|
-
} catch (error) {
|
|
67
|
-
yield [
|
|
68
|
-
put({
|
|
69
|
-
type: types.GET_WECRM_ACCOUNTS_FAILURE,
|
|
70
|
-
data: error,
|
|
71
|
-
}),
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function* sendZippedFile({selectedFile, errorHandler, successHandler}) {
|
|
77
|
-
let errorMessage = "";
|
|
78
|
-
try {
|
|
79
|
-
const result = yield call(Api.sendZippedFile, selectedFile);
|
|
80
|
-
if (result.status.isError) {
|
|
81
|
-
errorMessage = result.message;
|
|
82
|
-
yield errorHandler(errorMessage);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
console.log("Got Result ", result);
|
|
86
|
-
console.log("Got decoded result", decodeURIComponent(result.response.metaEntity.htmlContent));
|
|
87
|
-
yield [
|
|
88
|
-
put({
|
|
89
|
-
type: types.SEND_ZIPPED_FILE_SUCCESS,
|
|
90
|
-
selectedTemplate: decodeURIComponent(result.response.metaEntity.htmlContent),
|
|
91
|
-
}),
|
|
92
|
-
];
|
|
93
|
-
yield successHandler();
|
|
94
|
-
} catch (error) {
|
|
95
|
-
yield errorHandler();
|
|
96
|
-
yield [
|
|
97
|
-
put({
|
|
98
|
-
type: types.SEND_ZIPPED_FILE_FAILURE,
|
|
99
|
-
data: errorMessage,
|
|
100
|
-
}),
|
|
101
|
-
];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function* getEdmTemplates() {
|
|
106
|
-
try {
|
|
107
|
-
console.log('saga getAllTemplates');
|
|
108
|
-
const result = yield call(Api.getEdmTemplates);
|
|
109
|
-
const edmTemplates = result.response;
|
|
110
|
-
yield put({ type: types.GET_EDM_DEAFULT_TEMPLATES_SUCCESS, data: edmTemplates });
|
|
111
|
-
} catch (error) {
|
|
112
|
-
yield put({ type: types.GET_EDM_DEAFULT_TEMPLATES_FAILURE, error });
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function* getTemplateDetails(id, channel) {
|
|
117
|
-
try {
|
|
118
|
-
console.log('saga get Template details', id);
|
|
119
|
-
const result = yield call(Api.getTemplateDetails, id, channel);
|
|
120
|
-
// const sidebar = result.response.sidebar;
|
|
121
|
-
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
122
|
-
} catch (error) {
|
|
123
|
-
yield put({ type: types.GET_TEMPLATE_DETAILS_FAILURE, error });
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function* watchGetAllTemplates() {
|
|
128
|
-
const watcher = yield takeLatest(types.GET_ALL_TEMPLATES_REQUEST, getAllTemplates);
|
|
129
|
-
yield take(LOCATION_CHANGE);
|
|
130
|
-
yield cancel(watcher);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function* watchDeleteTemplate() {
|
|
134
|
-
const watcher = yield takeLatest(types.DELETE_TEMPLATE_REQUEST, deleteTemplate);
|
|
135
|
-
yield take(LOCATION_CHANGE);
|
|
136
|
-
yield cancel(watcher);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function* watchGetUserList() {
|
|
140
|
-
const watcher = yield takeLatest(types.GET_USER_LIST_REQUEST, fetchUserList);
|
|
141
|
-
yield take(LOCATION_CHANGE);
|
|
142
|
-
yield cancel(watcher);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function* watchFetchWeCrmAccounts() {
|
|
146
|
-
console.log('watching wecrm accounts');
|
|
147
|
-
const watcher = yield takeLatest(types.GET_WECRM_ACCOUNTS_REQUEST, fetchWeCrmAccounts);
|
|
148
|
-
yield take(LOCATION_CHANGE);
|
|
149
|
-
yield cancel(watcher);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function* watchSendingFile() {
|
|
153
|
-
const watcher = yield takeLatest(types.SEND_ZIPPED_FILE_REQUEST, sendZippedFile);
|
|
154
|
-
yield take(LOCATION_CHANGE);
|
|
155
|
-
yield cancel(watcher);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function* watchGetEdmDefaultTemplates() {
|
|
159
|
-
const watcher = yield takeLatest(types.GET_EDM_DEAFULT_TEMPLATES_REQUEST, getEdmTemplates);
|
|
160
|
-
yield take(LOCATION_CHANGE);
|
|
161
|
-
yield cancel(watcher);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function* watchGetTemplateDetails() {
|
|
165
|
-
const watcher = yield takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
|
|
166
|
-
yield take(LOCATION_CHANGE);
|
|
167
|
-
yield cancel(watcher);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// All sagas to be loaded
|
|
171
|
-
export default [
|
|
172
|
-
watchGetAllTemplates,
|
|
173
|
-
watchDeleteTemplate,
|
|
174
|
-
watchGetUserList,
|
|
175
|
-
watchFetchWeCrmAccounts,
|
|
176
|
-
watchSendingFile,
|
|
177
|
-
watchGetEdmDefaultTemplates,
|
|
178
|
-
watchGetTemplateDetails,
|
|
179
|
-
];
|
|
1
|
+
import { call, put, takeLatest, take, cancel } from 'redux-saga/effects';
|
|
2
|
+
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
3
|
+
// import { schema, normalize } from 'normalizr';
|
|
4
|
+
import * as Api from '../../services/api';
|
|
5
|
+
import * as types from './constants';
|
|
6
|
+
|
|
7
|
+
// Individual exports for testing
|
|
8
|
+
export function* getAllTemplates(channel, queryParams) {
|
|
9
|
+
try {
|
|
10
|
+
const result = yield call(Api.getAllTemplates, channel, queryParams);
|
|
11
|
+
const channelTemplates = (channel.channel === 'wechat') ? {templates: [...result.response.mapped, ...result.response.richmedia]} : result.response;
|
|
12
|
+
// const sidebar = result.response.sidebar;
|
|
13
|
+
if (channel.channel === 'wechat' && channel.queryParams && channel.queryParams.sortBy && channel.queryParams.sortBy.toLocaleLowerCase() === ("Most Recent").toLocaleLowerCase()) {
|
|
14
|
+
channelTemplates.templates.sort((a, b) => {
|
|
15
|
+
const dateA = new Date(a.updatedAt);
|
|
16
|
+
const dateB = new Date(b.updatedAt);
|
|
17
|
+
return dateB - dateA;
|
|
18
|
+
});
|
|
19
|
+
} else if (channel.channel === 'wechat' && channel.queryParams && channel.queryParams.sortBy && channel.queryParams.sortBy.toLocaleLowerCase() === ("Alphabetically").toLocaleLowerCase()) {
|
|
20
|
+
channelTemplates.templates.sort((a, b) => b.name - a.name);
|
|
21
|
+
}
|
|
22
|
+
yield put({ type: types.GET_ALL_TEMPLATES_SUCCESS, data: channelTemplates, weCRMTemplate: result.response.unMapped, isReset: channel.queryParams.page === 1 });
|
|
23
|
+
} catch (error) {
|
|
24
|
+
yield put({ type: types.GET_ALL_TEMPLATES_FAILURE, error });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function* deleteTemplate(channel, id) {
|
|
29
|
+
try {
|
|
30
|
+
const result = yield call(Api.deleteTemplate, channel, id);
|
|
31
|
+
// const sidebar = result.response.sidebar;
|
|
32
|
+
yield put({ type: types.DELETE_TEMPLATE_SUCCESS, data: result.response });
|
|
33
|
+
} catch (error) {
|
|
34
|
+
yield put({ type: types.DELETE_TEMPLATE_FAILURE, error });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function* fetchUserList() {
|
|
39
|
+
try {
|
|
40
|
+
const result = yield call(Api.getUserList);
|
|
41
|
+
yield [
|
|
42
|
+
put({
|
|
43
|
+
type: types.GET_USER_LIST_SUCCESS,
|
|
44
|
+
data: result.data.result,
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
47
|
+
} catch (error) {
|
|
48
|
+
yield [
|
|
49
|
+
put({
|
|
50
|
+
type: types.GET_USER_LIST_FAILURE,
|
|
51
|
+
data: error,
|
|
52
|
+
}),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function* fetchWeCrmAccounts(action) {
|
|
58
|
+
try {
|
|
59
|
+
const result = yield call(Api.fetchWeCrmAccounts, action.source);
|
|
60
|
+
yield [
|
|
61
|
+
put({
|
|
62
|
+
type: types.GET_WECRM_ACCOUNTS_SUCCESS,
|
|
63
|
+
data: result.response,
|
|
64
|
+
}),
|
|
65
|
+
];
|
|
66
|
+
} catch (error) {
|
|
67
|
+
yield [
|
|
68
|
+
put({
|
|
69
|
+
type: types.GET_WECRM_ACCOUNTS_FAILURE,
|
|
70
|
+
data: error,
|
|
71
|
+
}),
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function* sendZippedFile({selectedFile, errorHandler, successHandler}) {
|
|
77
|
+
let errorMessage = "";
|
|
78
|
+
try {
|
|
79
|
+
const result = yield call(Api.sendZippedFile, selectedFile);
|
|
80
|
+
if (result.status.isError) {
|
|
81
|
+
errorMessage = result.message;
|
|
82
|
+
yield errorHandler(errorMessage);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
console.log("Got Result ", result);
|
|
86
|
+
console.log("Got decoded result", decodeURIComponent(result.response.metaEntity.htmlContent));
|
|
87
|
+
yield [
|
|
88
|
+
put({
|
|
89
|
+
type: types.SEND_ZIPPED_FILE_SUCCESS,
|
|
90
|
+
selectedTemplate: decodeURIComponent(result.response.metaEntity.htmlContent),
|
|
91
|
+
}),
|
|
92
|
+
];
|
|
93
|
+
yield successHandler();
|
|
94
|
+
} catch (error) {
|
|
95
|
+
yield errorHandler();
|
|
96
|
+
yield [
|
|
97
|
+
put({
|
|
98
|
+
type: types.SEND_ZIPPED_FILE_FAILURE,
|
|
99
|
+
data: errorMessage,
|
|
100
|
+
}),
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function* getEdmTemplates() {
|
|
106
|
+
try {
|
|
107
|
+
console.log('saga getAllTemplates');
|
|
108
|
+
const result = yield call(Api.getEdmTemplates);
|
|
109
|
+
const edmTemplates = result.response;
|
|
110
|
+
yield put({ type: types.GET_EDM_DEAFULT_TEMPLATES_SUCCESS, data: edmTemplates });
|
|
111
|
+
} catch (error) {
|
|
112
|
+
yield put({ type: types.GET_EDM_DEAFULT_TEMPLATES_FAILURE, error });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function* getTemplateDetails(id, channel) {
|
|
117
|
+
try {
|
|
118
|
+
console.log('saga get Template details', id);
|
|
119
|
+
const result = yield call(Api.getTemplateDetails, id, channel);
|
|
120
|
+
// const sidebar = result.response.sidebar;
|
|
121
|
+
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
122
|
+
} catch (error) {
|
|
123
|
+
yield put({ type: types.GET_TEMPLATE_DETAILS_FAILURE, error });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function* watchGetAllTemplates() {
|
|
128
|
+
const watcher = yield takeLatest(types.GET_ALL_TEMPLATES_REQUEST, getAllTemplates);
|
|
129
|
+
yield take(LOCATION_CHANGE);
|
|
130
|
+
yield cancel(watcher);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function* watchDeleteTemplate() {
|
|
134
|
+
const watcher = yield takeLatest(types.DELETE_TEMPLATE_REQUEST, deleteTemplate);
|
|
135
|
+
yield take(LOCATION_CHANGE);
|
|
136
|
+
yield cancel(watcher);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function* watchGetUserList() {
|
|
140
|
+
const watcher = yield takeLatest(types.GET_USER_LIST_REQUEST, fetchUserList);
|
|
141
|
+
yield take(LOCATION_CHANGE);
|
|
142
|
+
yield cancel(watcher);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function* watchFetchWeCrmAccounts() {
|
|
146
|
+
console.log('watching wecrm accounts');
|
|
147
|
+
const watcher = yield takeLatest(types.GET_WECRM_ACCOUNTS_REQUEST, fetchWeCrmAccounts);
|
|
148
|
+
yield take(LOCATION_CHANGE);
|
|
149
|
+
yield cancel(watcher);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function* watchSendingFile() {
|
|
153
|
+
const watcher = yield takeLatest(types.SEND_ZIPPED_FILE_REQUEST, sendZippedFile);
|
|
154
|
+
yield take(LOCATION_CHANGE);
|
|
155
|
+
yield cancel(watcher);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function* watchGetEdmDefaultTemplates() {
|
|
159
|
+
const watcher = yield takeLatest(types.GET_EDM_DEAFULT_TEMPLATES_REQUEST, getEdmTemplates);
|
|
160
|
+
yield take(LOCATION_CHANGE);
|
|
161
|
+
yield cancel(watcher);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function* watchGetTemplateDetails() {
|
|
165
|
+
const watcher = yield takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
|
|
166
|
+
yield take(LOCATION_CHANGE);
|
|
167
|
+
yield cancel(watcher);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// All sagas to be loaded
|
|
171
|
+
export default [
|
|
172
|
+
watchGetAllTemplates,
|
|
173
|
+
watchDeleteTemplate,
|
|
174
|
+
watchGetUserList,
|
|
175
|
+
watchFetchWeCrmAccounts,
|
|
176
|
+
watchSendingFile,
|
|
177
|
+
watchGetEdmDefaultTemplates,
|
|
178
|
+
watchGetTemplateDetails,
|
|
179
|
+
];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
defaultAction,
|
|
4
|
-
} from '../actions';
|
|
5
|
-
import {
|
|
6
|
-
DEFAULT_ACTION,
|
|
7
|
-
} from '../constants';
|
|
8
|
-
|
|
9
|
-
describe('Templates 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
|
-
});
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
defaultAction,
|
|
4
|
+
} from '../actions';
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_ACTION,
|
|
7
|
+
} from '../constants';
|
|
8
|
+
|
|
9
|
+
describe('Templates 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
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// import React from 'react';
|
|
2
|
-
// import { shallow } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
// import { Templates } from '../index';
|
|
5
|
-
|
|
6
|
-
describe('<Templates />', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(false);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
// import { Templates } from '../index';
|
|
5
|
+
|
|
6
|
+
describe('<Templates />', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { fromJS } from 'immutable';
|
|
3
|
-
import templatesReducer from '../reducer';
|
|
4
|
-
|
|
5
|
-
describe('templatesReducer', () => {
|
|
6
|
-
it('returns the initial state', () => {
|
|
7
|
-
expect(templatesReducer(undefined, {})).toEqual(fromJS({}));
|
|
8
|
-
});
|
|
9
|
-
});
|
|
1
|
+
|
|
2
|
+
import { fromJS } from 'immutable';
|
|
3
|
+
import templatesReducer from '../reducer';
|
|
4
|
+
|
|
5
|
+
describe('templatesReducer', () => {
|
|
6
|
+
it('returns the initial state', () => {
|
|
7
|
+
expect(templatesReducer(undefined, {})).toEqual(fromJS({}));
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -1,15 +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
|
-
});
|
|
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
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// import { fromJS } from 'immutable';
|
|
2
|
-
// import { makeSelectTemplatesDomain } from '../selectors';
|
|
3
|
-
|
|
4
|
-
// const selector = makeSelectTemplatesDomain();
|
|
5
|
-
|
|
6
|
-
describe('makeSelectTemplatesDomain', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(false);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectTemplatesDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectTemplatesDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectTemplatesDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { css } from 'styled-components';
|
|
2
|
-
import {CAP_SPACE_24, CAP_SPACE_16} from '@capillarytech/cap-ui-library/styled/variables';
|
|
3
|
-
|
|
4
|
-
export default css`
|
|
5
|
-
.cap-tab-v2-wrapper{
|
|
6
|
-
.ant-tabs-tabpane {
|
|
7
|
-
border: none;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.component-wrapper {
|
|
12
|
-
${(props) => props.isFullMode ? `
|
|
13
|
-
max-width: 1140px;
|
|
14
|
-
margin: 0 auto;
|
|
15
|
-
width: 100%;
|
|
16
|
-
padding: ${CAP_SPACE_24} 0;
|
|
17
|
-
.ant-tabs-content{
|
|
18
|
-
margin-top: ${CAP_SPACE_16}
|
|
19
|
-
}
|
|
20
|
-
` : `.cap-tab-v2 {
|
|
21
|
-
height: calc(100vh - 118px);
|
|
22
|
-
} `}
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
export const CapTabStyle = css`
|
|
27
|
-
${(props) => props.isFullMode ? `margin-top: ${CAP_SPACE_24}` : ``
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import {CAP_SPACE_24, CAP_SPACE_16} from '@capillarytech/cap-ui-library/styled/variables';
|
|
3
|
+
|
|
4
|
+
export default css`
|
|
5
|
+
.cap-tab-v2-wrapper{
|
|
6
|
+
.ant-tabs-tabpane {
|
|
7
|
+
border: none;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.component-wrapper {
|
|
12
|
+
${(props) => props.isFullMode ? `
|
|
13
|
+
max-width: 1140px;
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding: ${CAP_SPACE_24} 0;
|
|
17
|
+
.ant-tabs-content{
|
|
18
|
+
margin-top: ${CAP_SPACE_16}
|
|
19
|
+
}
|
|
20
|
+
` : `.cap-tab-v2 {
|
|
21
|
+
height: calc(100vh - 118px);
|
|
22
|
+
} `}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const CapTabStyle = css`
|
|
27
|
+
${(props) => props.isFullMode ? `margin-top: ${CAP_SPACE_24}` : ``
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import * as types from './constants';
|
|
3
|
-
|
|
4
|
-
export function defaultAction() {
|
|
5
|
-
return {
|
|
6
|
-
type: types.DEFAULT_ACTION,
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function getTemplates({channel, query}) {
|
|
11
|
-
return {
|
|
12
|
-
type: types.GET_TEMPLATES_REQUEST,
|
|
13
|
-
channel,
|
|
14
|
-
query,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
1
|
+
|
|
2
|
+
import * as types from './constants';
|
|
3
|
+
|
|
4
|
+
export function defaultAction() {
|
|
5
|
+
return {
|
|
6
|
+
type: types.DEFAULT_ACTION,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function getTemplates({channel, query}) {
|
|
11
|
+
return {
|
|
12
|
+
type: types.GET_TEMPLATES_REQUEST,
|
|
13
|
+
channel,
|
|
14
|
+
query,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* TemplatesV2 constants
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const DEFAULT_ACTION = 'app/TemplatesV2/DEFAULT_ACTION';
|
|
8
|
-
export const GET_TEMPLATES_REQUEST = 'app/TemplatesV2/GET_TEMPLATES_REQUEST';
|
|
9
|
-
export const GET_TEMPLATES_SUCESS = 'app/TemplatesV2/GET_TEMPLATES_SUCESS';
|
|
10
|
-
export const GET_TEMPLATES_FAILURE = 'app/TemplatesV2/GET_TEMPLATES_FAILURE';
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* TemplatesV2 constants
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_ACTION = 'app/TemplatesV2/DEFAULT_ACTION';
|
|
8
|
+
export const GET_TEMPLATES_REQUEST = 'app/TemplatesV2/GET_TEMPLATES_REQUEST';
|
|
9
|
+
export const GET_TEMPLATES_SUCESS = 'app/TemplatesV2/GET_TEMPLATES_SUCESS';
|
|
10
|
+
export const GET_TEMPLATES_FAILURE = 'app/TemplatesV2/GET_TEMPLATES_FAILURE';
|