@itilite/iui-user-management 1.4.80 → 1.4.81

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/dist/index.js CHANGED
@@ -2651,7 +2651,9 @@ var CardsManagement = function CardsManagement(_ref) {
2651
2651
  var _ref$paymentDetails = _ref.paymentDetails,
2652
2652
  paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
2653
2653
  _ref$paymentMethod = _ref.paymentMethod,
2654
- paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod;
2654
+ paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod,
2655
+ _ref$sendLog = _ref.sendLog,
2656
+ sendLog = _ref$sendLog === void 0 ? function () {} : _ref$sendLog;
2655
2657
  var dispatch = reactRedux.useDispatch();
2656
2658
  var _ref2 = paymentDetails || {},
2657
2659
  _ref2$pg = _ref2.pg,
@@ -2675,6 +2677,13 @@ var CardsManagement = function CardsManagement(_ref) {
2675
2677
  var handleMarkAsDefault = function handleMarkAsDefault() {
2676
2678
  console.log('Mark as default:', selectedCard);
2677
2679
  if (!pg || !selectedCard) return;
2680
+ sendLog({
2681
+ eventName: 'edit_card_clicked',
2682
+ customProperties: {
2683
+ action_type: 'Make default'
2684
+ },
2685
+ logImpression: true
2686
+ });
2678
2687
  dispatch(setDefaultPaymentCard({
2679
2688
  user_id: +pg.user_id,
2680
2689
  method_id: selectedCard.id,
@@ -2684,6 +2693,13 @@ var CardsManagement = function CardsManagement(_ref) {
2684
2693
  handleMenuClose();
2685
2694
  };
2686
2695
  var handleDeleteCard = function handleDeleteCard() {
2696
+ sendLog({
2697
+ eventName: 'edit_card_clicked',
2698
+ customProperties: {
2699
+ action_type: 'Delete'
2700
+ },
2701
+ logImpression: true
2702
+ });
2687
2703
  dispatch(deletePaymentCard({
2688
2704
  pmId: selectedCard.id,
2689
2705
  vendorId: pg.vendor_id
@@ -2854,7 +2870,11 @@ var CardsManagement = function CardsManagement(_ref) {
2854
2870
  }) : null), console.log('cards', cards, 'cardsCount', cardsCount, pg), (!cards || cardsCount < 10) && (pg === null || pg === void 0 ? void 0 : (_pg$gateway = pg.gateway) === null || _pg$gateway === void 0 ? void 0 : _pg$gateway.toLowerCase()) === 'stripe' && (pg === null || pg === void 0 ? void 0 : pg.save_card_enable) === 1 && paymentMethod === 1 && /*#__PURE__*/React__default.createElement("button", {
2855
2871
  className: classes.addCardButton,
2856
2872
  onClick: function onClick() {
2857
- return window.location.assign(_url);
2873
+ sendLog({
2874
+ eventName: 'add_user_card_clicked',
2875
+ logImpression: true
2876
+ });
2877
+ window.location.assign(_url);
2858
2878
  }
2859
2879
  }, /*#__PURE__*/React__default.createElement("span", {
2860
2880
  className: classes.plusIcon
@@ -2911,7 +2931,9 @@ var PaymentCards = function PaymentCards(_ref) {
2911
2931
  var _ref$paymentDetails = _ref.paymentDetails,
2912
2932
  paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
2913
2933
  _ref$paymentMethod = _ref.paymentMethod,
2914
- paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod;
2934
+ paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod,
2935
+ _ref$sendLog = _ref.sendLog,
2936
+ sendLog = _ref$sendLog === void 0 ? function () {} : _ref$sendLog;
2915
2937
  if (!paymentDetails || ((_Object$keys = Object.keys(paymentDetails)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) === 0 || (!(paymentDetails !== null && paymentDetails !== void 0 && paymentDetails.cards) || (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$cards = paymentDetails.cards) === null || _paymentDetails$cards === void 0 ? void 0 : _paymentDetails$cards.length) === 0) && ((paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$pg = paymentDetails.pg) === null || _paymentDetails$pg === void 0 ? void 0 : _paymentDetails$pg.gateway.toLowerCase()) !== 'stripe' || (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$pg2 = paymentDetails.pg) === null || _paymentDetails$pg2 === void 0 ? void 0 : _paymentDetails$pg2.save_card_enable) !== 1 || paymentMethod !== 1)) {
2916
2938
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
2917
2939
  }
@@ -2919,7 +2941,8 @@ var PaymentCards = function PaymentCards(_ref) {
2919
2941
  className: styles$1.dividerColor
2920
2942
  }), /*#__PURE__*/React__default.createElement(CardsManagement, {
2921
2943
  paymentDetails: paymentDetails,
2922
- paymentMethod: paymentMethod
2944
+ paymentMethod: paymentMethod,
2945
+ sendLog: sendLog
2923
2946
  }));
2924
2947
  };
2925
2948
 
@@ -2995,7 +3018,9 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
2995
3018
  _props$roles = props.roles,
2996
3019
  roles = _props$roles === void 0 ? [] : _props$roles,
2997
3020
  _props$paymentMethod = props.paymentMethod,
2998
- paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod;
3021
+ paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod,
3022
+ _props$sendLog = props.sendLog,
3023
+ sendLog = _props$sendLog === void 0 ? function () {} : _props$sendLog;
2999
3024
  var _useState = React.useState({
3000
3025
  product: '',
3001
3026
  approvers: []
@@ -3293,7 +3318,8 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
3293
3318
  }));
3294
3319
  })))), type === 'travel' && paymentDetails && isProfile && /*#__PURE__*/React__default.createElement(PaymentCards, {
3295
3320
  paymentDetails: paymentDetails,
3296
- paymentMethod: paymentMethod
3321
+ paymentMethod: paymentMethod,
3322
+ sendLog: sendLog
3297
3323
  }));
