@capillarytech/creatives-library 7.12.44 → 7.12.46

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.
Files changed (28) hide show
  1. package/config/app.js +0 -1
  2. package/package.json +1 -1
  3. package/v2Containers/Cap/tests/index.test.js +2 -2
  4. package/v2Containers/CreativesContainer/SlideBoxContent.js +8 -7
  5. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +30 -20
  6. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +303 -12
  7. package/v2Containers/Line/Container/ImageCarousel/Content.js +15 -29
  8. package/v2Containers/Line/Container/ImageCarousel/constants.js +3 -0
  9. package/v2Containers/Line/Container/ImageCarousel/index.js +24 -35
  10. package/v2Containers/Line/Container/ImageCarousel/messages.js +4 -0
  11. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +9851 -0
  12. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +21113 -0
  13. package/v2Containers/Line/Container/ImageCarousel/tests/content.test.js +71 -0
  14. package/v2Containers/Line/Container/ImageCarousel/tests/index.test.js +58 -0
  15. package/v2Containers/Line/Container/ImageCarousel/tests/mockData.js +1322 -0
  16. package/v2Containers/Line/Container/ImageCarousel/tests/utils.test.js +13 -0
  17. package/v2Containers/Line/Container/ImageCarousel/utils.js +12 -0
  18. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +84451 -0
  19. package/v2Containers/Line/Container/Wrapper/tests/index.test.js +58 -0
  20. package/v2Containers/Line/Container/Wrapper/tests/mockData.js +171 -0
  21. package/v2Containers/Line/Container/index.js +2 -0
  22. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +59589 -0
  23. package/v2Containers/Line/Container/tests/index.test.js +105 -0
  24. package/v2Containers/Line/Container/tests/mockData.js +1334 -0
  25. package/v2Containers/Templates/constants.js +1 -1
  26. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +381 -1
  27. package/v2Containers/Templates/tests/index.test.js +7 -1
  28. package/v2Containers/mockdata.js +68 -11
@@ -59,4 +59,4 @@ export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_SUCCESS =
59
59
  export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE =
60
60
  'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE';
61
61
 
62
- export const MAX_WHATSAPP_TEMPLATES = 250;
62
+ export const MAX_WHATSAPP_TEMPLATES = 500;
@@ -2630,7 +2630,7 @@ exports[`Test Templates container Test max templates exceeded 1`] = `
2630
2630
  id="creatives.containersV2.Templates.whatsappMaxTemplates"
2631
2631
  values={
2632
2632
  Object {
2633
- "maxCount": 250,
2633
+ "maxCount": 500,
2634
2634
  }
2635
2635
  }
2636
2636
  />
@@ -2680,6 +2680,386 @@ exports[`Test Templates container Test max templates exceeded 1`] = `
2680
2680
  type="label9"
2681
2681
  >
2682
2682
  $'asdasd
