@itilite/iui-user-management 1.4.80 → 1.4.81-flexi-amplitude-test-2

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,
@@ -2673,8 +2675,18 @@ var CardsManagement = function CardsManagement(_ref) {
2673
2675
  setSelectedCard(null);
2674
2676
  };
2675
2677
  var handleMarkAsDefault = function handleMarkAsDefault() {
2678
+ var _selectedCard$card;
2676
2679
  console.log('Mark as default:', selectedCard);
2677
2680
  if (!pg || !selectedCard) return;
2681
+ console.log('default card:', selectedCard);
2682
+ sendLog({
2683
+ eventName: 'edit_card_clicked',
2684
+ customProperties: {
2685
+ action_type: 'Make default',
2686
+ card_last4: (selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$card = selectedCard.card) === null || _selectedCard$card === void 0 ? void 0 : _selectedCard$card.last4) || ''
2687
+ },
2688
+ logImpression: true
2689
+ });
2678
2690
  dispatch(setDefaultPaymentCard({
2679
2691
  user_id: +pg.user_id,
2680
2692
  method_id: selectedCard.id,
@@ -2684,13 +2696,22 @@ var CardsManagement = function CardsManagement(_ref) {
2684
2696
  handleMenuClose();
2685
2697
  };
2686
2698
  var handleDeleteCard = function handleDeleteCard() {
2699
+ var _selectedCard$card2;
2700
+ console.log('Delete card:', selectedCard);
2701
+ sendLog({
2702
+ eventName: 'edit_card_clicked',
2703
+ customProperties: {
2704
+ action_type: 'Delete',
2705
+ card_last4: (selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$card2 = selectedCard.card) === null || _selectedCard$card2 === void 0 ? void 0 : _selectedCard$card2.last4) || ''
2706
+ },
2707
+ logImpression: true
2708
+ });
2687
2709
  dispatch(deletePaymentCard({
2688
2710
  pmId: selectedCard.id,
2689
2711
  vendorId: pg.vendor_id
2690
2712
  }));
2691
2713
  handleMenuClose();
2692
2714
  };
2693
- console.log('test mudu 22');
2694
2715
  var getBrandLogo = function getBrandLogo(brand) {
2695
2716
  var width = 40;
2696
2717
  var aspectRatio = 780 / 500;
@@ -2854,7 +2875,11 @@ var CardsManagement = function CardsManagement(_ref) {
2854
2875
  }) : 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
2876
  className: classes.addCardButton,
2856
2877
  onClick: function onClick() {
2857
- return window.location.assign(_url);
2878
+ sendLog({
2879
+ eventName: 'add_user_card_clicked',
2880
+ logImpression: true
2881
+ });
2882
+ window.location.assign(_url);
2858
2883
  }
2859
2884
  }, /*#__PURE__*/React__default.createElement("span", {
2860
2885
  className: classes.plusIcon
@@ -2911,7 +2936,9 @@ var PaymentCards = function PaymentCards(_ref) {
2911
2936
  var _ref$paymentDetails = _ref.paymentDetails,
2912
2937
  paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
2913
2938
  _ref$paymentMethod = _ref.paymentMethod,
2914
- paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod;
2939
+ paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod,
2940
+ _ref$sendLog = _ref.sendLog,
2941
+ sendLog = _ref$sendLog === void 0 ? function () {} : _ref$sendLog;
2915
2942
  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
2943
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
2917
2944
  }
@@ -2919,7 +2946,8 @@ var PaymentCards = function PaymentCards(_ref) {
2919
2946
  className: styles$1.dividerColor
2920
2947
  }), /*#__PURE__*/React__default.createElement(CardsManagement, {
2921
2948
  paymentDetails: paymentDetails,
2922
- paymentMethod: paymentMethod
2949
+ paymentMethod: paymentMethod,
2950
+ sendLog: sendLog
2923
2951
  }));
2924
2952
  };
2925
2953
 
@@ -2995,7 +3023,9 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
2995
3023
  _props$roles = props.roles,
2996
3024
  roles = _props$roles === void 0 ? [] : _props$roles,
2997
3025
  _props$paymentMethod = props.paymentMethod,
2998
- paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod;
3026
+ paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod,
3027
+ _props$sendLog = props.sendLog,
3028
+ sendLog = _props$sendLog === void 0 ? function () {} : _props$sendLog;
2999
3029
  var _useState = React.useState({
3000
3030
  product: '',
3001
3031
  approvers: []
@@ -3293,7 +3323,8 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
3293
3323
  }));
3294
3324
  })))), type === 'travel' && paymentDetails && isProfile && /*#__PURE__*/React__default.createElement(PaymentCards, {
3295
3325
  paymentDetails: paymentDetails,
3296
- paymentMethod: paymentMethod
3326
+ paymentMethod: paymentMethod,
3327
+ sendLog: sendLog
3297
3328
  }));
3298
3329
  };
3299
3330
 
@@ -6427,7 +6458,9 @@ var UserAddEdit = function UserAddEdit(props) {
6427
6458
  _props$isProfile = props.isProfile,
6428
6459
  isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
6429
6460
  _props$paymentMethod = props.paymentMethod,
6430
- paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod;
6461
+ paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod,
6462
+ _props$sendLog = props.sendLog,
6463
+ sendLog = _props$sendLog === void 0 ? function () {} : _props$sendLog;
6431
6464
  env$4.init(config, isProfile);
6432
6465
  var queryParams = new URLSearchParams(window.location.search);
6433
6466
  var verifyUserId = Number(queryParams.get(config.routes.users.add.queryParamKeys.verifyUserId));
@@ -8327,7 +8360,8 @@ var UserAddEdit = function UserAddEdit(props) {
8327
8360
  isProfile: isProfile,
8328
8361
  editUserId: editUserId,
8329
8362
  roles: renderFields.travelRoles,
8330
- paymentMethod: paymentMethod
8363
+ paymentMethod: paymentMethod,
8364
+ sendLog: sendLog
8331
8365
  }), /*#__PURE__*/React__default.createElement(AdditionalInfo, {
8332
8366
  membershipInfoInput: membershipInfoInput,
8333
8367
  onMemInfoInputChange: onMemInfoInputChange,
@@ -8372,7 +8406,8 @@ var UserAddEdit = function UserAddEdit(props) {
8372
8406
  isProfile: isProfile,
8373
8407
  editUserId: editUserId,
8374
8408
  roles: renderFields.expenseRoles,
8375
- paymentMethod: paymentMethod
8409
+ paymentMethod: paymentMethod,
8410
+ sendLog: sendLog
8376
8411
  }), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
8377
8412
  className: styles.dividerColor
8378
8413
  }), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React__default.createElement(CardsField, {