@capillarytech/creatives-library 8.0.65 → 8.0.67

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.
@@ -29,6 +29,7 @@ import CapAskAira from '@capillarytech/cap-ui-library/CapAskAira';
29
29
  import moment from 'moment';
30
30
 
31
31
  import {
32
+ CAP_SPACE_04,
32
33
  CAP_SPACE_16,
33
34
  CAP_SPACE_24,
34
35
  CAP_SPACE_32,
@@ -64,6 +65,7 @@ import {
64
65
  ALLOWED_IMAGE_EXTENSIONS_REGEX,
65
66
  WHATSAPP_IMG_SIZE,
66
67
  HOST_TWILIO,
68
+ HOST_KARIX,
67
69
  HOST_GUPSHUP,
68
70
  ALLOWED_EXTENSIONS_VIDEO_REGEX,
69
71
  ALLOWED_EXTENSIONS_DOCUMENT_REGEX,
@@ -79,10 +81,7 @@ import {
79
81
  BUTTON_TEXT,
80
82
  OTP_CONFIG_URI,
81
83
  WHATSAPP_CATEGORIES,
82
- AI_CONTENT_BOT_DISABLED,
83
- ICS_CATEGORY_OPTIONS,
84
- CORRECT_TEMPLATE_FORMAT_URL,
85
- CATEGORY_OPTIONS_MAP,
84
+ AI_CONTENT_BOT_DISABLED
86
85
  } from './constants';
87
86
  import { DATE_DISPLAY_FORMAT, TIME_DISPLAY_FORMAT } from '../App/constants';
88
87
  import messages from './messages';
@@ -673,11 +672,6 @@ export const Whatsapp = (props) => {
673
672
  label: renderTemplateCategoryLabel(option.tooltipLabel, option.label),
674
673
  }));
675
674
 
676
- const icsCategoryOptions = ICS_CATEGORY_OPTIONS.map((option) => ({
677
- value: option.value,
678
- label: renderTemplateCategoryLabel(option.tooltipLabel, option.label),
679
- }));
680
-
681
675
  const mediaRadioOptions = [
682
676
  {
683
677
  value: WHATSAPP_MEDIA_TYPES.TEXT,
@@ -1132,10 +1126,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1132
1126
  setTemplateCategory(value);
1133
1127
  };
1134
1128
 
1135
- const getCategoryOptions = (host) => {
1136
- return CATEGORY_OPTIONS_MAP[host] || [];
1137
- }
1138
-
1139
1129
  const onTemplateLanguageChange = (value) => {
1140
1130
  setTemplateLanguage(value);
1141
1131
  };
@@ -1544,7 +1534,11 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1544
1534
  {renderLabel("templateCategoryLabel")}
1545
1535
  <CapSelect
1546
1536
  id="select-whatsapp-category"
1547
- options={getCategoryOptions(host)}
1537
+ options={
1538
+ host === HOST_TWILIO
1539
+ ? twilioCategoryOptions
1540
+ : karixGupshupCategoryOptions
1541
+ }
1548
1542
  onChange={onTemplateCategoryChange}
1549
1543
  value={templateCategory}
1550
1544
  />
@@ -1821,7 +1815,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1821
1815
  };
1822
1816
 
1823
1817
  const onClickIncorrectFormat = () => {
1824
- window.open(CORRECT_TEMPLATE_FORMAT_URL, "_blank");
1818
+ window.open('https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines', "_blank");
1825
1819
  };
1826
1820
 
