@capillarytech/creatives-library 8.0.218 → 8.0.220

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/config/app.js CHANGED
@@ -21,6 +21,7 @@ const config = {
21
21
  },
22
22
  development: {
23
23
  api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
24
+ // api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
24
25
  campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
25
26
  campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
26
27
  auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
@@ -187,3 +187,5 @@ export const LOGOUT_FAILURE = 'cap/LOGOUT_FAILURE';
187
187
  export const JAPANESE_HELP_TEXT = 'ヘルプ :トークンの定義';
188
188
 
189
189
  export const TAG_TRANSLATION_DOC = 'https://docs.capillarytech.com/docs/tags-translation';
190
+
191
+ export const CAPILLARY_LOADING_LOGO = 'https://storage.crm.n.content-cdn.io/capillary/capillary_loading_logo.gif';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.218",
4
+ "version": "8.0.220",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -264,6 +264,7 @@ export const getUserData = () => {
264
264
 
265
265
  export const createTemplate = ({template}) => {
266
266
  const url = `${API_ENDPOINT}/templates/SMS`;
267
+ console.log("creating template",template);
267
268
  return request(url, getAPICallObject('POST', template));
268
269
  };
269
270
 
@@ -346,6 +347,7 @@ export const getAllTemplates = async ({channel, queryParams = {}}) => {
346
347
 
347
348
  export const deleteTemplate = ({channel, id}) => {
348
349
  const url = `${API_ENDPOINT}/templates/${id}/${channel}`;
350
+ console.log("deleting template", url);
349
351
  return request(url, getAPICallObject('DELETE'));
350
352
  //return API.deleteResource(url);
351
353
  };
@@ -54,6 +54,7 @@ import { v2ViberSagas } from '../Viber/sagas';
54
54
  import { v2FacebookSagas } from '../Facebook/sagas';
55
55
  import createReducer from '../Line/Container/reducer';
56
56
  import { DAEMON } from '@capillarytech/vulcan-react-sdk/utils/sagaInjectorTypes';
57
+ import {CAPILLARY_LOADING_LOGO} from '../../constants/unified';
57
58
  const gtm = window.dataLayer || [];
58
59
  const {
59
60
  logNewTab,
@@ -510,8 +511,12 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
510
511
  <div className="cap-loader-box">
511
512
  <img
512
513
  className="loader-image"
513
- src="https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/88561f46de9407021cad.gif"
514
- alt="Capillary"/>
514
+ src={CAPILLARY_LOADING_LOGO}
515
+ alt="Capillary"
516
+ loading="lazy"
517
+ data-testid="capillary-logo"
518
+ aria-label="Capillary loading logo"
519
+ />
515
520
  </div> : <>
516
521
  <Helmet
517
522
  titleTemplate="Capillary - %s"
@@ -577,6 +577,7 @@ export class Creatives extends React.Component {
577
577
  varMapped,
578
578
  category,
579
579
  language,
580
+ templateId,
580
581
  buttonType = 'NONE',
581
582
  buttons = [],
582
583
  mediaType = 'TEXT',
@@ -635,6 +636,7 @@ export class Creatives extends React.Component {
635
636
  category,
636
637
  varMapped,
637
638
  mediaType,
639
+ templateId,
638
640
  ...mediaParams,
639
641
  buttonType,
640
642
  buttons: modifiedButtons,
@@ -943,6 +945,7 @@ export class Creatives extends React.Component {
943
945
  buttonType = 'NONE',
944
946
  buttons = [],
945
947
  imageUrl = '',
948
+ templateId = '',
946
949
  videoUrl = '',
947
950
  documentUrl = '',
948
951
  videoPreviewImg = '',
@@ -1019,6 +1022,7 @@ export class Creatives extends React.Component {
1019
1022
  name: template?.value?.name,
1020
1023
  template: templateEditor,
1021
1024
  varMapped,
1025
+ templateId,
1022
1026
  category,
1023
1027
  language: languages[0].language,
1024
1028
  ...(mediaType !== WHATSAPP_MEDIA_TYPES.CAROUSEL && {
@@ -1186,6 +1186,7 @@ exports[`Test SlideBoxContent container Should render correct component for what
1186
1186
  ],
1187
1187
  "templateFooterPreview": "",
1188
1188
  "templateHeaderPreview": "",
1189
+ "templateId": "720951875646523",
1189
1190
  "templateMsg": <CapLabel
1190
1191
  type="label5"
1191
1192
  >
@@ -14,6 +14,7 @@ import LoginForm from './components/LoginForm';
14
14
  import * as actions from '../Cap/actions';
15
15
  import { UserIsNotAuthenticated } from '../../utils/authWrapper';
16
16
  const logo = require('./assets/images/capillary_logo.png');
17
+ import {CAPILLARY_LOADING_LOGO} from '../../constants/unified';
17
18
 
18
19
  export class Login extends React.Component { // eslint-disable-line react/prefer-stateless-function
19
20
  constructor(props) {
@@ -65,8 +66,12 @@ export class Login extends React.Component { // eslint-disable-line react/prefer
65
66
  ? <div className="cap-loader-box">
66
67
  <img
67
68
  className="loader-image"
68
- src={"https://storage.crm.n.content-cdn.io/capillary/capillary_loading_logo.gif"}
69
- alt="Capillary"/>
69
+ src={CAPILLARY_LOADING_LOGO}
70
+ alt="Capillary"
71
+ loading="lazy"
72
+ data-testid="capillary-logo"
73
+ aria-label="Capillary loading logo"
74
+ />
70
75
  </div>
71
76
  : <Col className="login-box" style={{textAlign: 'center'}}>
72
77
  <h2 className="ui image header">
@@ -368,7 +368,7 @@ export const HOST_ICS = 'icswababulk';
368
368
  export const HOST_HAPTIC = 'hapticwhatsappbulk';
369
369
  export const HOST_VALUE_FIRST = 'valuefirstwhatsappbulk';
370
370
 
371
- export const CAROUSEL_SUPPORTING_HOSTS = [HOST_GUPSHUP, HOST_VALUE_FIRST, HOST_KARIX, HOST_HAPTIC];
371
+ export const CAROUSEL_SUPPORTING_HOSTS = [HOST_GUPSHUP, HOST_KARIX, HOST_HAPTIC];
372
372
 
373
373
  export const SIZE_UNITS = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
374
374
  export const DOCUMENT_FORMAT = 'PDF';
@@ -226,6 +226,7 @@ export const Whatsapp = (props) => {
226
226
  const [isEditFlow, setEditFlow] = useState(false);
227
227
  const [templateDate, setTemplateDate] = useState('');
228
228
  const [templateStatus, setTemplateStatus] = useState();
229
+ const [templateId, setTemplateId] = useState('');
229
230
  const [templateRejectionReason, setTemplateRejectionReason] = useState(null);
230
231
  const [tempMsgArray, updateTempMsgArray] = useState([]);
231
232
  const [updatedSmsEditor, setUpdatedSmsEditor] = useState([]);
@@ -270,6 +271,7 @@ export const Whatsapp = (props) => {
270
271
  const isMediaTypeCarousel = templateMediaType === WHATSAPP_MEDIA_TYPES.CAROUSEL;
271
272
  const isHostIsNotTwilio = host !== HOST_TWILIO;
272
273
  const isHaptic = host === HOST_HAPTIC;
274
+ const isValueFirst = host === HOST_VALUE_FIRST;
273
275
  const WhatsappFooter = styled.div`
274
276
  background-color: ${CAP_WHITE};
275
277
  position: fixed;
@@ -340,6 +342,7 @@ export const Whatsapp = (props) => {
340
342
  const {
341
343
  category = '',
342
344
  status = WHATSAPP_STATUSES.unsubmitted,
345
+ templateId = '',
343
346
  rejection_reason = null,
344
347
  languages = [],
345
348
  mediaType = WHATSAPP_MEDIA_TYPES.TEXT,
@@ -358,6 +361,7 @@ export const Whatsapp = (props) => {
358
361
  } = editContent;
359
362
  setTemplateCategory(category);
360
363
  setTemplateStatus(status);
364
+ setTemplateId(templateId);
361
365
  setTemplateRejectionReason(rejection_reason);
362
366
  setTemplateLanguage(languages[0]?.language);
363
367
  setTemplateMediaType(mediaType);
@@ -1661,6 +1665,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1661
1665
  mediaType: templateMediaType,
1662
1666
  ...mediaParams,
1663
1667
  varMapped: !isFullMode ? varMap : {},
1668
+ ...(isValueFirst && { templateId }),
1664
1669
  templateEditor: !isFullMode && tempMsgArray.join(""),
1665
1670
  ...(isHaptic
1666
1671
  ? {