@capillarytech/creatives-library 7.17.177 → 7.17.179
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 +2 -2
- package/v2Containers/CreativesContainer/index.js +2 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +28 -28
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +8 -8
- package/v2Containers/Templates/index.js +19 -7
- package/v2Containers/Templates/sagas.js +2 -1
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +87 -522
- package/v2Containers/Templates/tests/index.test.js +1 -0
- package/v2Containers/Templates/tests/sagas.test.js +54 -1
- package/v2Containers/Zalo/index.js +11 -8
- package/v2Containers/Zalo/selectors.js +1 -1
- package/v2Containers/Zalo/tests/mockData.js +46 -0
- package/v2Containers/Zalo/tests/selector.test.js +3 -3
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -525,8 +525,8 @@ export const getS3UrlFileSizes = (data) => {
|
|
|
525
525
|
return request(url, getAPICallObject('POST', data));
|
|
526
526
|
};
|
|
527
527
|
|
|
528
|
-
export const getTemplateInfoById = ({id, username, oa_id, token}) => {
|
|
529
|
-
const url = `${API_ENDPOINT}/templates/v1/${id}/Zalo?username=${username}&oa_id=${oa_id}&token=${token}`;
|
|
528
|
+
export const getTemplateInfoById = ({id, username, oa_id, token, host}) => {
|
|
529
|
+
const url = `${API_ENDPOINT}/templates/v1/${id}/Zalo?username=${username}&oa_id=${oa_id}&token=${token}&host=${host}`;
|
|
530
530
|
const compressedTemplatesData = request(url, getAPICallObject('GET'));
|
|
531
531
|
return compressedTemplatesData.then((data) => {
|
|
532
532
|
const { response = '' } = data || {};
|
|
@@ -124,10 +124,12 @@ export class Creatives extends React.Component {
|
|
|
124
124
|
sourceAccountIdentifier = "",
|
|
125
125
|
configs: { token = "" } = {},
|
|
126
126
|
} = get(this.props, "Templates.selectedZaloAccount", {});
|
|
127
|
+
const { hostName = ''} = get(this.props, "Templates.senderDetails", {});
|
|
127
128
|
this.props.zaloActions.getTemplateInfoById({
|
|
128
129
|
username: name,
|
|
129
130
|
oa_id: sourceAccountIdentifier,
|
|
130
131
|
token,
|
|
132
|
+
host: hostName,
|
|
131
133
|
id: template?._id,
|
|
132
134
|
preview: true,
|
|
133
135
|
actionCallback: this.actionCallback,
|
|
@@ -20387,7 +20387,7 @@ new message content.",
|
|
|
20387
20387
|
}
|
|
20388
20388
|
}
|
|
20389
20389
|
activeKey="text"
|
|
20390
|
-
className="withStyles__StyledComponent-sc-
|
|
20390
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 bdjesA"
|
|
20391
20391
|
content={
|
|
20392
20392
|
Object {
|
|
20393
20393
|
"isError": true,
|
|
@@ -22780,7 +22780,7 @@ new message content.",
|
|
|
22780
22780
|
}
|
|
22781
22781
|
>
|
|
22782
22782
|
<div
|
|
22783
|
-
className="withStyles__StyledComponent-sc-
|
|
22783
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 bdjesA"
|
|
22784
22784
|
>
|
|
22785
22785
|
<_class
|
|
22786
22786
|
className="text-template-title"
|
|
@@ -23518,7 +23518,7 @@ new message content.",
|
|
|
23518
23518
|
>
|
|
23519
23519
|
<InjectIntl(Wrapper)
|
|
23520
23520
|
centered={true}
|
|
23521
|
-
className="withStyles__StyledComponent-sc-
|
|
23521
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
23522
23522
|
onCancel={[Function]}
|
|
23523
23523
|
onOk={[Function]}
|
|
23524
23524
|
visible={false}
|
|
@@ -23526,7 +23526,7 @@ new message content.",
|
|
|
23526
23526
|
>
|
|
23527
23527
|
<Wrapper
|
|
23528
23528
|
centered={true}
|
|
23529
|
-
className="withStyles__StyledComponent-sc-
|
|
23529
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
23530
23530
|
intl={
|
|
23531
23531
|
Object {
|
|
23532
23532
|
"defaultFormats": Object {},
|
|
@@ -25785,7 +25785,7 @@ new message content.",
|
|
|
25785
25785
|
>
|
|
25786
25786
|
<CapModal
|
|
25787
25787
|
centered={true}
|
|
25788
|
-
className="withStyles__StyledComponent-sc-
|
|
25788
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
25789
25789
|
intl={
|
|
25790
25790
|
Object {
|
|
25791
25791
|
"defaultFormats": Object {},
|
|
@@ -28044,7 +28044,7 @@ new message content.",
|
|
|
28044
28044
|
>
|
|
28045
28045
|
<Modal
|
|
28046
28046
|
centered={true}
|
|
28047
|
-
className="cap-modal-v2 withStyles__StyledComponent-sc-
|
|
28047
|
+
className="cap-modal-v2 withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
28048
28048
|
confirmLoading={false}
|
|
28049
28049
|
footer={
|
|
28050
28050
|
<div
|
|
@@ -30320,10 +30320,10 @@ new message content.",
|
|
|
30320
30320
|
transitionName="zoom"
|
|
30321
30321
|
visible={false}
|
|
30322
30322
|
width="450px"
|
|
30323
|
-
wrapClassName="cap-modal-v2-wrap withStyles__StyledComponent-sc-
|
|
30323
|
+
wrapClassName="cap-modal-v2-wrap withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
30324
30324
|
>
|
|
30325
30325
|
<Component
|
|
30326
|
-
className="cap-modal-v2 withStyles__StyledComponent-sc-
|
|
30326
|
+
className="cap-modal-v2 withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
30327
30327
|
closeIcon={
|
|
30328
30328
|
<span
|
|
30329
30329
|
className="ant-modal-close-x"
|
|
@@ -32611,7 +32611,7 @@ new message content.",
|
|
|
32611
32611
|
transitionName="zoom"
|
|
32612
32612
|
visible={false}
|
|
32613
32613
|
width="450px"
|
|
32614
|
-
wrapClassName="ant-modal-centered cap-modal-v2-wrap withStyles__StyledComponent-sc-
|
|
32614
|
+
wrapClassName="ant-modal-centered cap-modal-v2-wrap withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
32615
32615
|
>
|
|
32616
32616
|
<PortalWrapper
|
|
32617
32617
|
visible={false}
|
|
@@ -60300,7 +60300,7 @@ new message content.",
|
|
|
60300
60300
|
}
|
|
60301
60301
|
}
|
|
60302
60302
|
activeKey="flex"
|
|
60303
|
-
className="withStyles__StyledComponent-sc-
|
|
60303
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 bdjesA"
|
|
60304
60304
|
content={
|
|
60305
60305
|
Object {
|
|
60306
60306
|
"isError": true,
|
|
@@ -66384,7 +66384,7 @@ new message content.",
|
|
|
66384
66384
|
}
|
|
66385
66385
|
}
|
|
66386
66386
|
activeKey="flex"
|
|
66387
|
-
className="withStyles__StyledComponent-sc-
|
|
66387
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
66388
66388
|
content={
|
|
66389
66389
|
Object {
|
|
66390
66390
|
"isError": true,
|
|
@@ -68969,7 +68969,7 @@ new message content.",
|
|
|
68969
68969
|
}
|
|
68970
68970
|
>
|
|
68971
68971
|
<div
|
|
68972
|
-
className="withStyles__StyledComponent-sc-
|
|
68972
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
68973
68973
|
>
|
|
68974
68974
|
<CapHeader
|
|
68975
68975
|
className="card-message-header"
|
|
@@ -70098,7 +70098,7 @@ new message content.",
|
|
|
70098
70098
|
}
|
|
70099
70099
|
activeIndex={0}
|
|
70100
70100
|
activeKey="flex"
|
|
70101
|
-
className="withStyles__StyledComponent-sc-
|
|
70101
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
70102
70102
|
content={
|
|
70103
70103
|
Object {
|
|
70104
70104
|
"aspectRatio": "",
|
|
@@ -73284,7 +73284,7 @@ new message content.",
|
|
|
73284
73284
|
}
|
|
73285
73285
|
activeIndex={0}
|
|
73286
73286
|
activeKey="flex"
|
|
73287
|
-
className="withStyles__StyledComponent-sc-
|
|
73287
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
73288
73288
|
content={
|
|
73289
73289
|
Object {
|
|
73290
73290
|
"aspectRatio": "",
|
|
@@ -76326,7 +76326,7 @@ new message content.",
|
|
|
76326
76326
|
}
|
|
76327
76327
|
activeIndex={0}
|
|
76328
76328
|
activeKey="flex"
|
|
76329
|
-
className="withStyles__StyledComponent-sc-
|
|
76329
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
76330
76330
|
content={
|
|
76331
76331
|
Object {
|
|
76332
76332
|
"aspectRatio": "",
|
|
@@ -79379,7 +79379,7 @@ new message content.",
|
|
|
79379
79379
|
}
|
|
79380
79380
|
activeIndex={0}
|
|
79381
79381
|
activeKey="flex"
|
|
79382
|
-
className="withStyles__StyledComponent-sc-
|
|
79382
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
79383
79383
|
content={
|
|
79384
79384
|
Object {
|
|
79385
79385
|
"aspectRatio": "",
|
|
@@ -85194,7 +85194,7 @@ new message content.",
|
|
|
85194
85194
|
}
|
|
85195
85195
|
activeIndex={0}
|
|
85196
85196
|
activeKey="flex"
|
|
85197
|
-
className="withStyles__StyledComponent-sc-
|
|
85197
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
85198
85198
|
content={
|
|
85199
85199
|
Object {
|
|
85200
85200
|
"aspectRatio": "",
|
|
@@ -88352,7 +88352,7 @@ new message content.",
|
|
|
88352
88352
|
}
|
|
88353
88353
|
activeIndex={0}
|
|
88354
88354
|
activeKey="flex"
|
|
88355
|
-
className="withStyles__StyledComponent-sc-
|
|
88355
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
88356
88356
|
content={
|
|
88357
88357
|
Object {
|
|
88358
88358
|
"aspectRatio": "",
|
|
@@ -91441,7 +91441,7 @@ new message content.",
|
|
|
91441
91441
|
}
|
|
91442
91442
|
activeIndex={0}
|
|
91443
91443
|
activeKey="flex"
|
|
91444
|
-
className="withStyles__StyledComponent-sc-
|
|
91444
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
91445
91445
|
content={
|
|
91446
91446
|
Object {
|
|
91447
91447
|
"aspectRatio": "",
|
|
@@ -94429,7 +94429,7 @@ new message content.",
|
|
|
94429
94429
|
}
|
|
94430
94430
|
activeIndex={0}
|
|
94431
94431
|
activeKey="flex"
|
|
94432
|
-
className="withStyles__StyledComponent-sc-
|
|
94432
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
94433
94433
|
content={
|
|
94434
94434
|
Object {
|
|
94435
94435
|
"aspectRatio": "",
|
|
@@ -97177,7 +97177,7 @@ new message content.",
|
|
|
97177
97177
|
}
|
|
97178
97178
|
activeIndex={0}
|
|
97179
97179
|
activeKey="flex"
|
|
97180
|
-
className="withStyles__StyledComponent-sc-
|
|
97180
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 kPFmxq"
|
|
97181
97181
|
content={
|
|
97182
97182
|
Object {
|
|
97183
97183
|
"aspectRatio": "",
|
|
@@ -100172,7 +100172,7 @@ new message content.",
|
|
|
100172
100172
|
>
|
|
100173
100173
|
<InjectIntl(Wrapper)
|
|
100174
100174
|
centered={true}
|
|
100175
|
-
className="withStyles__StyledComponent-sc-
|
|
100175
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
100176
100176
|
onCancel={[Function]}
|
|
100177
100177
|
onOk={[Function]}
|
|
100178
100178
|
visible={false}
|
|
@@ -100180,7 +100180,7 @@ new message content.",
|
|
|
100180
100180
|
>
|
|
100181
100181
|
<Wrapper
|
|
100182
100182
|
centered={true}
|
|
100183
|
-
className="withStyles__StyledComponent-sc-
|
|
100183
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
100184
100184
|
intl={
|
|
100185
100185
|
Object {
|
|
100186
100186
|
"defaultFormats": Object {},
|
|
@@ -102439,7 +102439,7 @@ new message content.",
|
|
|
102439
102439
|
>
|
|
102440
102440
|
<CapModal
|
|
102441
102441
|
centered={true}
|
|
102442
|
-
className="withStyles__StyledComponent-sc-
|
|
102442
|
+
className="withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
102443
102443
|
intl={
|
|
102444
102444
|
Object {
|
|
102445
102445
|
"defaultFormats": Object {},
|
|
@@ -104698,7 +104698,7 @@ new message content.",
|
|
|
104698
104698
|
>
|
|
104699
104699
|
<Modal
|
|
104700
104700
|
centered={true}
|
|
104701
|
-
className="cap-modal-v2 withStyles__StyledComponent-sc-
|
|
104701
|
+
className="cap-modal-v2 withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
104702
104702
|
confirmLoading={false}
|
|
104703
104703
|
footer={
|
|
104704
104704
|
<div
|
|
@@ -106974,10 +106974,10 @@ new message content.",
|
|
|
106974
106974
|
transitionName="zoom"
|
|
106975
106975
|
visible={false}
|
|
106976
106976
|
width="450px"
|
|
106977
|
-
wrapClassName="cap-modal-v2-wrap withStyles__StyledComponent-sc-
|
|
106977
|
+
wrapClassName="cap-modal-v2-wrap withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
106978
106978
|
>
|
|
106979
106979
|
<Component
|
|
106980
|
-
className="cap-modal-v2 withStyles__StyledComponent-sc-
|
|
106980
|
+
className="cap-modal-v2 withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
106981
106981
|
closeIcon={
|
|
106982
106982
|
<span
|
|
106983
106983
|
className="ant-modal-close-x"
|
|
@@ -109265,7 +109265,7 @@ new message content.",
|
|
|
109265
109265
|
transitionName="zoom"
|
|
109266
109266
|
visible={false}
|
|
109267
109267
|
width="450px"
|
|
109268
|
-
wrapClassName="ant-modal-centered cap-modal-v2-wrap withStyles__StyledComponent-sc-
|
|
109268
|
+
wrapClassName="ant-modal-centered cap-modal-v2-wrap withStyles__StyledComponent-sc-1m81eqe-0 FBgTS"
|
|
109269
109269
|
>
|
|
109270
109270
|
<PortalWrapper
|
|
109271
109271
|
visible={false}
|
|
@@ -3013,7 +3013,7 @@ new message content.",
|
|
|
3013
3013
|
key=".2"
|
|
3014
3014
|
>
|
|
3015
3015
|
<div
|
|
3016
|
-
className="Create__SMSTraiFooter-sc-
|
|
3016
|
+
className="Create__SMSTraiFooter-sc-12fdr8c-0 jNeEAK"
|
|
3017
3017
|
>
|
|
3018
3018
|
<CapButton
|
|
3019
3019
|
className="done-button"
|
|
@@ -6057,7 +6057,7 @@ new message content.",
|
|
|
6057
6057
|
key=".2"
|
|
6058
6058
|
>
|
|
6059
6059
|
<div
|
|
6060
|
-
className="Create__SMSTraiFooter-sc-
|
|
6060
|
+
className="Create__SMSTraiFooter-sc-12fdr8c-0 jNeEAK"
|
|
6061
6061
|
>
|
|
6062
6062
|
<CapButton
|
|
6063
6063
|
className="done-button"
|
|
@@ -9077,7 +9077,7 @@ new message content.",
|
|
|
9077
9077
|
key=".2"
|
|
9078
9078
|
>
|
|
9079
9079
|
<div
|
|
9080
|
-
className="Create__SMSTraiFooter-sc-
|
|
9080
|
+
className="Create__SMSTraiFooter-sc-12fdr8c-0 jNeEAK"
|
|
9081
9081
|
>
|
|
9082
9082
|
<CapButton
|
|
9083
9083
|
className="done-button"
|
|
@@ -12138,7 +12138,7 @@ new message content.",
|
|
|
12138
12138
|
key=".2"
|
|
12139
12139
|
>
|
|
12140
12140
|
<div
|
|
12141
|
-
className="Create__SMSTraiFooter-sc-
|
|
12141
|
+
className="Create__SMSTraiFooter-sc-12fdr8c-0 jNeEAK"
|
|
12142
12142
|
>
|
|
12143
12143
|
<CapButton
|
|
12144
12144
|
className="done-button"
|
|
@@ -3059,7 +3059,7 @@ FREE GIFTS-
|
|
|
3059
3059
|
key=".0"
|
|
3060
3060
|
>
|
|
3061
3061
|
<div
|
|
3062
|
-
className="Edit__TraiEditTemplateDetails-
|
|
3062
|
+
className="Edit__TraiEditTemplateDetails-sc-1treyvf-1 hDmIlm"
|
|
3063
3063
|
>
|
|
3064
3064
|
<CapLabel__CapLabelInline
|
|
3065
3065
|
type="label1"
|
|
@@ -7383,7 +7383,7 @@ new message content.",
|
|
|
7383
7383
|
</CapRow>
|
|
7384
7384
|
<Edit__SMSTraiFooter>
|
|
7385
7385
|
<div
|
|
7386
|
-
className="Edit__SMSTraiFooter-
|
|
7386
|
+
className="Edit__SMSTraiFooter-sc-1treyvf-0 kPHYjg"
|
|
7387
7387
|
>
|
|
7388
7388
|
<CapButton
|
|
7389
7389
|
className="create-msg"
|
|
@@ -10389,7 +10389,7 @@ FREE GIFTS-
|
|
|
10389
10389
|
key=".0"
|
|
10390
10390
|
>
|
|
10391
10391
|
<div
|
|
10392
|
-
className="Edit__TraiEditTemplateDetails-
|
|
10392
|
+
className="Edit__TraiEditTemplateDetails-sc-1treyvf-1 hDmIlm"
|
|
10393
10393
|
>
|
|
10394
10394
|
<CapLabel__CapLabelInline
|
|
10395
10395
|
type="label1"
|
|
@@ -14713,7 +14713,7 @@ new message content.",
|
|
|
14713
14713
|
</CapRow>
|
|
14714
14714
|
<Edit__SMSTraiFooter>
|
|
14715
14715
|
<div
|
|
14716
|
-
className="Edit__SMSTraiFooter-
|
|
14716
|
+
className="Edit__SMSTraiFooter-sc-1treyvf-0 kPHYjg"
|
|
14717
14717
|
>
|
|
14718
14718
|
<CapButton
|
|
14719
14719
|
className="create-msg"
|
|
@@ -18139,7 +18139,7 @@ FREE GIFTS-
|
|
|
18139
18139
|
key=".0"
|
|
18140
18140
|
>
|
|
18141
18141
|
<div
|
|
18142
|
-
className="Edit__TraiEditTemplateDetails-
|
|
18142
|
+
className="Edit__TraiEditTemplateDetails-sc-1treyvf-1 hDmIlm"
|
|
18143
18143
|
>
|
|
18144
18144
|
<CapLabel__CapLabelInline
|
|
18145
18145
|
type="label1"
|
|
@@ -22451,7 +22451,7 @@ new message content.",
|
|
|
22451
22451
|
</CapRow>
|
|
22452
22452
|
<Edit__SMSTraiFooter>
|
|
22453
22453
|
<div
|
|
22454
|
-
className="Edit__SMSTraiFooter-
|
|
22454
|
+
className="Edit__SMSTraiFooter-sc-1treyvf-0 kPHYjg"
|
|
22455
22455
|
>
|
|
22456
22456
|
<CapButton
|
|
22457
22457
|
className="create-msg"
|
|
@@ -25998,7 +25998,7 @@ FREE GIFTS-
|
|
|
25998
25998
|
key=".0"
|
|
25999
25999
|
>
|
|
26000
26000
|
<div
|
|
26001
|
-
className="Edit__TraiEditTemplateDetails-
|
|
26001
|
+
className="Edit__TraiEditTemplateDetails-sc-1treyvf-1 hDmIlm"
|
|
26002
26002
|
>
|
|
26003
26003
|
<CapLabel__CapLabelInline
|
|
26004
26004
|
type="label1"
|
|
@@ -30322,7 +30322,7 @@ new message content.",
|
|
|
30322
30322
|
</CapRow>
|
|
30323
30323
|
<Edit__SMSTraiFooter>
|
|
30324
30324
|
<div
|
|
30325
|
-
className="Edit__SMSTraiFooter-
|
|
30325
|
+
className="Edit__SMSTraiFooter-sc-1treyvf-0 kPHYjg"
|
|
30326
30326
|
>
|
|
30327
30327
|
<CapButton
|
|
30328
30328
|
className="create-msg"
|
|
@@ -305,6 +305,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
305
305
|
channel = 'Zalo';
|
|
306
306
|
activeMode = ACCOUNT_SELECTION_MODE;
|
|
307
307
|
this.props.actions.getWeCrmAccounts(channel);
|
|
308
|
+
this.props.actions.getSenderDetails({
|
|
309
|
+
channel: ZALO,
|
|
310
|
+
orgUnitId: -1,
|
|
311
|
+
});
|
|
308
312
|
break;
|
|
309
313
|
default:
|
|
310
314
|
channel = '';
|
|
@@ -619,18 +623,19 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
619
623
|
wecrm_token
|
|
620
624
|
} = configs || {};
|
|
621
625
|
if (weCrmChannels.includes(selectedChannel)) {
|
|
622
|
-
if ([WHATSAPP_LOWERCASE].includes(selectedChannel)) {
|
|
626
|
+
if ([WHATSAPP_LOWERCASE, ZALO_LOWERCASE].includes(selectedChannel)) {
|
|
623
627
|
if (hostName === '') {
|
|
624
628
|
return;
|
|
625
629
|
}
|
|
626
630
|
|
|
627
631
|
weCrmAccountsList[0].hostName = hostName;
|
|
628
632
|
nextProps.actions.setChannelAccount(selectedChannel.toUpperCase(), weCrmAccountsList[0]);
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
633
|
+
if (selectedChannel === ZALO_LOWERCASE) {
|
|
634
|
+
paramsDefault.username = name;
|
|
635
|
+
paramsDefault.oa_id = sourceAccountIdentifier;
|
|
636
|
+
paramsDefault.token = token;
|
|
637
|
+
paramsDefault.host = hostName || this.state.hostName || this.props.Templates?.senderDetails?.hostName;
|
|
638
|
+
}
|
|
634
639
|
} else {
|
|
635
640
|
paramsDefault.wecrmId = wecrm_app_id;
|
|
636
641
|
paramsDefault.wecrmToken = wecrm_token;
|
|
@@ -641,7 +646,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
641
646
|
}
|
|
642
647
|
|
|
643
648
|
}
|
|
644
|
-
this.setState({ defaultAccount: false, activeMode: TEMPLATES_MODE, selectedAccount: weCrmAccountsList[0].name, hostName });
|
|
649
|
+
this.setState({ defaultAccount: false, activeMode: TEMPLATES_MODE, selectedAccount: weCrmAccountsList[0].name, hostName: weCrmAccountsList[0].hostName });
|
|
645
650
|
this.getAllTemplates({params: paramsDefault}, true);
|
|
646
651
|
}
|
|
647
652
|
const zaloPreviewUrl = get(nextProps, 'Zalo.zaloTemplatePreviewData.versions.base.content.zalo.previewUrl', '');
|
|
@@ -700,6 +705,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
700
705
|
params.oa_id = sourceAccountIdentifier;
|
|
701
706
|
params.token = token;
|
|
702
707
|
params.isAccountSelection = true;
|
|
708
|
+
params.host = this.props.Templates?.senderDetails?.hostName || this.props.Templates?.selectedZaloAccount?.hostName;
|
|
703
709
|
}
|
|
704
710
|
}
|
|
705
711
|
|
|
@@ -799,6 +805,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
799
805
|
if(this.state.channel.toLowerCase() !== ZALO_LOWERCASE) {
|
|
800
806
|
queryParams.name = this.state.searchText;
|
|
801
807
|
queryParams.sortBy = this.state.sortBy;
|
|
808
|
+
} else {
|
|
809
|
+
queryParams.host = this.props.Templates?.senderDetails?.hostName || this.props.Templates?.selectedZaloAccount?.hostName;
|
|
802
810
|
}
|
|
803
811
|
queryParams.page = this.state.page;
|
|
804
812
|
queryParams.perPage = this.state.perPageLimit;
|
|
@@ -853,10 +861,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
853
861
|
name = "",
|
|
854
862
|
sourceAccountIdentifier = "",
|
|
855
863
|
configs: { token = "" } = {},
|
|
864
|
+
hostName = "",
|
|
856
865
|
} = get(this.props, "Templates.selectedZaloAccount", {});
|
|
857
866
|
queryParams.username = name;
|
|
858
867
|
queryParams.oa_id = sourceAccountIdentifier;
|
|
859
868
|
queryParams.token = token;
|
|
869
|
+
queryParams.host = hostName || this.state.hostName || this.props.Templates?.senderDetails?.hostName;
|
|
860
870
|
}
|
|
861
871
|
this.setState({ page, templatesCount }, () => {
|
|
862
872
|
queryParams.page = page;
|
|
@@ -2102,11 +2112,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2102
2112
|
name = "",
|
|
2103
2113
|
sourceAccountIdentifier = "",
|
|
2104
2114
|
configs: { token = "" } = {},
|
|
2115
|
+
hostName = "",
|
|
2105
2116
|
} = get(this.props, "Templates.selectedZaloAccount", {});
|
|
2106
2117
|
this.props.zaloActions.getTemplateInfoById({
|
|
2107
2118
|
username: name,
|
|
2108
2119
|
oa_id: sourceAccountIdentifier,
|
|
2109
2120
|
token: token,
|
|
2121
|
+
host: hostName || this.state.hostName || this.props.Templates?.senderDetails?.hostName,
|
|
2110
2122
|
id: template?._id,
|
|
2111
2123
|
preview: true,
|
|
2112
2124
|
actionCallback: this.actionCallback,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import get from 'lodash/get';
|
|
1
2
|
import { call, put, takeLatest, take, cancel, select } from 'redux-saga/effects';
|
|
2
3
|
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
3
4
|
// import { schema, normalize } from 'normalizr';
|
|
@@ -176,7 +177,7 @@ export function* getSenderDetails({
|
|
|
176
177
|
if (!apiResponse?.errors?.length) {
|
|
177
178
|
yield put({
|
|
178
179
|
type: types.GET_SENDER_DETAILS_SUCCESS,
|
|
179
|
-
payload: apiResponse
|
|
180
|
+
payload: get(apiResponse, `entity.${channel}[0].domainProperties.hostName`, ''),
|
|
180
181
|
});
|
|
181
182
|
} else {
|
|
182
183
|
yield put({
|