@capillarytech/creatives-library 7.17.36 → 7.17.37-alpha.0
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/index.js +2 -2
- package/package.json +1 -1
- package/v2Containers/Templates/index.js +10 -3
- package/v2Containers/Templates/messages.js +4 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +28 -129
- package/v2Containers/Zalo/constants.js +0 -1
- package/v2Containers/Zalo/index.js +1 -2
- package/v2Containers/Zalo/messages.js +1 -1
package/index.js
CHANGED
|
@@ -124,8 +124,8 @@ const ViberContainer = {Viber, viberReducer, viberSaga};
|
|
|
124
124
|
const FacebookPreviewContainer = { FacebookPreview, facebookPreviewReducer, facebookPreviewSaga };
|
|
125
125
|
const SmsTraiContainer = {SmsTraiCreate, SmsTraiCreateReducer, SmsTraiCreateSaga};
|
|
126
126
|
const WhatsappContainer = { Whatsapp, whatsappReducer, whatsappSaga };
|
|
127
|
-
const zaloContainer = { Zalo, zaloReducer, zaloSaga };
|
|
128
127
|
const RcsContainer = { Rcs, rcsReducer, rcsSaga };
|
|
128
|
+
const ZaloContainer = { Zalo, zaloReducer, zaloSaga };
|
|
129
129
|
|
|
130
130
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
131
131
|
const FTPContainer = {FTP, FTPReducer, FTPSagas};
|
|
@@ -173,6 +173,6 @@ export { CapContainer,
|
|
|
173
173
|
FacebookPreviewContainer,
|
|
174
174
|
SmsTraiContainer,
|
|
175
175
|
WhatsappContainer,
|
|
176
|
-
zaloContainer,
|
|
177
176
|
RcsContainer,
|
|
177
|
+
ZaloContainer,
|
|
178
178
|
};
|
package/package.json
CHANGED
|
@@ -869,10 +869,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
869
869
|
}
|
|
870
870
|
|
|
871
871
|
filterZaloTemplates = (templates) => {
|
|
872
|
-
|
|
872
|
+
let { selectedZaloStatus } = this.state;
|
|
873
|
+
selectedZaloStatus = !this.props.isFullMode ? ZALO_STATUSES.ENABLE : selectedZaloStatus;
|
|
873
874
|
if (selectedZaloStatus) {
|
|
874
|
-
return templates?.filter((template) => template?.versions?.base?.content?.zalo
|
|
875
|
-
}
|
|
875
|
+
return templates?.filter((template) => template?.versions?.base?.content?.zalo?.status === selectedZaloStatus);
|
|
876
|
+
}
|
|
876
877
|
return templates;
|
|
877
878
|
}
|
|
878
879
|
|
|
@@ -2900,6 +2901,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2900
2901
|
) : null
|
|
2901
2902
|
}
|
|
2902
2903
|
|
|
2904
|
+
{
|
|
2905
|
+
channel.toLowerCase() === ZALO_LOWERCASE && !isFullMode ? (
|
|
2906
|
+
<CapInfoNote message={formatMessage(messages.zaloOnlyApprovedTemplates)} />
|
|
2907
|
+
) : null
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2903
2910
|
<CapRow>
|
|
2904
2911
|
<Pagination onPageChange={templates.length ? this.onPaginationChange : () => {}} paginationSelector="pagination-container">
|
|
2905
2912
|
{this.getTemplateDataForGrid({ isLoading, loadingTip, channel: this.state.channel, templates: this.state.searchingZaloTemplate ? this.state.searchedZaloTemplates : this.props.TemplatesList, filterContent, handlers: { handlePreviewClick: this.handlePreviewClick, handleEditClick: this.handleEditClick}})}
|
|
@@ -502,4 +502,8 @@ export default defineMessages({
|
|
|
502
502
|
id: `${scope}.zaloPreview`,
|
|
503
503
|
defaultMessage: 'Open preview in new tab',
|
|
504
504
|
},
|
|
505
|
+
"zaloOnlyApprovedTemplates": {
|
|
506
|
+
id: `${scope}.zaloOnlyApprovedTemplates`,
|
|
507
|
+
defaultMessage: 'Only enabled templates are shown here',
|
|
508
|
+
},
|
|
505
509
|
});
|
|
@@ -1038,134 +1038,6 @@ exports[`Test Templates container Should render temlates when zalo templates are
|
|
|
1038
1038
|
tip="Getting all templates..."
|
|
1039
1039
|
>
|
|
1040
1040
|
<div>
|
|
1041
|
-
<div
|
|
1042
|
-
className="pagination-container"
|
|
1043
|
-
>
|
|
1044
|
-
<CapCustomCardList
|
|
1045
|
-
cardList={
|
|
1046
|
-
Array [
|
|
1047
|
-
Object {
|
|
1048
|
-
"content": <CapLabel
|
|
1049
|
-
className="zalo-listing-content desc"
|
|
1050
|
-
type="label19"
|
|
1051
|
-
>
|
|
1052
|
-
Test1
|
|
1053
|
-
</CapLabel>,
|
|
1054
|
-
"extra": Array [
|
|
1055
|
-
<CapTooltip
|
|
1056
|
-
title="Open preview in new tab"
|
|
1057
|
-
>
|
|
1058
|
-
<CapIcon
|
|
1059
|
-
className="view-zalo"
|
|
1060
|
-
onClick={[Function]}
|
|
1061
|
-
style={
|
|
1062
|
-
Object {
|
|
1063
|
-
"marginRight": "16px",
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
type="eye"
|
|
1067
|
-
/>
|
|
1068
|
-
</CapTooltip>,
|
|
1069
|
-
],
|
|
1070
|
-
"hoverOption": <CapButton
|
|
1071
|
-
className="select-zalo"
|
|
1072
|
-
isAddBtn={false}
|
|
1073
|
-
onClick={[Function]}
|
|
1074
|
-
type="primary"
|
|
1075
|
-
>
|
|
1076
|
-
Select
|
|
1077
|
-
</CapButton>,
|
|
1078
|
-
"key": "ZALO-card-Test1",
|
|
1079
|
-
"title": <CapRow>
|
|
1080
|
-
<CapLabel
|
|
1081
|
-
className="zalo-template-name"
|
|
1082
|
-
type="label1"
|
|
1083
|
-
>
|
|
1084
|
-
|
|
1085
|
-
</CapLabel>
|
|
1086
|
-
<CapRow
|
|
1087
|
-
align="middle"
|
|
1088
|
-
className="zalo-status-container"
|
|
1089
|
-
type="flex"
|
|
1090
|
-
>
|
|
1091
|
-
<CapStatus
|
|
1092
|
-
color=""
|
|
1093
|
-
height="0.571rem"
|
|
1094
|
-
labelType="label3"
|
|
1095
|
-
text=""
|
|
1096
|
-
type="pending"
|
|
1097
|
-
width="0.571rem"
|
|
1098
|
-
/>
|
|
1099
|
-
</CapRow>
|
|
1100
|
-
</CapRow>,
|
|
1101
|
-
},
|
|
1102
|
-
Object {
|
|
1103
|
-
"content": <CapLabel
|
|
1104
|
-
className="zalo-listing-content desc"
|
|
1105
|
-
type="label19"
|
|
1106
|
-
>
|
|
1107
|
-
Test2
|
|
1108
|
-
</CapLabel>,
|
|
1109
|
-
"extra": Array [
|
|
1110
|
-
<CapTooltip
|
|
1111
|
-
title="Open preview in new tab"
|
|
1112
|
-
>
|
|
1113
|
-
<CapIcon
|
|
1114
|
-
className="view-zalo"
|
|
1115
|
-
onClick={[Function]}
|
|
1116
|
-
style={
|
|
1117
|
-
Object {
|
|
1118
|
-
"marginRight": "16px",
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
type="eye"
|
|
1122
|
-
/>
|
|
1123
|
-
</CapTooltip>,
|
|
1124
|
-
],
|
|
1125
|
-
"hoverOption": <CapButton
|
|
1126
|
-
className="select-zalo"
|
|
1127
|
-
isAddBtn={false}
|
|
1128
|
-
onClick={[Function]}
|
|
1129
|
-
type="primary"
|
|
1130
|
-
>
|
|
1131
|
-
Select
|
|
1132
|
-
</CapButton>,
|
|
1133
|
-
"key": "ZALO-card-Test2",
|
|
1134
|
-
"title": <CapRow>
|
|
1135
|
-
<CapLabel
|
|
1136
|
-
className="zalo-template-name"
|
|
1137
|
-
type="label1"
|
|
1138
|
-
>
|
|
1139
|
-
|
|
1140
|
-
</CapLabel>
|
|
1141
|
-
<CapRow
|
|
1142
|
-
align="middle"
|
|
1143
|
-
className="zalo-status-container"
|
|
1144
|
-
type="flex"
|
|
1145
|
-
>
|
|
1146
|
-
<CapStatus
|
|
1147
|
-
color=""
|
|
1148
|
-
height="0.571rem"
|
|
1149
|
-
labelType="label3"
|
|
1150
|
-
text=""
|
|
1151
|
-
type="pending"
|
|
1152
|
-
width="0.571rem"
|
|
1153
|
-
/>
|
|
1154
|
-
</CapRow>
|
|
1155
|
-
</CapRow>,
|
|
1156
|
-
},
|
|
1157
|
-
]
|
|
1158
|
-
}
|
|
1159
|
-
fbType="list"
|
|
1160
|
-
key="ZALO-card-list"
|
|
1161
|
-
style={
|
|
1162
|
-
Object {
|
|
1163
|
-
"marginLeft": "16px",
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
type="ZALO"
|
|
1167
|
-
/>
|
|
1168
|
-
</div>
|
|
1169
1041
|
<div
|
|
1170
1042
|
style={
|
|
1171
1043
|
Object {
|
|
@@ -1173,7 +1045,34 @@ exports[`Test Templates container Should render temlates when zalo templates are
|
|
|
1173
1045
|
"overflow": "auto",
|
|
1174
1046
|
}
|
|
1175
1047
|
}
|
|
1176
|
-
|
|
1048
|
+
>
|
|
1049
|
+
<CapHeader
|
|
1050
|
+
description={
|
|
1051
|
+
<CapLabel
|
|
1052
|
+
style={
|
|
1053
|
+
Object {
|
|
1054
|
+
"textAlign": "center",
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
type="label1"
|
|
1058
|
+
>
|
|
1059
|
+
Please try searching with another term or apply different filter
|
|
1060
|
+
</CapLabel>
|
|
1061
|
+
}
|
|
1062
|
+
descriptionClass=""
|
|
1063
|
+
inline={false}
|
|
1064
|
+
size="large"
|
|
1065
|
+
title={
|
|
1066
|
+
<CapHeading
|
|
1067
|
+
className="channel-specific-illustration-text"
|
|
1068
|
+
type="h3"
|
|
1069
|
+
>
|
|
1070
|
+
Sorry, we couldn’t find any matches
|
|
1071
|
+
</CapHeading>
|
|
1072
|
+
}
|
|
1073
|
+
titleClass=""
|
|
1074
|
+
/>
|
|
1075
|
+
</div>
|
|
1177
1076
|
</div>
|
|
1178
1077
|
</CapSpin>
|
|
1179
1078
|
</div>
|
|
@@ -36,7 +36,6 @@ import {
|
|
|
36
36
|
ERROR_ALERT,
|
|
37
37
|
WARNING_ALERT,
|
|
38
38
|
ZALO_STATUSES,
|
|
39
|
-
ENABLE,
|
|
40
39
|
} from "./constants";
|
|
41
40
|
import "./index.scss";
|
|
42
41
|
import { makeSelectZalo } from "./selectors";
|
|
@@ -68,7 +67,7 @@ export const Zalo = ({
|
|
|
68
67
|
const [templatePreviewUrl, setTemplatePreviewUrl] = useState("");
|
|
69
68
|
const [tags, updateTags] = useState([]);
|
|
70
69
|
const [textAreaId, updateTextAreaId] = useState("");
|
|
71
|
-
const [templateStatus, setZaloTemplateStatus] = useState(ENABLE);
|
|
70
|
+
const [templateStatus, setZaloTemplateStatus] = useState(ZALO_STATUSES.ENABLE);
|
|
72
71
|
|
|
73
72
|
const ZaloFooter = styled.div`
|
|
74
73
|
background-color: ${CAP_WHITE};
|