1827
1821
  const getTemplateStatusType = () => {
@@ -1846,58 +1840,27 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1846
1840
  case WHATSAPP_STATUSES.rejected:
1847
1841
  return (
1848
1842
  <>
1849
- <CapLabel type="label2" className='template-status-font'>
1843
+ <CapLabel type="label2" style={{ fontWeight: 500 }}>
1850
1844
  {formatMessage(messages.rejectedStatusMsg)}
1851
1845
  </CapLabel>
1852
1846
  <CapLabel
1853
1847
  type="label2"
1854
- className='template-status-margin'
1855
- >
1856
- {computeTemplateRejectionReason()}
1857
- </CapLabel>
1858
- </>
1859
- );
1860
- case WHATSAPP_STATUSES.paused:
1861
- return (
1862
- <>
1863
- <CapLabel type="label2" className='template-status-font'>
1864
- {formatMessage(messages.pausedStatusMsg)}
1865
- </CapLabel>
1866
- <CapLabel
1867
- type="label2"
1868
- className='template-status-margin'
1848
+ style={{ margin: `${CAP_SPACE_04} 0 ${CAP_SPACE_04}` }}
1869
1849
  >
1870
1850
  {computeTemplateRejectionReason()}
1871
1851
  </CapLabel>
1872
1852
  </>
1873
1853
  );
1874
- case WHATSAPP_STATUSES.pending:
1875
- return (
1876
- <>
1877
- <CapLabel type="label2" className='template-status-font'>
1878
- {formatMessage(messages.pendingStatusMsg)}
1879
- </CapLabel>
1880
- <CapLabel
1881
- type="label2"
1882
- className='template-status-margin'
1883
- >
1884
- {formatMessage(messages.pendingStatusDesc, {
1885
- date: moment(templateDate).format(DATE_DISPLAY_FORMAT),
1886
- time: moment(templateDate).format(TIME_DISPLAY_FORMAT),
1887
- })}
1888
- </CapLabel>
1889
- </>
1890
- );
1891
1854
  default:
1892
1855
  //all cases except approved and rejected, return awaiting approval
1893
1856
  return (
1894
1857
  <>
1895
- <CapLabel type="label2" className='template-status-font'>
1858
+ <CapLabel type="label2" style={{ fontWeight: 500 }}>
1896
1859
  {formatMessage(messages.awaitingStatusMsg)}
1897
1860
  </CapLabel>
1898
1861
  <CapLabel
1899
1862
  type="label2"
1900
- className='template-status-margin'
1863
+ style={{ margin: `${CAP_SPACE_04} 0 ${CAP_SPACE_04}` }}
1901
1864
  >
1902
1865
  {formatMessage(messages.awaitingStatusDesc, {
1903
1866
  date: moment(templateDate).format(DATE_DISPLAY_FORMAT),
@@ -247,12 +247,4 @@
247
247
  }
248
248
  .whatsapp-tooltip-header{
249
249
  color: $CAP_G10;
250
- }
251
-
252
- .template-status-font{
253
- font-weight: 500;
254
- }
255
-
256
- .template-status-margin{
257
- margin: $CAP_SPACE_04 0 $CAP_SPACE_04;
258
250
  }
@@ -251,10 +251,6 @@ export default defineMessages({
251
251
  id: `${prefix}.rejectedStatusMsg`,
252
252
  defaultMessage: 'This template has been rejected',
253
253
  },
254
- pausedStatusMsg: {
255
- id: `${prefix}.pausedStatusMsg`,
256
- defaultMessage: 'This template has been paused',
257
- },
258
254
  tagContentMismatchError: {
259
255
  id: `${prefix}.tagContentMismatchError`,
260
256
  defaultMessage:
@@ -274,15 +270,6 @@ export default defineMessages({
274
270
  id: `${prefix}.awaitingStatusMsg`,
275
271
  defaultMessage: 'This template is awaiting approval',
276
272
  },
277
- pendingStatusMsg: {
278
- id: `${prefix}.pendingStatusMsg`,
279
- defaultMessage: 'This template has been pending for approval',
280
- },
281
- pendingStatusDesc: {
282
- id: `${prefix}.pendingStatusDesc`,
283
- defaultMessage:
284
- 'The template has been sent for approval at {date}, {time}. It takes up to 48 hrs to get approved.',
285
- },
286
273
  here: {
287
274
  id: `${prefix}.here`,
288
275
  defaultMessage: 'here',
@@ -729,12 +716,4 @@ export default defineMessages({
729
716
  id: `${prefix}.checkExpiryTooltipDesc`,
730
717
  defaultMessage: 'To check the configured expiry time that is same for all OTPs',
731
718
  },
732
- pending: {
733
- id: `${prefix}.pending`,
734
- defaultMessage: 'Pending',
735
- },
736
- paused: {
737
- id: `${prefix}.paused`,
738
- defaultMessage: 'Paused',
739
- },
740
719
  });