@capillarytech/creatives-library 8.0.130 → 8.0.131
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/containers/App/constants.js +1 -0
- package/containers/Login/index.js +1 -2
- package/package.json +1 -1
- package/services/api.js +5 -0
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +8 -3
- package/tests/integration/TemplateCreation/api-response.js +5 -0
- package/tests/integration/TemplateCreation/msw-handler.js +42 -63
- package/utils/common.js +7 -0
- package/utils/commonUtils.js +2 -6
- package/utils/createMobilePushPayload.js +322 -0
- package/utils/tests/createMobilePushPayload.test.js +1054 -0
- package/v2Components/CapDeviceContent/index.js +1 -1
- package/v2Components/CapImageUpload/index.js +57 -44
- package/v2Components/CapInAppCTA/index.js +1 -0
- package/v2Components/CapMpushCTA/constants.js +25 -0
- package/v2Components/CapMpushCTA/index.js +403 -0
- package/v2Components/CapMpushCTA/index.scss +95 -0
- package/v2Components/CapMpushCTA/messages.js +101 -0
- package/v2Components/CapTagList/index.js +178 -121
- package/v2Components/CapVideoUpload/constants.js +3 -0
- package/v2Components/CapVideoUpload/index.js +182 -115
- package/v2Components/CapVideoUpload/messages.js +16 -0
- package/v2Components/Carousel/index.js +15 -13
- package/v2Components/ErrorInfoNote/style.scss +1 -0
- package/v2Components/MobilePushPreviewV2/index.js +57 -12
- package/v2Components/TemplatePreview/_templatePreview.scss +218 -74
- package/v2Components/TemplatePreview/assets/images/Android_With_date_and_time.svg +29 -0
- package/v2Components/TemplatePreview/assets/images/android.svg +9 -0
- package/v2Components/TemplatePreview/assets/images/iOS_With_date_and_time.svg +26 -0
- package/v2Components/TemplatePreview/assets/images/ios.svg +9 -0
- package/v2Components/TemplatePreview/index.js +234 -107
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +10 -10
- package/v2Containers/CreativesContainer/SlideBoxContent.js +127 -62
- package/v2Containers/CreativesContainer/index.js +193 -136
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +0 -22
- package/v2Containers/InApp/constants.js +1 -0
- package/v2Containers/InApp/index.js +13 -13
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +4748 -4658
- package/v2Containers/Login/index.js +1 -2
- package/v2Containers/MobilePush/Create/index.js +1 -0
- package/v2Containers/MobilePush/commonMethods.js +7 -14
- package/v2Containers/MobilePush/tests/commonMethods.test.js +401 -0
- package/v2Containers/MobilePushNew/actions.js +116 -0
- package/v2Containers/MobilePushNew/components/CtaButtons.js +183 -0
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +835 -0
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +346 -0
- package/v2Containers/MobilePushNew/components/index.js +5 -0
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +565 -0
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +3180 -0
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +654 -0
- package/v2Containers/MobilePushNew/constants.js +116 -0
- package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1462 -0
- package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +1459 -0
- package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +366 -0
- package/v2Containers/MobilePushNew/hooks/useUpload.js +740 -0
- package/v2Containers/MobilePushNew/index.js +2158 -0
- package/v2Containers/MobilePushNew/index.scss +308 -0
- package/v2Containers/MobilePushNew/messages.js +272 -0
- package/v2Containers/MobilePushNew/reducer.js +160 -0
- package/v2Containers/MobilePushNew/sagas.js +193 -0
- package/v2Containers/MobilePushNew/selectors.js +55 -0
- package/v2Containers/MobilePushNew/tests/reducer.test.js +741 -0
- package/v2Containers/MobilePushNew/tests/sagas.test.js +864 -0
- package/v2Containers/MobilePushNew/tests/selectors.test.js +665 -0
- package/v2Containers/MobilePushNew/tests/utils.test.js +421 -0
- package/v2Containers/MobilePushNew/utils.js +84 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +1176 -976
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +684 -424
- package/v2Containers/TagList/index.js +56 -10
- package/v2Containers/Templates/_templates.scss +100 -1
- package/v2Containers/Templates/index.js +170 -31
- package/v2Containers/Templates/messages.js +8 -0
- package/v2Containers/Templates/sagas.js +1 -0
- package/v2Containers/Whatsapp/constants.js +1 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +3992 -3677
- package/assets/loading_img.gif +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Create & Edit reducer
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { fromJS } from "immutable";
|
|
8
|
+
import * as types from "./constants";
|
|
9
|
+
|
|
10
|
+
const initialState = fromJS({
|
|
11
|
+
createTemplateInProgress: false,
|
|
12
|
+
response: {},
|
|
13
|
+
editTemplateInProgress: false,
|
|
14
|
+
editResponse: {},
|
|
15
|
+
getTemplateDetailsInProgress: false,
|
|
16
|
+
templateDetails: {},
|
|
17
|
+
createTemplateErrorMessage: "",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export function mobilePushReducer(state = initialState, action) {
|
|
21
|
+
// Handle null or undefined action
|
|
22
|
+
if (!action || typeof action !== 'object') {
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
switch (action.type) {
|
|
27
|
+
case types.DEFAULT_ACTION:
|
|
28
|
+
return state;
|
|
29
|
+
case types.CREATE_TEMPLATE_REQUEST:
|
|
30
|
+
return state
|
|
31
|
+
.set("createTemplateInProgress", true)
|
|
32
|
+
.set("createTemplateError", false)
|
|
33
|
+
.set("createTemplateErrorMessage", fromJS(""));
|
|
34
|
+
case types.CREATE_TEMPLATE_SUCCESS:
|
|
35
|
+
return state
|
|
36
|
+
.set("createTemplateInProgress", false)
|
|
37
|
+
.set("response", action.data)
|
|
38
|
+
.set(
|
|
39
|
+
"createTemplateError",
|
|
40
|
+
action.statusCode !== undefined && action.statusCode > 300
|
|
41
|
+
);
|
|
42
|
+
case types.CREATE_TEMPLATE_FAILURE:
|
|
43
|
+
return state
|
|
44
|
+
.set("createTemplateInProgress", false)
|
|
45
|
+
.set("createTemplateError", true)
|
|
46
|
+
.set("createTemplateErrorMessage", fromJS(action.error));
|
|
47
|
+
case types.CLEAR_CREATE_RESPONSE_REQUEST:
|
|
48
|
+
return state.set("response", {});
|
|
49
|
+
case types.UPLOAD_ASSET_REQUEST:
|
|
50
|
+
return state.set("uploadAssetSuccess", false).set("assetUploading", true);
|
|
51
|
+
case types.UPLOAD_ASSET_SUCCESS:
|
|
52
|
+
return state
|
|
53
|
+
.set(
|
|
54
|
+
"uploadAssetSuccess",
|
|
55
|
+
action.statusCode !== undefined
|
|
56
|
+
&& action.statusCode !== ""
|
|
57
|
+
&& action.statusCode < 300
|
|
58
|
+
)
|
|
59
|
+
.set("assetUploading", false)
|
|
60
|
+
.set(action.index !== undefined ? `uploadedAssetData${action.index}` : "uploadedAssetData", action.data);
|
|
61
|
+
case types.UPLOAD_ASSET_FAILURE:
|
|
62
|
+
return state
|
|
63
|
+
.set("uploadAssetSuccess", false)
|
|
64
|
+
.set("assetUploading", false);
|
|
65
|
+
case types.CLEAR_ASSET:
|
|
66
|
+
return action.index !== undefined
|
|
67
|
+
? state.delete(`uploadedAssetData${action.index}`)
|
|
68
|
+
: state.delete("uploadedAssetData");
|
|
69
|
+
case types.GET_IOS_CTAS:
|
|
70
|
+
return state.set("getIosCtasSucccess", false).set("iosCtasLoading", true);
|
|
71
|
+
case types.GET_IOS_CTAS_SUCCESS:
|
|
72
|
+
return state
|
|
73
|
+
.set(
|
|
74
|
+
"getIosCtasSucccess",
|
|
75
|
+
action.statusCode !== undefined
|
|
76
|
+
&& action.statusCode !== ""
|
|
77
|
+
&& action.statusCode < 300
|
|
78
|
+
)
|
|
79
|
+
.set("iosCtasLoading", false)
|
|
80
|
+
.set("iosCtasData", action.data);
|
|
81
|
+
case types.GET_IOS_CTAS_FAILURE:
|
|
82
|
+
return state
|
|
83
|
+
.set("getIosCtasSucccess", false)
|
|
84
|
+
.set("iosCtasLoading", false);
|
|
85
|
+
case types.RESET_STORE:
|
|
86
|
+
return state
|
|
87
|
+
.delete("uploadedAssetData")
|
|
88
|
+
.delete("uploadedAssetData0")
|
|
89
|
+
.delete("uploadedAssetData1")
|
|
90
|
+
.delete("iosCtasData");
|
|
91
|
+
case types.EDIT_TEMPLATE_REQUEST:
|
|
92
|
+
return state
|
|
93
|
+
.set("editTemplateInProgress", true)
|
|
94
|
+
.set("editTemplateError", false)
|
|
95
|
+
.set("editTemplateErrorMessage", fromJS(""));
|
|
96
|
+
case types.EDIT_TEMPLATE_SUCCESS:
|
|
97
|
+
return state
|
|
98
|
+
.set("editTemplateInProgress", false)
|
|
99
|
+
.set("editResponse", action.data)
|
|
100
|
+
.set(
|
|
101
|
+
"editTemplateError",
|
|
102
|
+
action.statusCode !== undefined && action.statusCode > 300
|
|
103
|
+
)
|
|
104
|
+
.set("editTemplateErrorMessage", fromJS(action.errorMsg));
|
|
105
|
+
case types.EDIT_TEMPLATE_FAILURE:
|
|
106
|
+
return state
|
|
107
|
+
.set("editTemplateInProgress", false)
|
|
108
|
+
.set("editTemplateError", true)
|
|
109
|
+
.set("editTemplateErrorMessage", fromJS(action.errorMsg));
|
|
110
|
+
case types.GET_TEMPLATE_DETAILS_REQUEST:
|
|
111
|
+
return state.set("getTemplateDetailsInProgress", true);
|
|
112
|
+
case types.GET_TEMPLATE_DETAILS_SUCCESS:
|
|
113
|
+
case types.SET_SELECTED_TEMPLATE:
|
|
114
|
+
return state
|
|
115
|
+
.set("getTemplateDetailsInProgress", false)
|
|
116
|
+
.set("templateDetails", action.data);
|
|
117
|
+
case types.GET_TEMPLATE_DETAILS_FAILURE:
|
|
118
|
+
return state.set("getTemplateDetailsInProgress", false);
|
|
119
|
+
case types.CLEAR_EDIT_RESPONSE_REQUEST:
|
|
120
|
+
return state.set("editResponse", {});
|
|
121
|
+
case types.CLEAR_DATA:
|
|
122
|
+
return state
|
|
123
|
+
.delete("uploadedAssetData")
|
|
124
|
+
.delete("uploadedAssetData0")
|
|
125
|
+
.delete("uploadedAssetData1")
|
|
126
|
+
.delete("metaEntities")
|
|
127
|
+
.delete("templateDetails")
|
|
128
|
+
.delete("iosCtasData");
|
|
129
|
+
case types.GET_WECRM_ACCOUNTS_REQUEST:
|
|
130
|
+
return state
|
|
131
|
+
.set("fetchingWeCrmAccounts", true)
|
|
132
|
+
.set("weCrmAccountFetchingError", false);
|
|
133
|
+
case types.GET_WECRM_ACCOUNTS_SUCCESS:
|
|
134
|
+
return state
|
|
135
|
+
.set("fetchingWeCrmAccounts", false)
|
|
136
|
+
.set("weCrmAccounts", fromJS(action.data));
|
|
137
|
+
case types.GET_WECRM_ACCOUNTS_FAILURE:
|
|
138
|
+
return state
|
|
139
|
+
.set("fetchingWeCrmAccounts", false)
|
|
140
|
+
.set("weCrmAccountFetchingError", true);
|
|
141
|
+
case types.SET_WECHAT_ACCOUNT:
|
|
142
|
+
return state
|
|
143
|
+
.set("selectedWeChatAccount", fromJS(action.weChatAccount))
|
|
144
|
+
.delete("mobilepushTemplates");
|
|
145
|
+
case types.GET_MOBILEPUSH_TEMPLATES_LIST_REQUEST:
|
|
146
|
+
return state.set("fetchingDefaultTemplates", true);
|
|
147
|
+
case types.GET_MOBILEPUSH_TEMPLATES_LIST_SUCCESS:
|
|
148
|
+
return state
|
|
149
|
+
.set("fetchingDefaultTemplates", false)
|
|
150
|
+
.set("mobilepushTemplates", fromJS(action.data));
|
|
151
|
+
case types.GET_MOBILEPUSH_TEMPLATES_LIST_FAILURE:
|
|
152
|
+
return state
|
|
153
|
+
.set("fetchingDefaultTemplates", false)
|
|
154
|
+
.set("errorFetchingDefaultTempalte", true);
|
|
155
|
+
default:
|
|
156
|
+
return state;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default mobilePushReducer;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import {
|
|
2
|
+
call, put, takeLatest, all,
|
|
3
|
+
} from "redux-saga/effects";
|
|
4
|
+
import * as Api from "../../services/api";
|
|
5
|
+
import * as types from "./constants";
|
|
6
|
+
|
|
7
|
+
export function* createTemplate({template, callback}) {
|
|
8
|
+
let errorMsg;
|
|
9
|
+
try {
|
|
10
|
+
const result = yield call(Api.createMobilePushTemplateV2, template);
|
|
11
|
+
if (result.message) {
|
|
12
|
+
errorMsg = result.message;
|
|
13
|
+
if (result.status && result.status.code >= 400) {
|
|
14
|
+
throw errorMsg;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (callback) {
|
|
18
|
+
yield call(callback, result.response);
|
|
19
|
+
}
|
|
20
|
+
yield put({
|
|
21
|
+
type: types.CREATE_TEMPLATE_SUCCESS,
|
|
22
|
+
data: result.response,
|
|
23
|
+
statusCode: result.status ? result.status.code : "",
|
|
24
|
+
errorMsg,
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
yield put({ type: types.CREATE_TEMPLATE_FAILURE, error, errorMsg });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function* uploadAsset(action) {
|
|
31
|
+
try {
|
|
32
|
+
const {
|
|
33
|
+
file, assetType, fileParams, index, mobilePushParams = {},
|
|
34
|
+
} = action;
|
|
35
|
+
const uploadParams = {
|
|
36
|
+
file,
|
|
37
|
+
assetType,
|
|
38
|
+
fileParams,
|
|
39
|
+
...mobilePushParams,
|
|
40
|
+
};
|
|
41
|
+
const result = yield call(Api.uploadFile, uploadParams);
|
|
42
|
+
|
|
43
|
+
yield put({
|
|
44
|
+
type: types.UPLOAD_ASSET_SUCCESS,
|
|
45
|
+
data: result.response.asset,
|
|
46
|
+
statusCode: result.status ? result.status.code : "",
|
|
47
|
+
index,
|
|
48
|
+
});
|
|
49
|
+
} catch (error) {
|
|
50
|
+
yield put({ type: types.UPLOAD_ASSET_FAILURE, error });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function* watchCreateTemplate() {
|
|
55
|
+
yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
|
|
56
|
+
}
|
|
57
|
+
export function* watchUploadAsset() {
|
|
58
|
+
yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
|
|
59
|
+
}
|
|
60
|
+
export function* watchGetIosCtas() {
|
|
61
|
+
yield takeLatest(types.GET_IOS_CTAS, getIosCtas);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function* editTemplate({ template, callback }) {
|
|
65
|
+
let errorMsg;
|
|
66
|
+
try {
|
|
67
|
+
// Use the same API endpoint as create - backend determines create vs edit based on _id presence
|
|
68
|
+
const result = yield call(Api.createMobilePushTemplateV2, template);
|
|
69
|
+
// Check for error status codes (400+)
|
|
70
|
+
if (result.status.code >= 400) {
|
|
71
|
+
errorMsg = result.message || `HTTP Error ${result.status.code}`;
|
|
72
|
+
throw errorMsg;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// For edit operations, we need to structure the response similar to create
|
|
76
|
+
// The Templates container expects a templateId field
|
|
77
|
+
const editResponseData = {
|
|
78
|
+
...result.response,
|
|
79
|
+
templateId: result?.response?.templateId?._id || result?.response?._id || template._id,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
yield put({
|
|
83
|
+
type: types.EDIT_TEMPLATE_SUCCESS,
|
|
84
|
+
data: editResponseData,
|
|
85
|
+
statusCode: result.status ? result.status.code : "",
|
|
86
|
+
errorMsg,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Call callback with proper response structure
|
|
90
|
+
if (callback) {
|
|
91
|
+
yield call(callback, editResponseData);
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
yield put({ type: types.EDIT_TEMPLATE_FAILURE, error, errorMsg });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function* getTemplateDetails(id) {
|
|
99
|
+
try {
|
|
100
|
+
const result = yield call(Api.getTemplateDetails, id);
|
|
101
|
+
yield put({
|
|
102
|
+
type: types.GET_TEMPLATE_DETAILS_SUCCESS,
|
|
103
|
+
data: result.response,
|
|
104
|
+
});
|
|
105
|
+
} catch (error) {
|
|
106
|
+
yield put({ type: types.GET_TEMPLATE_DETAILS_FAILURE, error });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function* getIosCtas(licenseCode) {
|
|
111
|
+
try {
|
|
112
|
+
const result = yield call(Api.getIosCtas, licenseCode);
|
|
113
|
+
yield put({
|
|
114
|
+
type: types.GET_IOS_CTAS_SUCCESS,
|
|
115
|
+
data: result.response.metaEntities.data,
|
|
116
|
+
statusCode: result.status ? result.status.code : "",
|
|
117
|
+
});
|
|
118
|
+
} catch (error) {
|
|
119
|
+
yield put({ type: types.GET_IOS_CTAS_FAILURE, error });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function* getMobilepushTemplatesList(params) {
|
|
124
|
+
try {
|
|
125
|
+
const result = yield call(Api.getAllTemplates, {
|
|
126
|
+
channel: params.channel,
|
|
127
|
+
queryParams: params.queryParams,
|
|
128
|
+
});
|
|
129
|
+
yield put({
|
|
130
|
+
type: types.GET_MOBILEPUSH_TEMPLATES_LIST_SUCCESS,
|
|
131
|
+
data: result.response.templates,
|
|
132
|
+
templateData: result.response.mapped,
|
|
133
|
+
});
|
|
134
|
+
} catch (error) {
|
|
135
|
+
yield put({ type: types.GET_MOBILEPUSH_TEMPLATES_LIST_FAILURE, error });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function* fetchWeCrmAccounts(action) {
|
|
140
|
+
try {
|
|
141
|
+
const result = yield call(Api.fetchWeCrmAccounts, action.source);
|
|
142
|
+
yield put({
|
|
143
|
+
type: types.GET_WECRM_ACCOUNTS_SUCCESS,
|
|
144
|
+
data: result.response,
|
|
145
|
+
});
|
|
146
|
+
} catch (error) {
|
|
147
|
+
yield put({
|
|
148
|
+
type: types.GET_WECRM_ACCOUNTS_FAILURE,
|
|
149
|
+
data: error,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function* watchFetchWeCrmAccounts() {
|
|
155
|
+
yield takeLatest(types.GET_WECRM_ACCOUNTS_REQUEST, fetchWeCrmAccounts);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function* watchEditTemplate() {
|
|
159
|
+
yield takeLatest(types.EDIT_TEMPLATE_REQUEST, editTemplate);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function* watchGetTemplateDetails() {
|
|
163
|
+
yield takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function* watchMobilepushTemplatesList() {
|
|
167
|
+
yield takeLatest(
|
|
168
|
+
types.GET_MOBILEPUSH_TEMPLATES_LIST_REQUEST,
|
|
169
|
+
getMobilepushTemplatesList
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export default [
|
|
174
|
+
watchEditTemplate,
|
|
175
|
+
watchCreateTemplate,
|
|
176
|
+
watchGetTemplateDetails,
|
|
177
|
+
watchFetchWeCrmAccounts,
|
|
178
|
+
watchMobilepushTemplatesList,
|
|
179
|
+
watchUploadAsset,
|
|
180
|
+
watchGetIosCtas,
|
|
181
|
+
];
|
|
182
|
+
|
|
183
|
+
export function* v2MobilePushSagas() {
|
|
184
|
+
yield all([
|
|
185
|
+
watchCreateTemplate(),
|
|
186
|
+
watchEditTemplate(),
|
|
187
|
+
watchGetTemplateDetails(),
|
|
188
|
+
watchFetchWeCrmAccounts(),
|
|
189
|
+
watchMobilepushTemplatesList(),
|
|
190
|
+
watchUploadAsset(),
|
|
191
|
+
watchGetIosCtas(),
|
|
192
|
+
]);
|
|
193
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import { fromJS } from 'immutable';
|
|
3
|
+
|
|
4
|
+
// New selectors for MobilePushNew
|
|
5
|
+
const selectMobilePushNewDomain = () => (state) => state.get('mobilePushNew') || fromJS({});
|
|
6
|
+
|
|
7
|
+
const makeSelectMobilePushNew = () => createSelector(
|
|
8
|
+
selectMobilePushNewDomain(),
|
|
9
|
+
(substate) => substate.toJS()
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const makeSelectUploadedAssetData = () => createSelector(
|
|
13
|
+
selectMobilePushNewDomain(),
|
|
14
|
+
(substate) => substate.get('uploadedAssetData') || {}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const makeSelectUploadedAssetData0 = () => createSelector(
|
|
18
|
+
selectMobilePushNewDomain(),
|
|
19
|
+
(substate) => substate.get('uploadedAssetData0') || {}
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const makeSelectUploadedAssetData1 = () => createSelector(
|
|
23
|
+
selectMobilePushNewDomain(),
|
|
24
|
+
(substate) => substate.get('uploadedAssetData1') || {}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const makeSelectUploadAssetSuccess = () => createSelector(
|
|
28
|
+
selectMobilePushNewDomain(),
|
|
29
|
+
(substate) => substate.get('uploadAssetSuccess') || false
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const makeSelectCreateError = () => createSelector(
|
|
33
|
+
selectMobilePushNewDomain(), (dimensionState) => dimensionState.get('createTemplateErrorMessage') || ""
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const makeSelectAssetUploading = () => createSelector(
|
|
37
|
+
selectMobilePushNewDomain(),
|
|
38
|
+
(substate) => substate.get('assetUploading') || false
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const makeSelectGetTemplateDetailsInProgress = () => createSelector(
|
|
42
|
+
selectMobilePushNewDomain(),
|
|
43
|
+
(substate) => substate.get('getTemplateDetailsInProgress') || false
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
makeSelectMobilePushNew,
|
|
48
|
+
makeSelectUploadedAssetData,
|
|
49
|
+
makeSelectUploadedAssetData0,
|
|
50
|
+
makeSelectUploadedAssetData1,
|
|
51
|
+
makeSelectUploadAssetSuccess,
|
|
52
|
+
makeSelectCreateError,
|
|
53
|
+
makeSelectAssetUploading,
|
|
54
|
+
makeSelectGetTemplateDetailsInProgress,
|
|
55
|
+
};
|