@capillarytech/creatives-library 6.12.3 → 6.12.6
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 +7 -0
- package/package.json +2 -2
- package/utils/smsCharCountV2.js +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/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/Cap/_cap.scss +6 -0
- package/v2Containers/Cap/constants.js +4 -0
- package/v2Containers/Cap/index.js +210 -6
- package/v2Containers/Cap/messages.js +41 -0
- 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/Email/index.js +2 -1
- package/v2Containers/Line/Container/Video/index.js +17 -2
- package/v2Containers/Line/Container/index.js +44 -28
- package/v2Containers/Line/Container/sagas.js +10 -5
- 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
- package/v2Components/BeeEditor/index.js +0 -263
- package/v2Components/BeeEditor/index.scss +0 -11
- package/v2Components/BeeEditor/messages.js +0 -71
- package/v2Components/BeeEditor/tests/index.test.js +0 -10
- package/v2Containers/Line/Create/_lineCreate.scss +0 -64
- package/v2Containers/Line/Create/actions.js +0 -94
- package/v2Containers/Line/Create/constants.js +0 -43
- package/v2Containers/Line/Create/index.js +0 -1132
- package/v2Containers/Line/Create/initialSchema.js +0 -378
- package/v2Containers/Line/Create/messages.js +0 -229
- package/v2Containers/Line/Create/reducer.js +0 -99
- package/v2Containers/Line/Create/sagas.js +0 -113
- package/v2Containers/Line/Create/selectors.js +0 -30
- package/v2Containers/Line/CreateWrapper/constants.js +0 -2
- package/v2Containers/Line/CreateWrapper/index.js +0 -117
- package/v2Containers/Line/CreateWrapper/messages.js +0 -55
- package/v2Containers/Line/Edit/_lineEdit.scss +0 -23
- package/v2Containers/Line/Edit/actions.js +0 -79
- package/v2Containers/Line/Edit/constants.js +0 -27
- package/v2Containers/Line/Edit/index.js +0 -1051
- package/v2Containers/Line/Edit/messages.js +0 -173
- package/v2Containers/Line/Edit/reducer.js +0 -83
- package/v2Containers/Line/Edit/sagas.js +0 -81
- package/v2Containers/Line/Edit/selectors.js +0 -29
- package/v2Containers/Line/Edit/tests/actions.test.js +0 -18
- package/v2Containers/Line/Edit/tests/index.test.js +0 -10
- package/v2Containers/Line/Edit/tests/reducer.test.js +0 -9
- package/v2Containers/Line/Edit/tests/sagas.test.js +0 -15
- package/v2Containers/Line/Edit/tests/selectors.test.js +0 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// import { take, call, put, select } from 'redux-saga/effects';
|
|
2
|
-
|
|
3
|
-
// Individual exports for testing
|
|
4
|
-
export function* defaultSaga() {
|
|
5
|
-
// See example in v2Containers/HomePage/sagas.js
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// All sagas to be loaded
|
|
9
|
-
export default [
|
|
10
|
-
defaultSaga,
|
|
11
|
-
];
|
|
1
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
2
|
+
|
|
3
|
+
// Individual exports for testing
|
|
4
|
+
export function* defaultSaga() {
|
|
5
|
+
// See example in v2Containers/HomePage/sagas.js
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// All sagas to be loaded
|
|
9
|
+
export default [
|
|
10
|
+
defaultSaga,
|
|
11
|
+
];
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { createSelector } from 'reselect';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Direct selector to the creativesContainer state domain
|
|
5
|
-
*/
|
|
6
|
-
const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Other specific selectors
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Default selector used by CreativesContainer
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const makeSelectCreativesContainer = () => createSelector(
|
|
18
|
-
selectCreativesContainerDomain(),
|
|
19
|
-
(substate) => substate.toJS()
|
|
20
|
-
);
|
|
21
|
-
const isLoading = () => createSelector(
|
|
22
|
-
makeSelectCreativesContainer(),
|
|
23
|
-
(substate) => substate.containerLoader
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export default makeSelectCreativesContainer;
|
|
27
|
-
export {
|
|
28
|
-
selectCreativesContainerDomain,
|
|
29
|
-
isLoading,
|
|
30
|
-
};
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Direct selector to the creativesContainer state domain
|
|
5
|
+
*/
|
|
6
|
+
const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Other specific selectors
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Default selector used by CreativesContainer
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const makeSelectCreativesContainer = () => createSelector(
|
|
18
|
+
selectCreativesContainerDomain(),
|
|
19
|
+
(substate) => substate.toJS()
|
|
20
|
+
);
|
|
21
|
+
const isLoading = () => createSelector(
|
|
22
|
+
makeSelectCreativesContainer(),
|
|
23
|
+
(substate) => substate.containerLoader
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default makeSelectCreativesContainer;
|
|
27
|
+
export {
|
|
28
|
+
selectCreativesContainerDomain,
|
|
29
|
+
isLoading,
|
|
30
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
defaultAction,
|
|
4
|
-
} from '../actions';
|
|
5
|
-
import {
|
|
6
|
-
DEFAULT_ACTION,
|
|
7
|
-
} from '../constants';
|
|
8
|
-
|
|
9
|
-
describe('CreativesContainer 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('CreativesContainer 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 { CreativesContainer } from '../index';
|
|
5
|
-
|
|
6
|
-
describe('<CreativesContainer />', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
// import { CreativesContainer } from '../index';
|
|
5
|
+
|
|
6
|
+
describe('<CreativesContainer />', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(true);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { fromJS } from 'immutable';
|
|
3
|
-
import creativesContainerReducer from '../reducer';
|
|
4
|
-
|
|
5
|
-
describe('creativesContainerReducer', () => {
|
|
6
|
-
it('returns the initial state', () => {
|
|
7
|
-
expect(creativesContainerReducer(undefined, {})).toEqual(fromJS({}));
|
|
8
|
-
});
|
|
9
|
-
});
|
|
1
|
+
|
|
2
|
+
import { fromJS } from 'immutable';
|
|
3
|
+
import creativesContainerReducer from '../reducer';
|
|
4
|
+
|
|
5
|
+
describe('creativesContainerReducer', () => {
|
|
6
|
+
it('returns the initial state', () => {
|
|
7
|
+
expect(creativesContainerReducer(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(true);
|
|
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(true);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// import { fromJS } from 'immutable';
|
|
2
|
-
// import { makeSelectCreativesContainerDomain } from '../selectors';
|
|
3
|
-
|
|
4
|
-
// const selector = makeSelectCreativesContainerDomain();
|
|
5
|
-
|
|
6
|
-
describe('makeSelectCreativesContainerDomain', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectCreativesContainerDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectCreativesContainerDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectCreativesContainerDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(true);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -2666,7 +2666,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2666
2666
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
|
|
2667
2667
|
tags = this.props.supportedTags;
|
|
2668
2668
|
}
|
|
2669
|
-
const
|
|
2669
|
+
const { showImageSelectionBox = false } = this.state;
|
|
2670
|
+
const showTestAndPreview = !showImageSelectionBox && getDefaultTags === 'outbound';
|
|
2670
2671
|
return (
|
|
2671
2672
|
<div className="email-container">
|
|
2672
2673
|
<CapSpin spinning={isLoading}>
|
|
@@ -74,6 +74,7 @@ export const LineVideo = ({
|
|
|
74
74
|
const [videoDuration, updateVideoDuration] = useState('');
|
|
75
75
|
const [videoHeight, updateVideoHeight] = useState();
|
|
76
76
|
const [videoWidth, updateVideoWidth] = useState();
|
|
77
|
+
const [isPlaying, updateIsPlaying] = useState(false);
|
|
77
78
|
|
|
78
79
|
|
|
79
80
|
useEffect(() => {
|
|
@@ -338,6 +339,18 @@ export const LineVideo = ({
|
|
|
338
339
|
updateTemplateDrawerRequirement(true);
|
|
339
340
|
}, [])
|
|
340
341
|
|
|
342
|
+
const playVideo = (e) => {
|
|
343
|
+
if (e.target.paused && !isPlaying) {
|
|
344
|
+
e.target.play();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const pauseVideo = (e) => {
|
|
349
|
+
if (!e.target.paused && isPlaying) {
|
|
350
|
+
e.target.pause();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
341
354
|
const getVideoSection = () => {
|
|
342
355
|
if (!isVideo) {
|
|
343
356
|
return (
|
|
@@ -393,8 +406,10 @@ export const LineVideo = ({
|
|
|
393
406
|
poster={imagePreview}
|
|
394
407
|
className="line-image-src"
|
|
395
408
|
onLoadedMetadata={() => updateMetadataLoaded(true)}
|
|
396
|
-
|
|
397
|
-
|
|
409
|
+
onPlaying={() => updateIsPlaying(true)}
|
|
410
|
+
onPause={() => updateIsPlaying(false)}
|
|
411
|
+
onMouseOver={playVideo}
|
|
412
|
+
onMouseOut={pauseVideo}
|
|
398
413
|
ref={videoEl}
|
|
399
414
|
>
|
|
400
415
|
<source src={videoSrc} type="video/mp4" />
|
|
@@ -322,18 +322,30 @@ export const LineContainer = ({
|
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
const createCallback = () => {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
const createCallback = (errorMessage) => {
|
|
326
|
+
if (!errorMessage) {
|
|
327
|
+
CapNotification.success({
|
|
328
|
+
message: formatMessage(messages.lineCreateNotification),
|
|
329
|
+
});
|
|
330
|
+
actions.clearEditResponse();
|
|
331
|
+
} else {
|
|
332
|
+
CapNotification.error({
|
|
333
|
+
message: errorMessage,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
330
336
|
}
|
|
331
337
|
|
|
332
|
-
const editCallback = () => {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
338
|
+
const editCallback = (errorMessage) => {
|
|
339
|
+
if (!errorMessage) {
|
|
340
|
+
CapNotification.success({
|
|
341
|
+
message: formatMessage(messages.lineEditNotification),
|
|
342
|
+
});
|
|
343
|
+
actions.clearEditResponse();
|
|
344
|
+
} else {
|
|
345
|
+
CapNotification.error({
|
|
346
|
+
message: errorMessage,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
337
349
|
}
|
|
338
350
|
|
|
339
351
|
const formatSubmitPayload = (lineWrapperContents) => {
|
|
@@ -545,15 +557,17 @@ export const LineContainer = ({
|
|
|
545
557
|
const onCreateLine = () => {
|
|
546
558
|
actions.createTemplate(
|
|
547
559
|
formatSubmitPayload(lineWrapperContents),
|
|
548
|
-
() => {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
560
|
+
(resp, errorMessage) => {
|
|
561
|
+
createCallback(errorMessage);
|
|
562
|
+
if (!errorMessage) {
|
|
563
|
+
// stop timer for create line
|
|
564
|
+
stopTimer(TRACK_CREATE_LINE, {
|
|
565
|
+
category: 'Creatives',
|
|
566
|
+
action: TRACK_CREATE_LINE,
|
|
567
|
+
label: getLineType(lineWrapperContents),
|
|
568
|
+
});
|
|
569
|
+
onCreateComplete();
|
|
570
|
+
}
|
|
557
571
|
}
|
|
558
572
|
);
|
|
559
573
|
}
|
|
@@ -586,15 +600,17 @@ export const LineContainer = ({
|
|
|
586
600
|
...formatSubmitPayload(lineWrapperContents),
|
|
587
601
|
_id: params.id,
|
|
588
602
|
},
|
|
589
|
-
() => {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
603
|
+
(resp, errorMessage) => {
|
|
604
|
+
editCallback(errorMessage);
|
|
605
|
+
if (!errorMessage) {
|
|
606
|
+
// stop timer for edit line
|
|
607
|
+
stopTimer(TRACK_EDIT_LINE, {
|
|
608
|
+
category: 'Creatives',
|
|
609
|
+
action: TRACK_EDIT_LINE,
|
|
610
|
+
label: getLineType(lineWrapperContents),
|
|
611
|
+
});
|
|
612
|
+
onCreateComplete();
|
|
613
|
+
}
|
|
598
614
|
});
|
|
599
615
|
}
|
|
600
616
|
|
|
@@ -8,10 +8,10 @@ import * as types from './constants';
|
|
|
8
8
|
export function* createTemplate({ template, callback }) {
|
|
9
9
|
let errorMsg;
|
|
10
10
|
try {
|
|
11
|
-
console.log('inside line saga createTemplate@@@', template);
|
|
12
11
|
const result = yield call(Api.createLineTemplate, { template });
|
|
13
|
-
if (result.
|
|
12
|
+
if (result.status.code >= 400) {
|
|
14
13
|
errorMsg = result.message;
|
|
14
|
+
throw errorMsg;
|
|
15
15
|
}
|
|
16
16
|
yield put({ type: types.CREATE_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
|
|
17
17
|
if (callback) {
|
|
@@ -19,6 +19,9 @@ export function* createTemplate({ template, callback }) {
|
|
|
19
19
|
}
|
|
20
20
|
} catch (error) {
|
|
21
21
|
yield put({ type: types.CREATE_TEMPLATE_FAILURE, error, errorMsg });
|
|
22
|
+
if (callback) {
|
|
23
|
+
callback(null, errorMsg);
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
export function* uploadAsset(file, assetType, fileParams ) {
|
|
@@ -48,11 +51,10 @@ function* watchUploadAsset() {
|
|
|
48
51
|
export function* editTemplate({ template, callback }) {
|
|
49
52
|
let errorMsg;
|
|
50
53
|
try {
|
|
51
|
-
console.log('saga editTemplate line', template);
|
|
52
54
|
const result = yield call(Api.createLineTemplate, {template});
|
|
53
|
-
|
|
54
|
-
if (result.message || result.status.code === 500) {
|
|
55
|
+
if (result.status.code >= 400) {
|
|
55
56
|
errorMsg = result.message;
|
|
57
|
+
throw errorMsg;
|
|
56
58
|
}
|
|
57
59
|
if (callback) {
|
|
58
60
|
callback(result.response);
|
|
@@ -60,6 +62,9 @@ export function* editTemplate({ template, callback }) {
|
|
|
60
62
|
yield put({ type: types.EDIT_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
|
|
61
63
|
} catch (error) {
|
|
62
64
|
yield put({ type: types.EDIT_TEMPLATE_FAILURE, error, errorMsg });
|
|
65
|
+
if (callback) {
|
|
66
|
+
callback(null, errorMsg);
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -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';
|