3298
3324
  };
3299
3325
 
@@ -6427,7 +6453,9 @@ var UserAddEdit = function UserAddEdit(props) {
6427
6453
  _props$isProfile = props.isProfile,
6428
6454
  isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
6429
6455
  _props$paymentMethod = props.paymentMethod,
6430
- paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod;
6456
+ paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod,
6457
+ _props$sendLog = props.sendLog,
6458
+ sendLog = _props$sendLog === void 0 ? function () {} : _props$sendLog;
6431
6459
  env$4.init(config, isProfile);
6432
6460
  var queryParams = new URLSearchParams(window.location.search);
6433
6461
  var verifyUserId = Number(queryParams.get(config.routes.users.add.queryParamKeys.verifyUserId));
@@ -8327,7 +8355,8 @@ var UserAddEdit = function UserAddEdit(props) {
8327
8355
  isProfile: isProfile,
8328
8356
  editUserId: editUserId,
8329
8357
  roles: renderFields.travelRoles,
8330
- paymentMethod: paymentMethod
8358
+ paymentMethod: paymentMethod,
8359
+ sendLog: sendLog
8331
8360
  }), /*#__PURE__*/React__default.createElement(AdditionalInfo, {
8332
8361
  membershipInfoInput: membershipInfoInput,
8333
8362
  onMemInfoInputChange: onMemInfoInputChange,
@@ -8372,7 +8401,8 @@ var UserAddEdit = function UserAddEdit(props) {
8372
8401
  isProfile: isProfile,
8373
8402
  editUserId: editUserId,
8374
8403
  roles: renderFields.expenseRoles,
8375
- paymentMethod: paymentMethod
8404
+ paymentMethod: paymentMethod,
8405
+ sendLog: sendLog
8376
8406
  }), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
8377
8407
  className: styles.dividerColor
8378
8408
  }), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React__default.createElement(CardsField, {