@capillarytech/creatives-library 7.17.47-alpha.0 → 7.17.48

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.
@@ -73,5 +73,3 @@ export const GET_SENDER_DETAILS_FAILURE =
73
73
  export const GET_CDN_TRANSFORMATION_CONFIG_REQUEST = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_REQUEST';
74
74
  export const GET_CDN_TRANSFORMATION_CONFIG_SUCCESS = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_SUCCESS';
75
75
  export const GET_CDN_TRANSFORMATION_CONFIG_FAILURE = 'app/v2Containers/Templates/GET_CDN_TRANSFORMATION_CONFIG_FAILURE';
76
-
77
- export const COPY_OF = 'Copy of';
@@ -93,7 +93,8 @@ import {
93
93
  FACEBOOK as FACEBOOK_CHANNEL,
94
94
  CREATE,
95
95
  } from '../App/constants';
96
- import { COPY_OF, MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES } from './constants';
96
+ import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES } from './constants';
97
+ import { COPY_OF } from '../../containers/App/constants';
97
98
  import {
98
99
  TWILIO_CATEGORY_OPTIONS,
99
100
  KARIX_GUPSHUP_CATEGORY_OPTIONS,
@@ -758,6 +759,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
758
759
  if ((this.state.channel || '').toLowerCase() === "sms" && isTraiDltFeature) {
759
760
  queryParams.traiEnable = true;
760
761
  }
762
+ const copyOf = this.props?.intl?.formatMessage(globalMessages.copyOf);
761
763
  if (resetTemplates) {
762
764
  if(this.state.channel.toLowerCase() !== ZALO_LOWERCASE) {
763
765
  queryParams.name = this.state.searchText;
@@ -771,7 +773,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
771
773
  queryParams.originalId = this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier;
772
774
  }
773
775
  const channel = this.state.channel;
774
- this.props.actions.getAllTemplates(channel, queryParams,`${this.props?.intl?.formatMessage(globalMessages.copyOf)}`);
776
+ this.props.actions.getAllTemplates(channel, queryParams,`${copyOf}`);
775
777
  } else if ((resetPage || (page === 1 && this.state.templatesCount === 0) || page <= (this.state.templatesCount / this.state.perPageLimit))) {
776
778
  if (getNextPage) {
777
779
  page += 1;
@@ -813,7 +815,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
813
815
  queryParams.page = page;
814
816
  queryParams.perPage = this.state.perPageLimit;
815
817
  const channel = this.state.channel;
816
- this.props.actions.getAllTemplates(channel, queryParams, `${this.props?.intl?.formatMessage(globalMessages.copyOf)}`);
818
+ this.props.actions.getAllTemplates(channel, queryParams, `${copyOf}`);
817
819
  });
818
820
  }
819
821
  };
@@ -4,6 +4,7 @@ import { LOCATION_CHANGE } from 'react-router-redux';
4
4
  import * as Api from '../../services/api';
5
5
  import * as types from './constants';
6
6
  import { saveCdnConfigs, removeAllCdnLocalStorageItems } from '../../utils/cdnTransformation';
7
+ import { COPY_OF } from '../../containers/App/constants';
7
8
  // Individual exports for testing
