@capillarytech/creatives-library 7.12.35 → 7.12.36

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
@@ -17,6 +17,7 @@ const config = {
17
17
  },
18
18
  development: {
19
19
  api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
20
+ //api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
20
21
  campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
21
22
  campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
22
23
  auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.12.35",
4
+ "version": "7.12.36",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -13,6 +13,7 @@ import CapInput from '@capillarytech/cap-ui-library/CapInput';
13
13
  import CapButton from '@capillarytech/cap-ui-library/CapButton';
14
14
  import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
15
15
  import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
16
+ import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
16
17
  import globalMessages from '../../v2Containers/Cap/messages';
17
18
  import whatsappMsg from '../../v2Containers/Whatsapp/messages';
18
19
  import messages from './messages';
@@ -274,13 +275,24 @@ export const CapWhatsappCTA = (props) => {
274
275
  </CapRow>
275
276
  )}
276
277
  <CapRow className="whatsapp-cta-save-delete-btn">
277
- <CapButton
278
- onClick={() => saveCta(index)}
279
- disabled={ctaSaveDisabled(index)}
280
- className="whatsapp-cta-save-btn"
278
+ <CapTooltip
279
+ title={
280
+ ctaSaveDisabled(index)
281
+ ? formatMessage(messages.ctaSaveDisabled)
282
+ : ''
283
+ }
284
+ placement={'bottom'}
281
285
  >
282
- {formatMessage(globalMessages.save)}
283
- </CapButton>
286
+ <div className="button-disabled-tooltip-wrapper">
287
+ <CapButton
288
+ onClick={() => saveCta(index)}
289
+ disabled={ctaSaveDisabled(index)}
290
+ className="whatsapp-cta-save-btn"
291
+ >
292
+ {formatMessage(globalMessages.save)}
293
+ </CapButton>
294
+ </div>
295
+ </CapTooltip>
284
296
  <CapButton
285
297
  onClick={() => deleteHandler(index)}
286
298
  className="whatsapp-cta-delete-btn"
@@ -299,16 +311,27 @@ export const CapWhatsappCTA = (props) => {
299
311
  ctaData.length < 2 &&
300
312
  renderArray.push(
301
313
  <CapRow>
302
- <CapButton
303
- type="flat"
304
- id="whatsapp-cta-add-button"
305
- disabled={ctaData?.length === 1 && !ctaData[0].isSaved}
306
- className="margin-t-12 margin-l-24"
307
- isAddBtn
308
- onClick={addCta}
314
+ <CapTooltip
315
+ title={
316
+ ctaData.length === 1 && !ctaData[0].isSaved
317
+ ? formatMessage(messages.ctaAddDisabled)
318
+ : ''
319
+ }
320
+ placement={'right'}
309
321
  >
310
- {formatMessage(messages.addButton)}
311
- </CapButton>
322
+ <div className="button-disabled-tooltip-wrapper">
323
+ <CapButton
324
+ type="flat"
325
+ id="whatsapp-cta-add-button"
326
+ disabled={ctaData.length === 1 && !ctaData[0].isSaved}
327
+ className="margin-t-12 margin-l-24"
328
+ isAddBtn
329
+ onClick={addCta}
330
+ >
331
+ {formatMessage(messages.addButton)}
332
+ </CapButton>
333
+ </div>
334
+ </CapTooltip>
312
335
  </CapRow>,
313
336
  );
314
337
  }
@@ -53,4 +53,13 @@ export default defineMessages({
53
53
  id: `${prefix}.addButton`,
54
54
  defaultMessage: 'Add button',
55
55
  },
56
+ ctaSaveDisabled: {
57
+ id: `${prefix}.ctaSaveDisabled`,
58
+ defaultMessage: 'Please complete the above fields to enable button',
59
+ },
60
+ ctaAddDisabled: {
61
+ id: `${prefix}.ctaAddDisabled`,
62
+ defaultMessage:
63
+ 'Please save the first button before proceeding to create second button',
64
+ },
56
65
  });