@capillarytech/creatives-library 7.17.37-alpha.0 → 7.17.37-alpha.2
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/CapTagList/index.js +2 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -6
- package/v2Containers/CreativesContainer/index.js +23 -5
- package/v2Containers/TagList/index.js +2 -0
- package/v2Containers/Zalo/index.js +30 -24
- package/v2Containers/Zalo/index.scss +3 -4
package/package.json
CHANGED
|
@@ -321,7 +321,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
321
321
|
trigger="click"
|
|
322
322
|
placement={translationLang === "ja-JP" && channel === 'EMAIL' ? "bottom" : "rightTop"}
|
|
323
323
|
>
|
|
324
|
-
<CapButton isAddBtn type="flat">{label || ''}</CapButton>
|
|
324
|
+
<CapButton disabled={this?.props?.disabled} isAddBtn type="flat">{label || ''}</CapButton>
|
|
325
325
|
</CapPopover>
|
|
326
326
|
}
|
|
327
327
|
<CapModal
|
|
@@ -358,6 +358,7 @@ CapTagList.propTypes = {
|
|
|
358
358
|
disableTagsDetails: PropTypes.object,
|
|
359
359
|
currentOrgDetails: PropTypes.object,
|
|
360
360
|
channel: PropTypes.string,
|
|
361
|
+
disabled: PropTypes.bool
|
|
361
362
|
};
|
|
362
363
|
|
|
363
364
|
CapTagList.defaultValue = {
|
|
@@ -213,7 +213,7 @@ export function SlideBoxContent(props) {
|
|
|
213
213
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
214
214
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
215
215
|
isEditFTP = isEdit && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
|
|
216
|
-
isEditZalo = isEdit && channel === constants.ZALO
|
|
216
|
+
isEditZalo = isEdit && channel === constants.ZALO;
|
|
217
217
|
}
|
|
218
218
|
const isDltEnabled = commonUtil.isTraiDLTEnable(isFullMode, smsRegister);
|
|
219
219
|
const hasJPLocaleHideFeatureEnabled = commonUtil?.hasJPLocaleHideFeatureEnabled();
|
|
@@ -510,11 +510,12 @@ export function SlideBoxContent(props) {
|
|
|
510
510
|
{
|
|
511
511
|
isEditZalo &&
|
|
512
512
|
<Zalo
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
513
|
+
templateData={templateData}
|
|
514
|
+
location={creativesLocationProps}
|
|
515
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
516
|
+
getDefaultTags={type}
|
|
517
|
+
channel={channel}
|
|
518
|
+
isFullMode={isFullMode}
|
|
518
519
|
/>
|
|
519
520
|
}
|
|
520
521
|
{
|
|
@@ -23,6 +23,7 @@ import { gtmPush } from '../../utils/gtmTrackers';
|
|
|
23
23
|
import './index.scss';
|
|
24
24
|
import * as templateActions from '../Templates/actions';
|
|
25
25
|
import * as globalActions from '../Cap/actions';
|
|
26
|
+
import * as zaloActions from '../Zalo/actions';
|
|
26
27
|
import {isLoading as isLoadingSelector} from './selectors';
|
|
27
28
|
import messages from './messages';
|
|
28
29
|
import { MAP_TEMPLATE } from '../WeChat/Wrapper/constants';
|
|
@@ -98,11 +99,26 @@ export class Creatives extends React.Component {
|
|
|
98
99
|
this.setState(data);
|
|
99
100
|
};
|
|
100
101
|
onPreviewTemplate = (template) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
if (template.type !== constants.ZALO.toLowerCase()) {
|
|
103
|
+
const templateData = template;
|
|
104
|
+
const usersList = commonUtil.getMergedUserList(this.props.templateUserList);
|
|
105
|
+
const userId = parseInt(template.updatedBy, 10);
|
|
106
|
+
templateData.updatedByName = commonUtil.getUserNameById(userId, usersList );
|
|
107
|
+
this.setState({ slidBoxContent: 'preview', templateData });
|
|
108
|
+
} else {
|
|
109
|
+
const {
|
|
110
|
+
name = "",
|
|
111
|
+
sourceAccountIdentifier = "",
|
|
112
|
+
configs: { token = "" } = {},
|
|
113
|
+
} = get(this.props, "Templates.weCrmAccounts[0]", {});
|
|
114
|
+
this.props.zaloActions.getTemplateInfoById({
|
|
115
|
+
username: name,
|
|
116
|
+
oa_id: sourceAccountIdentifier,
|
|
117
|
+
token,
|
|
118
|
+
id: template?._id,
|
|
119
|
+
preview: true,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
106
122
|
};
|
|
107
123
|
onEditTemplate = () => {
|
|
108
124
|
this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true, templateNameExists: true });
|
|
@@ -1202,6 +1218,7 @@ Creatives.propTypes = {
|
|
|
1202
1218
|
channel: PropTypes.string,
|
|
1203
1219
|
templateActions: PropTypes.object,
|
|
1204
1220
|
globalActions: PropTypes.object,
|
|
1221
|
+
zaloActions: PropTypes.object,
|
|
1205
1222
|
cap: PropTypes.object,
|
|
1206
1223
|
// isLoading: PropTypes.bool,
|
|
1207
1224
|
templateUserList: PropTypes.array,
|
|
@@ -1230,6 +1247,7 @@ function mapDispatchToProps(dispatch) {
|
|
|
1230
1247
|
templateActions: bindActionCreators(templateActions, dispatch),
|
|
1231
1248
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
1232
1249
|
actions: bindActionCreators(actions, dispatch),
|
|
1250
|
+
zaloActions: bindActionCreators(zaloActions, dispatch),
|
|
1233
1251
|
};
|
|
1234
1252
|
}
|
|
1235
1253
|
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
@@ -260,6 +260,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
260
260
|
modalProps={this.props.modalProps}
|
|
261
261
|
currentOrgDetails={this.props.currentOrgDetails}
|
|
262
262
|
channel={this.props.channel}
|
|
263
|
+
disabled={this.props.disabled}
|
|
263
264
|
/>
|
|
264
265
|
</div>
|
|
265
266
|
);
|
|
@@ -286,6 +287,7 @@ TagList.propTypes = {
|
|
|
286
287
|
modalProps: PropTypes.any,
|
|
287
288
|
currentOrgDetails: PropTypes.object,
|
|
288
289
|
channel: PropTypes.string,
|
|
290
|
+
disabled: PropTypes.bool
|
|
289
291
|
};
|
|
290
292
|
|
|
291
293
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -4,7 +4,7 @@ import { injectIntl } from "react-intl";
|
|
|
4
4
|
import { createStructuredSelector } from "reselect";
|
|
5
5
|
import { bindActionCreators } from "redux";
|
|
6
6
|
import { get } from "lodash";
|
|
7
|
-
import styled from
|
|
7
|
+
import styled from "styled-components";
|
|
8
8
|
import {
|
|
9
9
|
CapSpin,
|
|
10
10
|
CapRow,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
CAP_SPACE_24,
|
|
22
22
|
CAP_SPACE_32,
|
|
23
23
|
CAP_WHITE,
|
|
24
|
-
} from
|
|
24
|
+
} from "@capillarytech/cap-ui-library/styled/variables";
|
|
25
25
|
import messages from "./messages";
|
|
26
26
|
import withCreatives from "../../hoc/withCreatives";
|
|
27
27
|
import {
|
|
@@ -48,7 +48,6 @@ import { makeSelectMetaEntities, setInjectedTags } from "../Cap/selectors";
|
|
|
48
48
|
import * as globalActions from "../Cap/actions";
|
|
49
49
|
import { validateTags } from "../../utils/tagValidations";
|
|
50
50
|
|
|
51
|
-
|
|
52
51
|
export const Zalo = ({
|
|
53
52
|
intl,
|
|
54
53
|
actions,
|
|
@@ -61,13 +60,16 @@ export const Zalo = ({
|
|
|
61
60
|
injectedTags,
|
|
62
61
|
selectedOfferDetails,
|
|
63
62
|
template,
|
|
63
|
+
isFullMode,
|
|
64
64
|
}) => {
|
|
65
65
|
const { formatMessage } = intl;
|
|
66
66
|
const [zaloTemplateListParams, setZaloTemplateListParams] = useState([]);
|
|
67
67
|
const [templatePreviewUrl, setTemplatePreviewUrl] = useState("");
|
|
68
68
|
const [tags, updateTags] = useState([]);
|
|
69
69
|
const [textAreaId, updateTextAreaId] = useState("");
|
|
70
|
-
const [templateStatus, setZaloTemplateStatus] = useState(
|
|
70
|
+
const [templateStatus, setZaloTemplateStatus] = useState(
|
|
71
|
+
ZALO_STATUSES.ENABLE
|
|
72
|
+
);
|
|
71
73
|
|
|
72
74
|
const ZaloFooter = styled.div`
|
|
73
75
|
background-color: ${CAP_WHITE};
|
|
@@ -256,6 +258,7 @@ export const Zalo = ({
|
|
|
256
258
|
value={value || ""}
|
|
257
259
|
size="default"
|
|
258
260
|
onFocus={() => setTextAreaId(name)}
|
|
261
|
+
disabled={isFullMode}
|
|
259
262
|
/>
|
|
260
263
|
);
|
|
261
264
|
};
|
|
@@ -311,6 +314,7 @@ export const Zalo = ({
|
|
|
311
314
|
onContextChange={handleOnTagsContextChange}
|
|
312
315
|
injectedTags={injectedTags || {}}
|
|
313
316
|
selectedOfferDetails={selectedOfferDetails}
|
|
317
|
+
disabled={isFullMode}
|
|
314
318
|
/>
|
|
315
319
|
}
|
|
316
320
|
/>
|
|
@@ -340,26 +344,28 @@ export const Zalo = ({
|
|
|
340
344
|
</CapRow>
|
|
341
345
|
</CapRow>
|
|
342
346
|
</CapColumn>
|
|
343
|
-
<CapColumn
|
|
344
|
-
<CapRow>
|
|
345
|
-
<
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
<
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
<
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
347
|
+
<CapColumn span={10}>
|
|
348
|
+
<CapRow className="zalo-preview-container">
|
|
349
|
+
<CapRow>
|
|
350
|
+
<CapLabel className="preview-head">
|
|
351
|
+
{formatMessage(messages.previewHead)}
|
|
352
|
+
</CapLabel>
|
|
353
|
+
</CapRow>
|
|
354
|
+
<CapRow>
|
|
355
|
+
<CapLabel className="preview-text">
|
|
356
|
+
{formatMessage(messages.previewText)}
|
|
357
|
+
</CapLabel>
|
|
358
|
+
</CapRow>
|
|
359
|
+
<CapRow>
|
|
360
|
+
<CapLabel
|
|
361
|
+
data-testid="preview-link-button"
|
|
362
|
+
onClick={handlePreview}
|
|
363
|
+
className="preview-link"
|
|
364
|
+
>
|
|
365
|
+
{formatMessage(messages.openPreview)}{" "}
|
|
366
|
+
<CapIcon type="open-in-new-light"></CapIcon>
|
|
367
|
+
</CapLabel>
|
|
368
|
+
</CapRow>
|
|
363
369
|
</CapRow>
|
|
364
370
|
</CapColumn>
|
|
365
371
|
</CapRow>
|
|
@@ -42,11 +42,10 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.zalo-preview-container {
|
|
45
|
-
text-align: center;
|
|
46
45
|
position: fixed;
|
|
47
|
-
|
|
48
|
-
padding-left:
|
|
49
|
-
padding-right:
|
|
46
|
+
text-align: center;
|
|
47
|
+
padding-left: 72px;
|
|
48
|
+
padding-right: 110px;
|
|
50
49
|
|
|
51
50
|
.preview-head {
|
|
52
51
|
font-weight: 500;
|