8
9
  export function* getAllTemplates(channel, queryParams) {
9
10
  try {
@@ -23,7 +24,7 @@ export function* getAllTemplates(channel, queryParams) {
23
24
  if (channel.intlCopyOf && channelTemplates?.templates) {
24
25
  channelTemplates.templates = channelTemplates.templates.map((template) => ({
25
26
  ...template,
26
- name: template.name.replace(new RegExp(types.COPY_OF, 'g'), channel.intlCopyOf),
27
+ name: template.name.replace(new RegExp(COPY_OF, 'g'), channel.intlCopyOf),
27
28
  }));
28
29
  }
29
30
  yield put({ type: types.GET_ALL_TEMPLATES_SUCCESS, data: channelTemplates, weCRMTemplate: result.response.unMapped, isReset: channel.queryParams.page === 1 });
@@ -127,9 +128,7 @@ export function* sendZippedFile({selectedFile, errorHandler, successHandler}) {
127
128
  errorMessage = result.message;
128
129
  yield errorHandler(errorMessage);
129
130
  }
130
-
131
-
132
- console.log("Got decoded result", decodeURIComponent(result.response.metaEntity.htmlContent));
131
+
133
132
  yield [
134
133
  put({
135
134
  type: types.SEND_ZIPPED_FILE_SUCCESS,
@@ -430,7 +430,7 @@ exports[`Test Templates container Should render temlates when Zalo templates are
430
430
  size="size-r"
431
431
  width={60}
432
432
  />
433
- <InjectIntl(Wrapper)
433
+ <Wrapper
434
434
  centered={true}
435
435
  className="delete-template-confirm"
436
436
  closeText="Cancel"
@@ -441,7 +441,7 @@ exports[`Test Templates container Should render temlates when Zalo templates are
441
441
  visible={false}
442
442
  >
443
443
  Are you sure you wish to delete this template?
444
- </InjectIntl(Wrapper)>
444
+ </Wrapper>
445
445
  </CapRow>
446
446
  </div>
447
447
  </Fragment>
@@ -668,7 +668,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
668
668
  size="size-r"
669
669
  width={60}
670
670
  />
671
- <InjectIntl(Wrapper)
671
+ <Wrapper
672
672
  centered={true}
673
673
  className="delete-template-confirm"
674
674
  closeText="Cancel"
@@ -679,7 +679,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
679
679
  visible={false}
680
680
  >
681
681
  Are you sure you wish to delete this template?
682
- </InjectIntl(Wrapper)>
682
+ </Wrapper>
683
683
  </CapRow>
684
684
  </div>
685
685
  </Fragment>
@@ -962,7 +962,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
962
962
  size="size-r"
963
963
  width={60}
964
964
  />
965
- <InjectIntl(Wrapper)
965
+ <Wrapper
966
966
  centered={true}
967
967
  className="delete-template-confirm"
968
968
  closeText="Cancel"
@@ -973,7 +973,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
973
973
  visible={false}
974
974
  >
975
975
  Are you sure you wish to delete this template?
976
- </InjectIntl(Wrapper)>
976
+ </Wrapper>
977
977
  </CapRow>
978
978
  </div>
979
979
  </Fragment>
@@ -1119,7 +1119,7 @@ exports[`Test Templates container Should render temlates when zalo templates are
1119
1119
  size="size-r"
1120
1120
  width={60}
1121
1121
  />
1122
- <InjectIntl(Wrapper)
1122
+ <Wrapper
1123
1123
  centered={true}
1124
1124
  className="delete-template-confirm"
1125
1125
  closeText="Cancel"
@@ -1130,7 +1130,7 @@ exports[`Test Templates container Should render temlates when zalo templates are
1130
1130
  visible={false}
1131
1131
  >
1132
1132
  Are you sure you wish to delete this template?
1133
- </InjectIntl(Wrapper)>
1133
+ </Wrapper>
1134
1134
  </CapRow>
1135
1135
  </div>
1136
1136
  </Fragment>
@@ -1592,7 +1592,7 @@ Click {{3}} to unsubscribe",
1592
1592
  size="size-r"
1593
1593
  width={60}
1594
1594
  />
1595
- <InjectIntl(Wrapper)
1595
+ <Wrapper
1596
1596
  centered={true}
1597
1597
  className="delete-template-confirm"
1598
1598
  closeText="Cancel"
@@ -1603,7 +1603,7 @@ Click {{3}} to unsubscribe",
1603
1603
  visible={false}
1604
1604
  >
1605
1605
  Are you sure you wish to delete this template?
1606
- </InjectIntl(Wrapper)>
1606
+ </Wrapper>
1607
1607
  </CapRow>
1608
1608
  </div>
1609
1609
  </Fragment>
@@ -2033,7 +2033,7 @@ Click {{3}} to unsubscribe",
2033
2033
  size="size-r"
2034
2034
  width={60}
2035
2035
  />
2036
- <InjectIntl(Wrapper)
2036
+ <Wrapper
2037
2037
  centered={true}
2038
2038
  className="delete-template-confirm"
2039
2039
  closeText="Cancel"
@@ -2044,7 +2044,7 @@ Click {{3}} to unsubscribe",
2044
2044
  visible={false}
2045
2045
  >
2046
2046
  Are you sure you wish to delete this template?
2047
- </InjectIntl(Wrapper)>
2047
+ </Wrapper>
2048
2048
  </CapRow>
2049
2049
  </div>
2050
2050
  </Fragment>
@@ -2474,7 +2474,7 @@ Click {{3}} to unsubscribe",
2474
2474
  size="size-r"
2475
2475
  width={60}
2476
2476
  />
2477
- <InjectIntl(Wrapper)
2477
+ <Wrapper
2478
2478
  centered={true}
2479
2479
  className="delete-template-confirm"
2480
2480
  closeText="Cancel"
@@ -2485,7 +2485,7 @@ Click {{3}} to unsubscribe",
2485
2485
  visible={false}
2486
2486
  >
2487
2487
  Are you sure you wish to delete this template?
2488
- </InjectIntl(Wrapper)>
2488
+ </Wrapper>
2489
2489
  </CapRow>
2490
2490
  </div>
2491
2491
  </Fragment>
@@ -2738,7 +2738,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 1`] = `
2738
2738
  size="size-r"
2739
2739
  width={60}
2740
2740
  />
2741
- <InjectIntl(Wrapper)
2741
+ <Wrapper
2742
2742
  centered={true}
2743
2743
  className="delete-template-confirm"
2744
2744
  closeText="Cancel"
@@ -2749,7 +2749,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 1`] = `
2749
2749
  visible={false}
2750
2750
  >
2751
2751
  Are you sure you wish to delete this template?
2752
- </InjectIntl(Wrapper)>
2752
+ </Wrapper>
2753
2753
  </CapRow>
2754
2754
  </div>
2755
2755
  </Fragment>
@@ -2976,7 +2976,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 2`] = `
2976
2976
  size="size-r"
2977
2977
  width={60}
2978
2978
  />
2979
- <InjectIntl(Wrapper)
2979
+ <Wrapper
2980
2980
  centered={true}
2981
2981
  className="delete-template-confirm"
2982
2982
  closeText="Cancel"
@@ -2987,7 +2987,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 2`] = `
2987
2987
  visible={false}
2988
2988
  >
2989
2989
  Are you sure you wish to delete this template?
2990
- </InjectIntl(Wrapper)>
2990
+ </Wrapper>
2991
2991
  </CapRow>
2992
2992
  </div>
2993
2993
  </Fragment>
@@ -3214,7 +3214,7 @@ exports[`Test Templates container Test removing single filter 1`] = `
3214
3214
  size="size-r"
3215
3215
  width={60}
3216
3216
  />
3217
- <InjectIntl(Wrapper)
3217
+ <Wrapper
3218
3218
  centered={true}
3219
3219
  className="delete-template-confirm"
3220
3220
  closeText="Cancel"
@@ -3225,7 +3225,7 @@ exports[`Test Templates container Test removing single filter 1`] = `
3225
3225
  visible={false}
3226
3226
  >
3227
3227
  Are you sure you wish to delete this template?
3228
- </InjectIntl(Wrapper)>
3228
+ </Wrapper>
3229
3229
  </CapRow>
3230
3230
  </div>
3231
3231
  </Fragment>
@@ -1,52 +0,0 @@
1
- import { fromJS } from "immutable";
2
- import { makeSelectZalo, selectZaloDomain } from "../selectors";
3
- import { zaloTemplateInfoData } from "./mockData";
4
-
5
- describe("makeSelectZalo", () => {
6
- it("returns the expected object with default values when substate is empty", () => {
7
- // Arrange
8
- const state = fromJS({ zalo: {} });
9
- const expected = {
10
- zaloTemplateInfoStatus: undefined,
11
- zaloTemplateInfoValue: undefined,
12
- zaloTemplateInfoError: undefined,
13
- zaloTemplatePreviewData: undefined,
14
- };
15
- const selector = makeSelectZalo();
16
-
17
- // Act
18
- const result = selector(state);
19
-
20
- // Assert
21
- expect(result).toEqual(expected);
22
- });
23
-
24
- it("returns the expected object when substate has values", () => {
25
- // Arrange
26
- const state = fromJS({
27
- zalo: zaloTemplateInfoData,
28
- });
29
- const expected = {
30
- zaloTemplateInfoStatus: "success",
31
- zaloTemplateInfoValue: fromJS(zaloTemplateInfoData.zaloTemplateInfoValue),
32
- zaloTemplateInfoError: null,
33
- zaloTemplatePreviewData: undefined,
34
- };
35
- const selector = makeSelectZalo();
36
-
37
- // Act
38
- const result = selector(state);
39
-
40
- // Assert
41
- expect(result).toEqual(expected);
42
- });
43
-
44
- it("returns the expected object with default values when substate is empty", () => {
45
- // Arrange
46
- const state = fromJS({ zalo: {} });
47
- const expected = fromJS({});
48
- const result = selectZaloDomain(state);
49
- // Assert
50
- expect(result).toEqual(expected);
51
- });
52
- });