@capillarytech/creatives-library 8.0.345-alpha.13 → 8.0.345-alpha.14
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/services/api.js +0 -20
- package/services/tests/api.test.js +0 -59
- package/v2Components/CapCustomSkeleton/index.js +1 -1
- package/v2Components/CapCustomSkeleton/tests/__snapshots__/index.test.js.snap +12 -12
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -3
- package/v2Containers/CreativesContainer/index.js +0 -5
- package/v2Containers/CreativesContainer/messages.js +0 -4
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -3
- package/v2Containers/Email/reducer.js +11 -3
- package/v2Containers/Email/sagas.js +9 -5
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +4 -0
- package/v2Containers/Email/tests/sagas.test.js +21 -3
- package/v2Containers/Templates/ChannelTypeIllustration.js +6 -23
- package/v2Containers/Templates/_templates.scss +24 -130
- package/v2Containers/Templates/actions.js +0 -36
- package/v2Containers/Templates/constants.js +0 -23
- package/v2Containers/Templates/index.js +30 -286
- package/v2Containers/Templates/messages.js +0 -68
- package/v2Containers/Templates/reducer.js +0 -68
- package/v2Containers/Templates/sagas.js +1 -89
- package/v2Containers/Templates/selectors.js +0 -12
- package/v2Containers/Templates/tests/ChannelTypeIllustration.test.js +0 -12
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1122 -1300
- package/v2Containers/Templates/tests/index.test.js +0 -6
- package/v2Containers/Templates/tests/reducer.test.js +0 -178
- package/v2Containers/Templates/tests/sagas.test.js +8 -314
- package/v2Containers/Templates/tests/selector.test.js +0 -32
- package/v2Containers/Assets/images/archive_Empty_Illustration.svg +0 -9
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -361,26 +361,6 @@ export const deleteTemplate = ({channel, id}) => {
|
|
|
361
361
|
//return API.deleteResource(url);
|
|
362
362
|
};
|
|
363
363
|
|
|
364
|
-
export const archiveTemplate = ({ channel, id }) => {
|
|
365
|
-
const url = `${API_ENDPOINT}/templates/archive/${id}/${channel}`;
|
|
366
|
-
return request(url, getAPICallObject('PUT'));
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
export const unarchiveTemplate = ({ channel, id }) => {
|
|
370
|
-
const url = `${API_ENDPOINT}/templates/unarchive/${id}/${channel}`;
|
|
371
|
-
return request(url, getAPICallObject('PUT'));
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
export const bulkArchiveTemplates = ({ channel, ids }) => {
|
|
375
|
-
const url = `${API_ENDPOINT}/templates/archive/bulk/${channel}`;
|
|
376
|
-
return request(url, getAPICallObject('PUT', { ids }));
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
export const bulkUnarchiveTemplates = ({ channel, ids }) => {
|
|
380
|
-
const url = `${API_ENDPOINT}/templates/unarchive/bulk/${channel}`;
|
|
381
|
-
return request(url, getAPICallObject('PUT', { ids }));
|
|
382
|
-
};
|
|
383
|
-
|
|
384
364
|
export const deleteRcsTemplate = ({ templateName }) => {
|
|
385
365
|
const url = `${API_ENDPOINT}/templates/${templateName}/RCS`;
|
|
386
366
|
return request(url, getAPICallObject('DELETE'))
|
|
@@ -1086,62 +1086,3 @@ describe('createTestCustomer', () => {
|
|
|
1086
1086
|
expect(lastCall[1].body).toBe(JSON.stringify(payload));
|
|
1087
1087
|
});
|
|
1088
1088
|
});
|
|
1089
|
-
|
|
1090
|
-
import {
|
|
1091
|
-
archiveTemplate,
|
|
1092
|
-
unarchiveTemplate,
|
|
1093
|
-
bulkArchiveTemplates,
|
|
1094
|
-
bulkUnarchiveTemplates,
|
|
1095
|
-
} from '../api';
|
|
1096
|
-
|
|
1097
|
-
describe('archiveTemplate', () => {
|
|
1098
|
-
beforeEach(() => {
|
|
1099
|
-
global.fetch = jest.fn().mockReturnValue(Promise.resolve({ json: () => Promise.resolve({}) }));
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
it('should call PUT on archive endpoint', () => {
|
|
1103
|
-
archiveTemplate({ channel: 'EMAIL', id: 'id123' });
|
|
1104
|
-
expect(global.fetch).toHaveBeenCalled();
|
|
1105
|
-
const lastCall = global.fetch.mock.calls[global.fetch.mock.calls.length - 1];
|
|
1106
|
-
expect(lastCall[1].method).toBe('PUT');
|
|
1107
|
-
});
|
|
1108
|
-
});
|
|
1109
|
-
|
|
1110
|
-
describe('unarchiveTemplate', () => {
|
|
1111
|
-
beforeEach(() => {
|
|
1112
|
-
global.fetch = jest.fn().mockReturnValue(Promise.resolve({ json: () => Promise.resolve({}) }));
|
|
1113
|
-
});
|
|
1114
|
-
|
|
1115
|
-
it('should call PUT on unarchive endpoint', () => {
|
|
1116
|
-
unarchiveTemplate({ channel: 'EMAIL', id: 'id123' });
|
|
1117
|
-
expect(global.fetch).toHaveBeenCalled();
|
|
1118
|
-
const lastCall = global.fetch.mock.calls[global.fetch.mock.calls.length - 1];
|
|
1119
|
-
expect(lastCall[1].method).toBe('PUT');
|
|
1120
|
-
});
|
|
1121
|
-
});
|
|
1122
|
-
|
|
1123
|
-
describe('bulkArchiveTemplates', () => {
|
|
1124
|
-
beforeEach(() => {
|
|
1125
|
-
global.fetch = jest.fn().mockReturnValue(Promise.resolve({ json: () => Promise.resolve({}) }));
|
|
1126
|
-
});
|
|
1127
|
-
|
|
1128
|
-
it('should call PUT on bulk archive endpoint with ids', () => {
|
|
1129
|
-
bulkArchiveTemplates({ channel: 'EMAIL', ids: ['id1', 'id2'] });
|
|
1130
|
-
expect(global.fetch).toHaveBeenCalled();
|
|
1131
|
-
const lastCall = global.fetch.mock.calls[global.fetch.mock.calls.length - 1];
|
|
1132
|
-
expect(lastCall[1].method).toBe('PUT');
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
|
|
1136
|
-
describe('bulkUnarchiveTemplates', () => {
|
|
1137
|
-
beforeEach(() => {
|
|
1138
|
-
global.fetch = jest.fn().mockReturnValue(Promise.resolve({ json: () => Promise.resolve({}) }));
|
|
1139
|
-
});
|
|
1140
|
-
|
|
1141
|
-
it('should call PUT on bulk unarchive endpoint with ids', () => {
|
|
1142
|
-
bulkUnarchiveTemplates({ channel: 'EMAIL', ids: ['id1', 'id2'] });
|
|
1143
|
-
expect(global.fetch).toHaveBeenCalled();
|
|
1144
|
-
const lastCall = global.fetch.mock.calls[global.fetch.mock.calls.length - 1];
|
|
1145
|
-
expect(lastCall[1].method).toBe('PUT');
|
|
1146
|
-
});
|
|
1147
|
-
});
|
|
@@ -20,7 +20,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
20
20
|
>
|
|
21
21
|
<CapColumn
|
|
22
22
|
key="0"
|
|
23
|
-
lg={
|
|
23
|
+
lg={6}
|
|
24
24
|
md={8}
|
|
25
25
|
sm={12}
|
|
26
26
|
xs={24}
|
|
@@ -40,7 +40,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
40
40
|
</CapColumn>
|
|
41
41
|
<CapColumn
|
|
42
42
|
key="1"
|
|
43
|
-
lg={
|
|
43
|
+
lg={6}
|
|
44
44
|
md={8}
|
|
45
45
|
sm={12}
|
|
46
46
|
xs={24}
|
|
@@ -60,7 +60,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
60
60
|
</CapColumn>
|
|
61
61
|
<CapColumn
|
|
62
62
|
key="2"
|
|
63
|
-
lg={
|
|
63
|
+
lg={6}
|
|
64
64
|
md={8}
|
|
65
65
|
sm={12}
|
|
66
66
|
xs={24}
|
|
@@ -80,7 +80,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
80
80
|
</CapColumn>
|
|
81
81
|
<CapColumn
|
|
82
82
|
key="3"
|
|
83
|
-
lg={
|
|
83
|
+
lg={6}
|
|
84
84
|
md={8}
|
|
85
85
|
sm={12}
|
|
86
86
|
xs={24}
|
|
@@ -100,7 +100,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
100
100
|
</CapColumn>
|
|
101
101
|
<CapColumn
|
|
102
102
|
key="4"
|
|
103
|
-
lg={
|
|
103
|
+
lg={6}
|
|
104
104
|
md={8}
|
|
105
105
|
sm={12}
|
|
106
106
|
xs={24}
|
|
@@ -120,7 +120,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
120
120
|
</CapColumn>
|
|
121
121
|
<CapColumn
|
|
122
122
|
key="5"
|
|
123
|
-
lg={
|
|
123
|
+
lg={6}
|
|
124
124
|
md={8}
|
|
125
125
|
sm={12}
|
|
126
126
|
xs={24}
|
|
@@ -140,7 +140,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
140
140
|
</CapColumn>
|
|
141
141
|
<CapColumn
|
|
142
142
|
key="6"
|
|
143
|
-
lg={
|
|
143
|
+
lg={6}
|
|
144
144
|
md={8}
|
|
145
145
|
sm={12}
|
|
146
146
|
xs={24}
|
|
@@ -160,7 +160,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
160
160
|
</CapColumn>
|
|
161
161
|
<CapColumn
|
|
162
162
|
key="7"
|
|
163
|
-
lg={
|
|
163
|
+
lg={6}
|
|
164
164
|
md={8}
|
|
165
165
|
sm={12}
|
|
166
166
|
xs={24}
|
|
@@ -180,7 +180,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
180
180
|
</CapColumn>
|
|
181
181
|
<CapColumn
|
|
182
182
|
key="8"
|
|
183
|
-
lg={
|
|
183
|
+
lg={6}
|
|
184
184
|
md={8}
|
|
185
185
|
sm={12}
|
|
186
186
|
xs={24}
|
|
@@ -200,7 +200,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
200
200
|
</CapColumn>
|
|
201
201
|
<CapColumn
|
|
202
202
|
key="9"
|
|
203
|
-
lg={
|
|
203
|
+
lg={6}
|
|
204
204
|
md={8}
|
|
205
205
|
sm={12}
|
|
206
206
|
xs={24}
|
|
@@ -220,7 +220,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
220
220
|
</CapColumn>
|
|
221
221
|
<CapColumn
|
|
222
222
|
key="10"
|
|
223
|
-
lg={
|
|
223
|
+
lg={6}
|
|
224
224
|
md={8}
|
|
225
225
|
sm={12}
|
|
226
226
|
xs={24}
|
|
@@ -240,7 +240,7 @@ exports[`CapCustomSkeleton test renders correct CapCustomSkeleton component 1`]
|
|
|
240
240
|
</CapColumn>
|
|
241
241
|
<CapColumn
|
|
242
242
|
key="11"
|
|
243
|
-
lg={
|
|
243
|
+
lg={6}
|
|
244
244
|
md={8}
|
|
245
245
|
sm={12}
|
|
246
246
|
xs={24}
|
|
@@ -24,7 +24,6 @@ function SlideBoxFooter(props) {
|
|
|
24
24
|
slidBoxContent,
|
|
25
25
|
onSave,
|
|
26
26
|
onEditTemplate,
|
|
27
|
-
isTemplateArchived,
|
|
28
27
|
onCreateNextStep,
|
|
29
28
|
isFullMode,
|
|
30
29
|
fetchingCmsData,
|
|
@@ -215,7 +214,7 @@ function SlideBoxFooter(props) {
|
|
|
215
214
|
<FormattedMessage {...(continueButtonLabel || messages.continue)} />
|
|
216
215
|
</CapButton>
|
|
217
216
|
)}
|
|
218
|
-
{slidBoxContent === PREVIEW &&
|
|
217
|
+
{slidBoxContent === PREVIEW && (
|
|
219
218
|
<CapButton onClick={onEditTemplate} type="secondary">
|
|
220
219
|
<FormattedMessage {...messages.creativesTemplatesEdit} />
|
|
221
220
|
</CapButton>
|
|
@@ -228,7 +227,6 @@ SlideBoxFooter.propTypes = {
|
|
|
228
227
|
slidBoxContent: PropTypes.node,
|
|
229
228
|
onSave: PropTypes.func,
|
|
230
229
|
onEditTemplate: PropTypes.func,
|
|
231
|
-
isTemplateArchived: PropTypes.bool,
|
|
232
230
|
onCreateNextStep: PropTypes.func,
|
|
233
231
|
shouldShowContinueFooter: PropTypes.func,
|
|
234
232
|
shouldShowDoneFooter: PropTypes.func,
|
|
@@ -260,10 +260,6 @@ export class Creatives extends React.Component {
|
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
onEditTemplate = () => {
|
|
263
|
-
if (this.props.templateData && this.props.templateData.isArchived) {
|
|
264
|
-
CapNotification.error({ message: this.props.intl.formatMessage(messages.cannotEditArchivedTemplate) });
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
263
|
this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true, templateNameExists: true });
|
|
268
264
|
};
|
|
269
265
|
|
|
@@ -2140,7 +2136,6 @@ export class Creatives extends React.Component {
|
|
|
2140
2136
|
onSave={this.saveMessage}
|
|
2141
2137
|
onDiscard={this.discardMessage}
|
|
2142
2138
|
onEditTemplate={this.onEditTemplate}
|
|
2143
|
-
isTemplateArchived={!!(this.props.templateData && this.props.templateData.isArchived)}
|
|
2144
2139
|
slidBoxContent={slidBoxContent}
|
|
2145
2140
|
onCreateNextStep={this.onCreateNextStep}
|
|
2146
2141
|
currentChannel={currentChannel.toUpperCase()}
|
|
@@ -390,8 +390,4 @@ export default defineMessages({
|
|
|
390
390
|
id: `${scope}.personalizationTokensErrorMessage`,
|
|
391
391
|
defaultMessage: `Personalization tags are not supported for anonymous customers, please remove the tags.`,
|
|
392
392
|
},
|
|
393
|
-
"cannotEditArchivedTemplate": {
|
|
394
|
-
id: `${scope}.cannotEditArchivedTemplate`,
|
|
395
|
-
defaultMessage: 'Cannot edit an archived template. Please unarchive it first.',
|
|
396
|
-
},
|
|
397
393
|
});
|
|
@@ -295,7 +295,6 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
295
295
|
isEmptyContent={false}
|
|
296
296
|
isFullMode={false}
|
|
297
297
|
isLiquidValidationError={false}
|
|
298
|
-
isTemplateArchived={false}
|
|
299
298
|
isTemplateNameEmpty={false}
|
|
300
299
|
onCreateNextStep={[Function]}
|
|
301
300
|
onDiscard={[Function]}
|
|
@@ -435,7 +434,6 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
435
434
|
isEmptyContent={false}
|
|
436
435
|
isFullMode={false}
|
|
437
436
|
isLiquidValidationError={false}
|
|
438
|
-
isTemplateArchived={false}
|
|
439
437
|
isTemplateNameEmpty={false}
|
|
440
438
|
onCreateNextStep={[Function]}
|
|
441
439
|
onDiscard={[Function]}
|
|
@@ -575,7 +573,6 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
575
573
|
isEmptyContent={false}
|
|
576
574
|
isFullMode={false}
|
|
577
575
|
isLiquidValidationError={false}
|
|
578
|
-
isTemplateArchived={false}
|
|
579
576
|
isTemplateNameEmpty={false}
|
|
580
577
|
onCreateNextStep={[Function]}
|
|
581
578
|
onDiscard={[Function]}
|
|
@@ -12,6 +12,8 @@ const initialState = fromJS({
|
|
|
12
12
|
createTemplateInProgress: false,
|
|
13
13
|
createResponse: {},
|
|
14
14
|
isBeeEnabled: null,
|
|
15
|
+
fetchingCmsAccounts: false,
|
|
16
|
+
cmsAccountsLoaded: false,
|
|
15
17
|
});
|
|
16
18
|
|
|
17
19
|
function emailReducer(state = initialState, action) {
|
|
@@ -110,13 +112,19 @@ function emailReducer(state = initialState, action) {
|
|
|
110
112
|
.set('fetchingCmsDataFailed', true);
|
|
111
113
|
case types.GET_CMS_ACCOUNTS_REQUEST:
|
|
112
114
|
return state
|
|
113
|
-
.set('isBeeEnabled', false)
|
|
115
|
+
.set('isBeeEnabled', false)
|
|
116
|
+
.set('fetchingCmsAccounts', true)
|
|
117
|
+
.set('cmsAccountsLoaded', false);
|
|
114
118
|
case types.GET_CMS_ACCOUNTS_SUCCESS:
|
|
115
119
|
return state
|
|
116
|
-
.set('isBeeEnabled', action.isBeeEnabled)
|
|
120
|
+
.set('isBeeEnabled', action.isBeeEnabled)
|
|
121
|
+
.set('fetchingCmsAccounts', false)
|
|
122
|
+
.set('cmsAccountsLoaded', true);
|
|
117
123
|
case types.GET_CMS_ACCOUNTS_FAILURE:
|
|
118
124
|
return state
|
|
119
|
-
.set('isBeeEnabled', false)
|
|
125
|
+
.set('isBeeEnabled', false)
|
|
126
|
+
.set('fetchingCmsAccounts', false)
|
|
127
|
+
.set('cmsAccountsLoaded', true);
|
|
120
128
|
case types.CLEAR_EMAIL_CRUD_RESPONSE_REQUEST:
|
|
121
129
|
return state
|
|
122
130
|
.set('createResponse', fromJS({}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
call, put, takeLatest, takeEvery, all,
|
|
2
|
+
call, put, takeLatest, takeEvery, all, select, take,
|
|
3
3
|
} from 'redux-saga/effects';
|
|
4
4
|
import CapNotification from '@capillarytech/cap-ui-library/CapNotification';
|
|
5
5
|
import * as Api from '../../services/api';
|
|
@@ -103,13 +103,17 @@ export function* getAllAssets(assetType, queryParams) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
export function* getCmsSetting({
|
|
106
|
-
cmsType, projectId, cmsMode, langId, isEdmSupport,
|
|
106
|
+
cmsType, projectId, cmsMode, langId, isEdmSupport,
|
|
107
107
|
}) {
|
|
108
108
|
try {
|
|
109
|
+
const emailState = yield select((state) => state.get('email'));
|
|
110
|
+
if (!emailState.get('cmsAccountsLoaded')) {
|
|
111
|
+
yield take([types.GET_CMS_ACCOUNTS_SUCCESS, types.GET_CMS_ACCOUNTS_FAILURE]);
|
|
112
|
+
}
|
|
113
|
+
const updatedState = yield select((state) => state.get('email'));
|
|
114
|
+
const isBEEAppEnable = updatedState.get('isBeeEnabled');
|
|
115
|
+
|
|
109
116
|
const result = yield call(Api.getCmsTemplateSettingsV2, cmsType, projectId, cmsMode, langId, isEdmSupport, isBEEAppEnable);
|
|
110
|
-
const cmsAccountDetail = result.data?.response.cmsDetails || {};
|
|
111
|
-
const isBeeEnabled = cmsAccountDetail?.type === cmsType;
|
|
112
|
-
yield put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled });
|
|
113
117
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
|
|
114
118
|
} catch (error) {
|
|
115
119
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_FAILURE, error });
|
|
@@ -5,6 +5,8 @@ Immutable.Map {
|
|
|
5
5
|
"createTemplateInProgress": false,
|
|
6
6
|
"createResponse": Immutable.Map {},
|
|
7
7
|
"isBeeEnabled": null,
|
|
8
|
+
"fetchingCmsAccounts": false,
|
|
9
|
+
"cmsAccountsLoaded": false,
|
|
8
10
|
}
|
|
9
11
|
`;
|
|
10
12
|
|
|
@@ -13,5 +15,7 @@ Immutable.Map {
|
|
|
13
15
|
"createTemplateInProgress": true,
|
|
14
16
|
"createResponse": Immutable.Map {},
|
|
15
17
|
"isBeeEnabled": null,
|
|
18
|
+
"fetchingCmsAccounts": false,
|
|
19
|
+
"cmsAccountsLoaded": false,
|
|
16
20
|
}
|
|
17
21
|
`;
|
|
@@ -3,6 +3,7 @@ import { expectSaga } from 'redux-saga-test-plan';
|
|
|
3
3
|
import { takeLatest } from 'redux-saga/effects';
|
|
4
4
|
import * as matchers from 'redux-saga-test-plan/matchers';
|
|
5
5
|
import { throwError } from 'redux-saga-test-plan/providers';
|
|
6
|
+
import { fromJS } from 'immutable';
|
|
6
7
|
import * as types from '../constants';
|
|
7
8
|
import * as sagas from '../sagas';
|
|
8
9
|
import { v2EmailDuplicateTemplateSaga, v2EmailSagas } from '../sagas';
|
|
@@ -709,9 +710,13 @@ describe('getCmsSetting saga', () => {
|
|
|
709
710
|
|
|
710
711
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
711
712
|
.provide([
|
|
713
|
+
{
|
|
714
|
+
select(effect, next) {
|
|
715
|
+
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: true });
|
|
716
|
+
},
|
|
717
|
+
},
|
|
712
718
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
713
719
|
])
|
|
714
|
-
.put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: true })
|
|
715
720
|
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: fakeResponse.data.response.cmsDetails })
|
|
716
721
|
.run();
|
|
717
722
|
});
|
|
@@ -727,9 +732,13 @@ describe('getCmsSetting saga', () => {
|
|
|
727
732
|
|
|
728
733
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
729
734
|
.provide([
|
|
735
|
+
{
|
|
736
|
+
select(effect, next) {
|
|
737
|
+
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: false });
|
|
738
|
+
},
|
|
739
|
+
},
|
|
730
740
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
731
741
|
])
|
|
732
|
-
.put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: false })
|
|
733
742
|
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: fakeResponse.data.response.cmsDetails })
|
|
734
743
|
.run();
|
|
735
744
|
});
|
|
@@ -743,9 +752,13 @@ describe('getCmsSetting saga', () => {
|
|
|
743
752
|
|
|
744
753
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
745
754
|
.provide([
|
|
755
|
+
{
|
|
756
|
+
select(effect, next) {
|
|
757
|
+
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: false });
|
|
758
|
+
},
|
|
759
|
+
},
|
|
746
760
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
747
761
|
])
|
|
748
|
-
.put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: false })
|
|
749
762
|
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: undefined })
|
|
750
763
|
.run();
|
|
751
764
|
});
|
|
@@ -755,6 +768,11 @@ describe('getCmsSetting saga', () => {
|
|
|
755
768
|
|
|
756
769
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
757
770
|
.provide([
|
|
771
|
+
{
|
|
772
|
+
select(effect, next) {
|
|
773
|
+
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: true });
|
|
774
|
+
},
|
|
775
|
+
},
|
|
758
776
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), throwError(fakeError)],
|
|
759
777
|
])
|
|
760
778
|
.put({ type: types.GET_CMS_EDITOR_DETAILS_FAILURE, error: fakeError })
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import zaloillustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
|
|
4
|
-
import inAppIllustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
|
|
5
|
-
import { FormattedMessage } from 'react-intl';
|
|
6
|
-
import { CapIllustration } from "@capillarytech/cap-ui-library";
|
|
7
3
|
import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
8
4
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
9
5
|
import pushIllustration from '../Assets/images/pushIllustration.svg';
|
|
@@ -12,12 +8,13 @@ import lineIllustration from '../Assets/images/lineIllustration.svg';
|
|
|
12
8
|
import facebookIllustration from '../Assets/images/facebookIllustration.svg';
|
|
13
9
|
import whatsappIllustration from '../Assets/images/whatsappIllustration.png';
|
|
14
10
|
import whatsappOrZaloAccountIllustration from '../Assets/images/whatsappOrZaloAccountIllustration.svg';
|
|
15
|
-
import archiveEmptyStateIllustration from '../Assets/images/archive_Empty_Illustration.svg';
|
|
16
11
|
import rcsIllustration from '../Assets/images/rcsIllustration.png';
|
|
12
|
+
import zaloillustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
|
|
13
|
+
import inAppIllustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
|
|
17
14
|
import messages from './messages';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
} from '../CreativesContainer/constants';
|
|
15
|
+
import { FormattedMessage } from 'react-intl';
|
|
16
|
+
import { CapIllustration } from "@capillarytech/cap-ui-library";
|
|
17
|
+
import { MOBILE_PUSH, SMS, EMAIL, LINE, VIBER, FACEBOOK, WHATSAPP, RCS, ZALO, INAPP, WEBPUSH } from '../CreativesContainer/constants';
|
|
21
18
|
|
|
22
19
|
|
|
23
20
|
// Configuration object for channel types
|
|
@@ -83,8 +80,7 @@ function ChannelTypeIllustration(props) {
|
|
|
83
80
|
isFullMode,
|
|
84
81
|
createTemplate,
|
|
85
82
|
currentChannel,
|
|
86
|
-
hostName
|
|
87
|
-
isArchivedMode,
|
|
83
|
+
hostName
|
|
88
84
|
} = props;
|
|
89
85
|
|
|
90
86
|
const templateText = useMemo(() => {
|
|
@@ -92,18 +88,6 @@ function ChannelTypeIllustration(props) {
|
|
|
92
88
|
return isFullMode ? templateIntlMsg : '';
|
|
93
89
|
}, [isFullMode]);
|
|
94
90
|
|
|
95
|
-
if (isArchivedMode) {
|
|
96
|
-
return (
|
|
97
|
-
<CapIllustration
|
|
98
|
-
illustrationImage={archiveEmptyStateIllustration}
|
|
99
|
-
title={<FormattedMessage {...messages.noArchivedCreatives} />}
|
|
100
|
-
description={<FormattedMessage {...messages.noArchivedCreativesDesc} />}
|
|
101
|
-
descriptionPosition="bottom"
|
|
102
|
-
descriptionClassName="illustration-desc archive-illustration"
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
91
|
const getChannelTypeIllustrationInfo = (type, hostName) => {
|
|
108
92
|
// Handle special cases with hostName dependency
|
|
109
93
|
if (type === WHATSAPP) {
|
|
@@ -212,6 +196,5 @@ ChannelTypeIllustration.propTypes = {
|
|
|
212
196
|
createTemplate: PropTypes.func.isRequired,
|
|
213
197
|
currentChannel: PropTypes.string,
|
|
214
198
|
hostName: PropTypes.string,
|
|
215
|
-
isArchivedMode: PropTypes.bool,
|
|
216
199
|
};
|
|
217
200
|
export default ChannelTypeIllustration;
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
2
|
|
|
3
3
|
.ant-tabs-content{
|
|
4
|
-
margin-top:
|
|
4
|
+
margin-top: 16px;
|
|
5
5
|
.ant-tabs-tabpane-active{
|
|
6
6
|
padding: unset;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
.creatives-templates-list
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
@media screen and (max-width: 1172px) {
|
|
11
|
+
.creatives-templates-list.full-mode{
|
|
12
|
+
.v2-pagination-container {
|
|
13
|
+
.cap-custom-card-list-row {
|
|
14
|
+
.cap-custom-card-list-col{
|
|
15
|
+
&:nth-child(3n+3) { //every 4th child
|
|
16
|
+
margin-right: unset;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media screen and (min-width: 1172px) {
|
|
25
|
+
.creatives-templates-list.full-mode{
|
|
26
|
+
.v2-pagination-container {
|
|
27
|
+
.cap-custom-card-list-row {
|
|
28
|
+
.cap-custom-card-list-col{
|
|
29
|
+
&:nth-child(4n+4) { //every 4th child
|
|
30
|
+
margin-right: unset;
|
|
31
|
+
}
|
|
20
32
|
}
|
|
21
33
|
}
|
|
22
34
|
}
|
|
@@ -662,32 +674,6 @@
|
|
|
662
674
|
font-size: 14px;
|
|
663
675
|
}
|
|
664
676
|
|
|
665
|
-
// Archive/Unarchive confirm modal overrides — scoped to avoid affecting other modals
|
|
666
|
-
.archive-confirm-modal {
|
|
667
|
-
// Remove the left margin added when an icon is present
|
|
668
|
-
.ant-modal-confirm-body {
|
|
669
|
-
> .anticon + .ant-modal-confirm-title + .ant-modal-confirm-content {
|
|
670
|
-
margin-left: 0;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// Left-align buttons, remove float
|
|
675
|
-
.ant-modal-confirm-btns {
|
|
676
|
-
float: none;
|
|
677
|
-
display: flex;
|
|
678
|
-
align-items: center;
|
|
679
|
-
gap: $CAP_SPACE_08;
|
|
680
|
-
margin-top: $CAP_SPACE_16;
|
|
681
|
-
|
|
682
|
-
// Cancel button styling
|
|
683
|
-
.ant-btn:not(.ant-btn-primary) {
|
|
684
|
-
background-color: $CAP_G08;
|
|
685
|
-
border-color: $CAP_G08;
|
|
686
|
-
color: $CAP_G01;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
677
|
.popover-action-container {
|
|
692
678
|
line-height: 24px;
|
|
693
679
|
}
|
|
@@ -1115,96 +1101,4 @@
|
|
|
1115
1101
|
.inapp-illustration-parent {
|
|
1116
1102
|
height: "calc(100vh - 325px)";
|
|
1117
1103
|
overflow: 'auto';
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
// Archive feature layout classes
|
|
1121
|
-
.illustration-scroll-wrapper {
|
|
1122
|
-
height: calc(100vh - 20.3125rem);
|
|
1123
|
-
overflow: auto;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
.filter-row {
|
|
1127
|
-
display: flex;
|
|
1128
|
-
align-items: center;
|
|
1129
|
-
justify-content: space-between;
|
|
1130
|
-
width: 100%;
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
.filter-row-content {
|
|
1134
|
-
flex: 1;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
.bulk-selection-bar {
|
|
1138
|
-
display: flex;
|
|
1139
|
-
align-items: center;
|
|
1140
|
-
gap: $CAP_SPACE_12;
|
|
1141
|
-
flex-shrink: 0;
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
.archived-mode-header {
|
|
1145
|
-
display: flex;
|
|
1146
|
-
align-items: center;
|
|
1147
|
-
gap: $CAP_SPACE_12;
|
|
1148
|
-
margin-bottom: $CAP_SPACE_16;
|
|
1149
|
-
|
|
1150
|
-
.archived-mode-back-icon {
|
|
1151
|
-
cursor: pointer;
|
|
1152
|
-
font-size: 1.428rem;
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
.archived-tag {
|
|
1157
|
-
margin-left: $CAP_SPACE_08;
|
|
1158
|
-
font-size: 0.786rem;
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
.popover-archive-action {
|
|
1162
|
-
cursor: pointer;
|
|
1163
|
-
padding: $CAP_SPACE_08 0;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
.archive-menu-item {
|
|
1167
|
-
display: inline-flex;
|
|
1168
|
-
align-items: center;
|
|
1169
|
-
gap: $CAP_SPACE_08;
|
|
1170
|
-
margin-top: 1rem;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
.archive-btn-label {
|
|
1174
|
-
margin-right: 0.714rem;
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
.bulk-selection-bar .cap-button-v2-prefix {
|
|
1178
|
-
margin-top: 1rem;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
.bulk-selection-bar .ant-btn.cap-button-v2 > .cap-button-v2-prefix + span {
|
|
1182
|
-
margin-left: -$CAP_SPACE_06;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
.template-card-top-bar {
|
|
1186
|
-
display: flex;
|
|
1187
|
-
align-items: center;
|
|
1188
|
-
justify-content: space-between;
|
|
1189
|
-
padding: $CAP_SPACE_08 $CAP_SPACE_12 0;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
.template-listing-header-actions {
|
|
1193
|
-
display: flex;
|
|
1194
|
-
justify-content: space-between;
|
|
1195
|
-
align-items: center;
|
|
1196
|
-
gap: $CAP_SPACE_08;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
.template-listing-more-btn {
|
|
1200
|
-
padding: 0 $CAP_SPACE_08;
|
|
1201
|
-
min-width: auto;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
.notification-template-label {
|
|
1205
|
-
color: #5E6C84;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
.notification-template-name {
|
|
1209
|
-
color: #091E42;
|
|
1210
|
-
}
|
|
1104
|
+
}
|