2683
+ Click {{unsubscribe}} to unsubscribe'
2684
+ </CapLabel>
2685
+ </React.Fragment>
2686
+ </React.Fragment>,
2687
+ "extra": Array [
2688
+ <CapIcon
2689
+ className="view-whatsapp"
2690
+ onClick={[Function]}
2691
+ style={
2692
+ Object {
2693
+ "marginRight": "16px",
2694
+ }
2695
+ }
2696
+ type="eye"
2697
+ />,
2698
+ ],
2699
+ "hoverOption": <CapButton
2700
+ className="edit-whatsapp"
2701
+ isAddBtn={false}
2702
+ onClick={[Function]}
2703
+ type="primary"
2704
+ >
2705
+ Overview
2706
+ </CapButton>,
2707
+ "key": "WHATSAPP-card-saad",
2708
+ "title": <CapRow
2709
+ className="whatsapp-card-title"
2710
+ >
2711
+ <CapLabel
2712
+ type="label1"
2713
+ >
2714
+ saad
2715
+ </CapLabel>
2716
+ <WhatsappStatusContainer
2717
+ template={
2718
+ Object {
2719
+ "_id": "620b88327ecc279198099117",
2720
+ "createdAt": "2022-02-15T11:02:11.190Z",
2721
+ "createdBy": "15000449",
2722
+ "isActive": true,
2723
+ "name": "saad",
2724
+ "orgId": 50146,
2725
+ "totalCount": 510,
2726
+ "type": "WHATSAPP",
2727
+ "updatedAt": "2022-02-15T11:02:11.190Z",
2728
+ "updatedBy": "15000449",
2729
+ "versions": Object {
2730
+ "$init": true,
2731
+ "base": Object {
2732
+ "content": Object {
2733
+ "whatsapp": Object {
2734
+ "accessToken": "4676323eb5d1f975b0987070c03a8efc",
2735
+ "accountId": "AC41030cebba9e2f1ce37c78235da0ee18",
2736
+ "accountName": "WhatsppTest",
2737
+ "category": "ACCOUNT_UPDATE",
2738
+ "languages": Array [
2739
+ Object {
2740
+ "content": "$'asdasd
2741
+ Click {{1}} to unsubscribe'",
2742
+ "language": "en",
2743
+ },
2744
+ ],
2745
+ "mediaType": "text",
2746
+ "rejection_reason": null,
2747
+ "status": "approved",
2748
+ "templateId": "HTc5068cbaa813f931ed887f19922ca19d",
2749
+ },
2750
+ },
2751
+ },
2752
+ "history": Array [],
2753
+ },
2754
+ }
2755
+ }
2756
+ />
2757
+ </CapRow>,
2758
+ },
2759
+ ]
2760
+ }
2761
+ fbType="list"
2762
+ key="WHATSAPP-card-list"
2763
+ style={
2764
+ Object {
2765
+ "marginLeft": "16px",
2766
+ }
2767
+ }
2768
+ type="WHATSAPP"
2769
+ />
2770
+ </div>
2771
+ <div
2772
+ style={
2773
+ Object {
2774
+ "height": "calc(100vh - 325px)",
2775
+ "overflow": "auto",
2776
+ }
2777
+ }
2778
+ />
2779
+ </div>
2780
+ </CapSpin>
2781
+ </div>
2782
+ </Pagination>
2783
+ </CapRow>
2784
+ <CapRow />
2785
+ <CapRow>
2786
+ <CapSlideBox
2787
+ closeIconSize="m"
2788
+ content={
2789
+ <CardGrid
2790
+ className=""
2791
+ colNumber={2}
2792
+ gutterSize={16}
2793
+ isLoading={false}
2794
+ listItem={Array []}
2795
+ onHoverItem={[Function]}
2796
+ onItemClick={[Function]}
2797
+ />
2798
+ }
2799
+ handleClose={[Function]}
2800
+ header={
2801
+ <h3>
2802
+ Select layout
2803
+ </h3>
2804
+ }
2805
+ loadingText="Loading EDM Templates"
2806
+ position="right"
2807
+ show={false}
2808
+ size="size-r"
2809
+ width={60}
2810
+ />
2811
+ <Wrapper
2812
+ centered={true}
2813
+ className="delete-template-confirm"
2814
+ closeText="Cancel"
2815
+ okText="Yes, delete"
2816
+ onCancel={[Function]}
2817
+ onOk={[Function]}
2818
+ title="Confirm delete template"
2819
+ visible={false}
2820
+ >
2821
+ Are you sure you wish to delete this template?
2822
+ </Wrapper>
2823
+ </CapRow>
2824
+ </div>
2825
+ </Fragment>
2826
+ `;
2827
+
2828
+ exports[`Test Templates container Test max templates not exceeded 1`] = `
2829
+ <Fragment>
2830
+ <div
2831
+ className="creatives-templates-list full-mode"
2832
+ >
2833
+ <input
2834
+ accept=".zip, .html, .htm"
2835
+ id="filename"
2836
+ onChange={[Function]}
2837
+ style={
2838
+ Object {
2839
+ "display": "none",
2840
+ }
2841
+ }
2842
+ type="file"
2843
+ />
2844
+ <CapRow>
2845
+ <Pagination
2846
+ onPageChange={[Function]}
2847
+ paginationContainer="pagination-container"
2848
+ paginationSelector="pagination-container"
2849
+ >
2850
+ <div>
2851
+ <div
2852
+ className="action-container"
2853
+ >
2854
+ <_class
2855
+ className="search-text"
2856
+ disabled={false}
2857
+ labelPosition="top"
2858
+ onChange={[Function]}
2859
+ onClear={[Function]}
2860
+ onScroll={[Function]}
2861
+ placeholder="Search"
2862
+ style={
2863
+ Object {
2864
+ "width": "210px",
2865
+ }
2866
+ }
2867
+ value=""
2868
+ />
2869
+ <div
2870
+ className="whatsapp-filters"
2871
+ >
2872
+ <CapSelectFilter
2873
+ data={
2874
+ Array [
2875
+ Object {
2876
+ "key": "awaitingApproval",
2877
+ "label": <FormattedMessage
2878
+ defaultMessage="Awaiting approval"
2879
+ id="creatives.containersV2.Whatsapp.awaitingApproval"
2880
+ values={Object {}}
2881
+ />,
2882
+ "value": "awaitingApproval",
2883
+ },
2884
+ Object {
2885
+ "key": "approved",
2886
+ "label": <FormattedMessage
2887
+ defaultMessage="Approved"
2888
+ id="creatives.containersV2.Whatsapp.approved"
2889
+ values={Object {}}
2890
+ />,
2891
+ "value": "approved",
2892
+ },
2893
+ Object {
2894
+ "key": "rejected",
2895
+ "label": <FormattedMessage
2896
+ defaultMessage="Rejected"
2897
+ id="creatives.containersV2.Whatsapp.rejected"
2898
+ values={Object {}}
2899
+ />,
2900
+ "value": "rejected",
2901
+ },
2902
+ ]
2903
+ }
2904
+ dropdownMaxHeight="320px"
2905
+ dropdownWidth="228px"
2906
+ onSelect={[Function]}
2907
+ placeholder="Status"
2908
+ placement="bottomLeft"
2909
+ selectedValue=""
2910
+ showBadge={true}
2911
+ width="90px"
2912
+ />
2913
+ <CapSelectFilter
2914
+ data={
2915
+ Array [
2916
+ Object {
2917
+ "key": "alertUpdate",
2918
+ "label": <FormattedMessage
2919
+ defaultMessage="Alert update"
2920
+ id="creatives.containersV2.Whatsapp.alertUpdate"
2921
+ values={Object {}}
2922
+ />,
2923
+ "tagColor": "#f2e7fe",
2924
+ "tagTextColor": "#a451ff",
2925
+ "tooltipLabel": <FormattedMessage
2926
+ defaultMessage="Send important updates or news to customers."
2927
+ id="creatives.containersV2.Whatsapp.alertUpdateTooltip"
2928
+ values={Object {}}
2929
+ />,
2930
+ "value": "ALERT_UPDATE",
2931
+ },
2932
+ Object {
2933
+ "key": "accountUpdate",
2934
+ "label": <FormattedMessage
2935
+ defaultMessage="Account update"
2936
+ id="creatives.containersV2.Whatsapp.accountUpdate"
2937
+ values={Object {}}
2938
+ />,
2939
+ "tagColor": "#ffe5d2",
2940
+ "tagTextColor": "#f87d23",
2941
+ "tooltipLabel": <FormattedMessage
2942
+ defaultMessage="Let customers know about updates or changes to their accounts."
2943
+ id="creatives.containersV2.Whatsapp.accountUpdateTooltip"
2944
+ values={Object {}}
2945
+ />,
2946
+ "value": "ACCOUNT_UPDATE",
2947
+ },
2948
+ Object {
2949
+ "key": "appointmentUpdate",
2950
+ "label": <FormattedMessage
2951
+ defaultMessage="Appointment update"
2952
+ id="creatives.containersV2.Whatsapp.appointmentUpdate"
2953
+ values={Object {}}
2954
+ />,
2955
+ "tagColor": "#ecf7ec",
2956
+ "tagTextColor": "#6bb56b",
2957
+ "tooltipLabel": <FormattedMessage
2958
+ defaultMessage="Send confirmations, reminders, or other updates to customers about their appointments."
2959
+ id="creatives.containersV2.Whatsapp.appointmentUpdateTooltip"
2960
+ values={Object {}}
2961
+ />,
2962
+ "value": "APPOINTMENT_UPDATE",
2963
+ },
2964
+ Object {
2965
+ "key": "paymentUpdate",
2966
+ "label": <FormattedMessage
2967
+ defaultMessage="Payment update"
2968
+ id="creatives.containersV2.Whatsapp.paymentUpdate"
2969
+ values={Object {}}
2970
+ />,
2971
+ "tagColor": "#ffe5d2",
2972
+ "tagTextColor": "#f87d23",
2973
+ "tooltipLabel": <FormattedMessage
2974
+ defaultMessage="Send a message to customers about their payment."
2975
+ id="creatives.containersV2.Whatsapp.paymentUpdateTooltip"
2976
+ values={Object {}}
2977
+ />,
2978
+ "value": "PAYMENT_UPDATE",
2979
+ },
2980
+ Object {
2981
+ "key": "reservationUpdate",
2982
+ "label": <FormattedMessage
2983
+ defaultMessage="Reservation update"
2984
+ id="creatives.containersV2.Whatsapp.reservationUpdate"
2985
+ values={Object {}}
2986
+ />,
2987
+ "tagColor": "#ffe5d2",
2988
+ "tagTextColor": "#f87d23",
2989
+ "tooltipLabel": <FormattedMessage
2990
+ defaultMessage="Send confirmations, reminders, or other updates to customers about their reservations."
2991
+ id="creatives.containersV2.Whatsapp.reservationUpdateTooltip"
2992
+ values={Object {}}
2993
+ />,
2994
+ "value": "RESERVATION_UPDATE",
2995
+ },
2996
+ ]
2997
+ }
2998
+ dropdownMaxHeight="320px"
2999
+ dropdownWidth="228px"
3000
+ onSelect={[Function]}
3001
+ overlayStyle={
3002
+ Object {
3003
+ "overflowY": "hidden",
3004
+ }
3005
+ }
3006
+ placeholder="Category"
3007
+ placement="bottomLeft"
3008
+ selectedValue=""
3009
+ showBadge={true}
3010
+ width="105px"
3011
+ />
3012
+ </div>
3013
+ <Component />
3014
+ <Component />
3015
+ <div
3016
+ style={
3017
+ Object {
3018
+ "alignItems": "center",
3019
+ "display": "flex",
3020
+ "justifyContent": "space-between",
3021
+ }
3022
+ }
3023
+ >
3024
+ <CapButton
3025
+ className="create-new-whatsapp margin-l-8 margin-b-12"
3026
+ disabled={false}
3027
+ isAddBtn={false}
3028
+ onClick={[Function]}
3029
+ type="primary"
3030
+ >
3031
+ Create new
3032
+ </CapButton>
3033
+ </div>
3034
+ </div>
3035
+ <CapRow
3036
+ align="middle"
3037
+ className="selected-whatsapp-filters"
3038
+ type="flex"
3039
+ />
3040
+ <CapSpin
3041
+ spinning={false}
3042
+ style={
3043
+ Object {
3044
+ "width": "100%",
3045
+ }
3046
+ }
3047
+ tip="Getting all templates..."
3048
+ >
3049
+ <div>
3050
+ <div
3051
+ className="pagination-container"
3052
+ >
3053
+ <CapCustomCardList
3054
+ cardList={
3055
+ Array [
3056
+ Object {
3057
+ "content": <React.Fragment>
3058
+ <React.Fragment>
3059
+ <CapLabel
3060
+ type="label9"
3061
+ >
3062
+ $'asdasd
2683
3063
  Click {{unsubscribe}} to unsubscribe'
2684
3064
  </CapLabel>
2685
3065
  </React.Fragment>
@@ -115,12 +115,18 @@ describe('Test Templates container', () => {
115
115
  expect(renderedComponent).toMatchSnapshot();
116
116
  });
117
117
 
118
- it('Test max templates exceeded', () => {
118
+ it('Test max templates not exceeded', () => {
119
119
  renderFunction(true);
120
120
  renderedComponent.setProps({TemplatesList: [{ ...TemplatesProp.templates[0], totalCount: 260 }]});
121
121
  expect(renderedComponent).toMatchSnapshot();
122
122
  });
123
123
 
124
+ it('Test max templates exceeded', () => {
125
+ renderFunction(true);
126
+ renderedComponent.setProps({TemplatesList: [{ ...TemplatesProp.templates[0], totalCount: 510 }]});
127
+ expect(renderedComponent).toMatchSnapshot();
128
+ });
129
+
124
130
  it('Test max templates warning', () => {
125
131
  renderFunction(true);
126
132
  renderedComponent.setProps({TemplatesList: [{ ...TemplatesProp.templates[0], totalCount: 248 }]});
@@ -1191,14 +1191,6 @@ export default {
1191
1191
  channel: 'RCS',
1192
1192
  validity: true,
1193
1193
  },
1194
- lineEditTemplateData: {
1195
- mode: 'edit',
1196
- _id: '629f7ecf134738019b2e332e',
1197
- modeType: '',
1198
- type: 'LINE',
1199
- channel: 'LINE',
1200
- validity: true,
1201
- },
1202
1194
  getWhatsappContentOutput: '1234567890\nClick {{unsubscribe}} to unsubscribe',
1203
1195
  getWhatsappStatusOutput: {
1204
1196
  key: 'approved',
@@ -1430,12 +1422,61 @@ export default {
1430
1422
  language: {
1431
1423
  localeLoading: false,
1432
1424
  },
1433
- linePreviewTemplateData: {
1425
+ linePreviewTemplateData1: {
1426
+ mode: 'preview',
1427
+ _id: '62a810e4d4715c768d6ee9cf',
1428
+ name: 'Demo Old Template 2(Multiple images)',
1429
+ type: 'LINE',
1430
+ versions: {
1431
+ $init: true,
1432
+ history: [],
1433
+ base: {
1434
+ content: {
1435
+ messages: [
1436
+ {
1437
+ altText: 'Demo Old Template 2(Multiple images)',
1438
+ template: {
1439
+ type: 'image_carousel',
1440
+ columns: [
1441
+ {
1442
+ action: {
1443
+ uri: 'https://www.demo.com',
1444
+ label: 'Demo Old 2',
1445
+ type: 'uri',
1446
+ },
1447
+ imageUrl:
1448
+ 'https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/f374edfe-1fd4-4b15-a6f7-74d5d86.jpeg',
1449
+ },
1450
+ {
1451
+ imageUrl: '',
1452
+ },
1453
+ ],
1454
+ },
1455
+ },
1456
+ ],
1457
+ to: '{{line_id}}',
1458
+ },
1459
+ },
1460
+ },
1461
+ isActive: true,
1462
+ orgId: 1604,
1463
+ createdBy: '15000449',
1464
+ updatedBy: '15000449',
1465
+ createdAt: '2022-06-14T04:39:00.665Z',
1466
+ updatedAt: '2022-06-14T04:39:00.665Z',
1467
+ definition: {
1468
+ mode: 'template',
1469
+ },
1470
+ totalCount: 1,
1471
+ updatedByName: 'Ashish Karan fd',
1472
+ },
1473
+ linePreviewTemplateData2: {
1434
1474
  mode: 'preview',
1435
1475
  _id: '629f7ecf134738019b2e332e',
1436
1476
  name: 'ggg1',
1437
1477
  type: 'LINE',
1438
1478
  versions: {
1479
+ $init: true,
1439
1480
  history: [],
1440
1481
  base: {
1441
1482
  content: {
@@ -1473,8 +1514,21 @@ export default {
1473
1514
  ],
1474
1515
  },
1475
1516
  },
1517
+ {
1518
+ type: 'bubble',
1519
+ hero: {},
1520
+ footer: {
1521
+ type: 'box',
1522
+ layout: 'vertical',
1523
+ spacing: 'xs',
1524
+ contents: [{}],
1525
+ },
1526
+ },
1527
+ {
1528
+ type: 'bubble',
1529
+ },
1476
1530
  ],
1477
- type: "carousel",
1531
+ type: 'carousel',
1478
1532
  },
1479
1533
  },
1480
1534
  ],
@@ -1487,7 +1541,10 @@ export default {
1487
1541
  updatedBy: '15000449',
1488
1542
  createdAt: '2022-06-07T16:37:35.447Z',
1489
1543
  updatedAt: '2022-06-07T16:42:02.243Z',
1490
- totalCount: 31,
1544
+ definition: {
1545
+ mode: 'template',
1546
+ },
1547
+ totalCount: 1,
1491
1548
  updatedByName: 'Ashish Karan fd',
1492
1549
  },
1493
1550
  };