@itilite/iui-user-management 1.4.781 → 1.4.891
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.css +43 -6
- package/dist/index.js +138 -36
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +139 -37
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIGrid, IUIDivider, IUITypography, IUIRadio, IUIButton, IUIModal, IUISearch, IUICircularProgress, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUICard, IUIBackdrop, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIIconButton, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup,
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIGrid, IUIDivider, IUITypography, IUIRadio, IUIButton, IUIModal, IUISearch, IUICircularProgress, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUICard, IUIBackdrop, IUIBreadCrumb, IUIDropdownButton, IUIDropzone, IUIStepper, IUIIconButton, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUITabs } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, Fragment as Fragment$1, useEffect, memo, useRef } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -182,19 +182,9 @@ function _finallyRethrows(body, finalizer) {
|
|
|
182
182
|
return finalizer(false, result);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
var styles = {"UUIUserManagementAddEdit":"_3n-WG","pageHeader":"_3qWcA","buttonWrapper":"_1IP9P","scrolled":"_m8f96","headingButtonWrapper":"_w9z7b","headingButtonWrapperProfile":"_12Wd9","hintText":"_ySdbZ","heading":"_2Y1Aw","headingLarge":"_2K1NF","headingMedium":"_RUuAz","headingSmall":"_23Dye","additionalInfoContainer":"_1Suhw","additionalInfoTitle":"_56iJF","titleContainer":"_H5nfl","expandIconAlign":"_3F4i0","detailsContainer":"_2G0LW","formWrapper":"_2fPRc","sectionWrapper":"_37Gqp","margin":"_2Sdl7","minGridWidth":"_2D7iu","firstRowMargin":"_1BozG","firstChildMargin":"_2C3Mb","paddingTop":"_DBPjV","backGrdColorOnHover":"_5oE6H","fieldMargin":"_RCWjq","productContainerGap":"_tuCbi","containerWidth":"_1oWos","productItemBroder":"_T0Hcd","headingPadding":"_2MFfQ","emptyFieldContainer":"_3VWtw","emptyFieldDescription":"_2jC5u","rowGap":"_1NJFY","formTitle":"_GAKk2","formDescription":"_3TZ6Z","themeLink":"_eJ_1B","dashedLine":"_3ZOs1","dividerColor":"_2pxEJ","errorTextCls":"_27eth","backdrop":"_Pm0Au","inputWidth":"_ajB82"};
|
|
185
|
+
var styles = {"UUIUserManagementAddEdit":"_3n-WG","pageHeader":"_3qWcA","buttonWrapper":"_1IP9P","scrolled":"_m8f96","headingButtonWrapper":"_w9z7b","headingButtonWrapperProfile":"_12Wd9","hintText":"_ySdbZ","heading":"_2Y1Aw","headingLarge":"_2K1NF","headingMedium":"_RUuAz","headingSmall":"_23Dye","additionalInfoContainer":"_1Suhw","additionalInfoTitle":"_56iJF","titleContainer":"_H5nfl","expandIconAlign":"_3F4i0","detailsContainer":"_2G0LW","formWrapper":"_2fPRc","sectionWrapper":"_37Gqp","margin":"_2Sdl7","minGridWidth":"_2D7iu","firstRowMargin":"_1BozG","firstChildMargin":"_2C3Mb","paddingTop":"_DBPjV","backGrdColorOnHover":"_5oE6H","fieldMargin":"_RCWjq","productContainerGap":"_tuCbi","containerWidth":"_1oWos","productItemBroder":"_T0Hcd","headingPadding":"_2MFfQ","emptyFieldContainer":"_3VWtw","emptyFieldDescription":"_2jC5u","rowGap":"_1NJFY","formTitle":"_GAKk2","formDescription":"_3TZ6Z","themeLink":"_eJ_1B","dashedLine":"_3ZOs1","dividerColor":"_2pxEJ","errorTextCls":"_27eth","backdrop":"_Pm0Au","inputWidth":"_ajB82","buttonRight":"_1lEyQ","containedDropdownBtn":"_3ymE1"};
|
|
186
186
|
|
|
187
|
-
function r(e) {
|
|
188
|
-
var t,
|
|
189
|
-
f,
|
|
190
|
-
n = "";
|
|
191
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
192
|
-
return n;
|
|
193
|
-
}
|
|
194
|
-
function clsx() {
|
|
195
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
196
|
-
return n;
|
|
197
|
-
}
|
|
187
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
198
188
|
|
|
199
189
|
var GetInputType = React.forwardRef(function (props, ref) {
|
|
200
190
|
var _p = props._p,
|
|
@@ -896,6 +886,9 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
896
886
|
approvers: {},
|
|
897
887
|
requested_user_is_admin: payload.isCardsAdmin
|
|
898
888
|
};
|
|
889
|
+
if (payload.send_welcome_email !== undefined) {
|
|
890
|
+
res.should_send_welcome_email = payload.send_welcome_email;
|
|
891
|
+
}
|
|
899
892
|
var userTags = [];
|
|
900
893
|
for (var key in payload.userTagType) {
|
|
901
894
|
if (Object.hasOwnProperty.call(payload.userTagType, key) && payload.userTagType[key]) {
|
|
@@ -2644,11 +2637,13 @@ var Visa = function Visa(props) {
|
|
|
2644
2637
|
var IUILocalStorageService$4 = services.IUILocalStorageService;
|
|
2645
2638
|
var env$3 = configs.env;
|
|
2646
2639
|
var CardsManagement = function CardsManagement(_ref) {
|
|
2647
|
-
var _pg$gateway;
|
|
2640
|
+
var _pg$gateway, _selectedCard$metadat;
|
|
2648
2641
|
var _ref$paymentDetails = _ref.paymentDetails,
|
|
2649
2642
|
paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
|
|
2650
2643
|
_ref$paymentMethod = _ref.paymentMethod,
|
|
2651
|
-
paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod
|
|
2644
|
+
paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod,
|
|
2645
|
+
_ref$sendLog = _ref.sendLog,
|
|
2646
|
+
sendLog = _ref$sendLog === void 0 ? function () {} : _ref$sendLog;
|
|
2652
2647
|
var dispatch = useDispatch();
|
|
2653
2648
|
var _ref2 = paymentDetails || {},
|
|
2654
2649
|
_ref2$pg = _ref2.pg,
|
|
@@ -2670,8 +2665,16 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2670
2665
|
setSelectedCard(null);
|
|
2671
2666
|
};
|
|
2672
2667
|
var handleMarkAsDefault = function handleMarkAsDefault() {
|
|
2673
|
-
|
|
2668
|
+
var _selectedCard$card;
|
|
2674
2669
|
if (!pg || !selectedCard) return;
|
|
2670
|
+
sendLog({
|
|
2671
|
+
eventName: 'edit_card_clicked',
|
|
2672
|
+
customProperties: {
|
|
2673
|
+
action_type: 'Make default',
|
|
2674
|
+
card_last4: (selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$card = selectedCard.card) === null || _selectedCard$card === void 0 ? void 0 : _selectedCard$card.last4) || ''
|
|
2675
|
+
},
|
|
2676
|
+
logImpression: true
|
|
2677
|
+
});
|
|
2675
2678
|
dispatch(setDefaultPaymentCard({
|
|
2676
2679
|
user_id: +pg.user_id,
|
|
2677
2680
|
method_id: selectedCard.id,
|
|
@@ -2681,13 +2684,21 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2681
2684
|
handleMenuClose();
|
|
2682
2685
|
};
|
|
2683
2686
|
var handleDeleteCard = function handleDeleteCard() {
|
|
2687
|
+
var _selectedCard$card2;
|
|
2688
|
+
sendLog({
|
|
2689
|
+
eventName: 'edit_card_clicked',
|
|
2690
|
+
customProperties: {
|
|
2691
|
+
action_type: 'Delete',
|
|
2692
|
+
card_last4: (selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$card2 = selectedCard.card) === null || _selectedCard$card2 === void 0 ? void 0 : _selectedCard$card2.last4) || ''
|
|
2693
|
+
},
|
|
2694
|
+
logImpression: true
|
|
2695
|
+
});
|
|
2684
2696
|
dispatch(deletePaymentCard({
|
|
2685
2697
|
pmId: selectedCard.id,
|
|
2686
2698
|
vendorId: pg.vendor_id
|
|
2687
2699
|
}));
|
|
2688
2700
|
handleMenuClose();
|
|
2689
2701
|
};
|
|
2690
|
-
console.log('test mudu 22');
|
|
2691
2702
|
var getBrandLogo = function getBrandLogo(brand) {
|
|
2692
2703
|
var width = 40;
|
|
2693
2704
|
var aspectRatio = 780 / 500;
|
|
@@ -2851,7 +2862,11 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2851
2862
|
}) : 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.createElement("button", {
|
|
2852
2863
|
className: classes.addCardButton,
|
|
2853
2864
|
onClick: function onClick() {
|
|
2854
|
-
|
|
2865
|
+
sendLog({
|
|
2866
|
+
eventName: 'add_user_card_clicked',
|
|
2867
|
+
logImpression: true
|
|
2868
|
+
});
|
|
2869
|
+
window.location.assign(_url);
|
|
2855
2870
|
}
|
|
2856
2871
|
}, /*#__PURE__*/React.createElement("span", {
|
|
2857
2872
|
className: classes.plusIcon
|
|
@@ -2895,7 +2910,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2895
2910
|
}
|
|
2896
2911
|
}, selectedCard && !+selectedCard.metadata.default_card && /*#__PURE__*/React.createElement(MenuItem, {
|
|
2897
2912
|
onClick: handleMarkAsDefault
|
|
2898
|
-
}, "Mark as default"), /*#__PURE__*/React.createElement(MenuItem, {
|
|
2913
|
+
}, "Mark as default"), (cardsCount === 1 || cardsCount > 1 && !+(selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$metadat = selectedCard.metadata) === null || _selectedCard$metadat === void 0 ? void 0 : _selectedCard$metadat.default_card)) && /*#__PURE__*/React.createElement(MenuItem, {
|
|
2899
2914
|
onClick: handleDeleteCard,
|
|
2900
2915
|
style: {
|
|
2901
2916
|
color: '#ff4444'
|
|
@@ -2908,7 +2923,9 @@ var PaymentCards = function PaymentCards(_ref) {
|
|
|
2908
2923
|
var _ref$paymentDetails = _ref.paymentDetails,
|
|
2909
2924
|
paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
|
|
2910
2925
|
_ref$paymentMethod = _ref.paymentMethod,
|
|
2911
|
-
paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod
|
|
2926
|
+
paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod,
|
|
2927
|
+
_ref$sendLog = _ref.sendLog,
|
|
2928
|
+
sendLog = _ref$sendLog === void 0 ? function () {} : _ref$sendLog;
|
|
2912
2929
|
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)) {
|
|
2913
2930
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
2914
2931
|
}
|
|
@@ -2916,7 +2933,8 @@ var PaymentCards = function PaymentCards(_ref) {
|
|
|
2916
2933
|
className: styles$1.dividerColor
|
|
2917
2934
|
}), /*#__PURE__*/React.createElement(CardsManagement, {
|
|
2918
2935
|
paymentDetails: paymentDetails,
|
|
2919
|
-
paymentMethod: paymentMethod
|
|
2936
|
+
paymentMethod: paymentMethod,
|
|
2937
|
+
sendLog: sendLog
|
|
2920
2938
|
}));
|
|
2921
2939
|
};
|
|
2922
2940
|
|
|
@@ -2992,7 +3010,9 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2992
3010
|
_props$roles = props.roles,
|
|
2993
3011
|
roles = _props$roles === void 0 ? [] : _props$roles,
|
|
2994
3012
|
_props$paymentMethod = props.paymentMethod,
|
|
2995
|
-
paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod
|
|
3013
|
+
paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod,
|
|
3014
|
+
_props$sendLog = props.sendLog,
|
|
3015
|
+
sendLog = _props$sendLog === void 0 ? function () {} : _props$sendLog;
|
|
2996
3016
|
var _useState = useState({
|
|
2997
3017
|
product: '',
|
|
2998
3018
|
approvers: []
|
|
@@ -3290,7 +3310,8 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3290
3310
|
}));
|
|
3291
3311
|
})))), type === 'travel' && paymentDetails && isProfile && /*#__PURE__*/React.createElement(PaymentCards, {
|
|
3292
3312
|
paymentDetails: paymentDetails,
|
|
3293
|
-
paymentMethod: paymentMethod
|
|
3313
|
+
paymentMethod: paymentMethod,
|
|
3314
|
+
sendLog: sendLog
|
|
3294
3315
|
}));
|
|
3295
3316
|
};
|
|
3296
3317
|
|
|
@@ -5049,6 +5070,7 @@ function withStore(Component) {
|
|
|
5049
5070
|
}
|
|
5050
5071
|
|
|
5051
5072
|
var ExpandMoreIcon = function ExpandMoreIcon(props) {
|
|
5073
|
+
var fillColor = props.fillColor || '#6B7280';
|
|
5052
5074
|
return /*#__PURE__*/React.createElement("svg", {
|
|
5053
5075
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5054
5076
|
width: props.width,
|
|
@@ -5056,7 +5078,7 @@ var ExpandMoreIcon = function ExpandMoreIcon(props) {
|
|
|
5056
5078
|
fill: "none",
|
|
5057
5079
|
viewBox: "0 0 12 7"
|
|
5058
5080
|
}, /*#__PURE__*/React.createElement("path", {
|
|
5059
|
-
fill:
|
|
5081
|
+
fill: fillColor,
|
|
5060
5082
|
d: "M.293.294a1 1 0 011.414 0L6 4.587 10.293.294a1 1 0 111.414 1.414l-5 5a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414z"
|
|
5061
5083
|
}));
|
|
5062
5084
|
};
|
|
@@ -6424,7 +6446,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6424
6446
|
_props$isProfile = props.isProfile,
|
|
6425
6447
|
isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
|
|
6426
6448
|
_props$paymentMethod = props.paymentMethod,
|
|
6427
|
-
paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod
|
|
6449
|
+
paymentMethod = _props$paymentMethod === void 0 ? null : _props$paymentMethod,
|
|
6450
|
+
_props$sendLog = props.sendLog,
|
|
6451
|
+
sendLog = _props$sendLog === void 0 ? function () {} : _props$sendLog;
|
|
6428
6452
|
env$4.init(config, isProfile);
|
|
6429
6453
|
var queryParams = new URLSearchParams(window.location.search);
|
|
6430
6454
|
var verifyUserId = Number(queryParams.get(config.routes.users.add.queryParamKeys.verifyUserId));
|
|
@@ -6648,6 +6672,26 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6648
6672
|
console.log('errorrr', error);
|
|
6649
6673
|
});
|
|
6650
6674
|
};
|
|
6675
|
+
var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
|
|
6676
|
+
fetch(userAddEditUrl.cardsAddUsersDetails(), {
|
|
6677
|
+
method: 'GET',
|
|
6678
|
+
headers: {
|
|
6679
|
+
'Content-Type': 'application/json',
|
|
6680
|
+
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6681
|
+
}
|
|
6682
|
+
}).then(function (response) {
|
|
6683
|
+
return response.json();
|
|
6684
|
+
}).then(function (res) {
|
|
6685
|
+
var _res$roles2;
|
|
6686
|
+
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
6687
|
+
dispatch(setCardsDetails(res));
|
|
6688
|
+
} else {
|
|
6689
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6690
|
+
}
|
|
6691
|
+
})["catch"](function (error) {
|
|
6692
|
+
console.log('errorrr', error);
|
|
6693
|
+
});
|
|
6694
|
+
};
|
|
6651
6695
|
useEffect(function () {
|
|
6652
6696
|
var countryObject = countryContactCode.find(function (t) {
|
|
6653
6697
|
return t.dial_code === countryDialCode;
|
|
@@ -7348,8 +7392,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7348
7392
|
useEffect(function () {
|
|
7349
7393
|
if (isRendered === true) {
|
|
7350
7394
|
renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
|
|
7395
|
+
console.log(prod, isProfile, editUserId, id, 'card check');
|
|
7351
7396
|
if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
|
|
7352
|
-
|
|
7397
|
+
if (isProfile || editUserId) {
|
|
7398
|
+
fetchEditUserCardsDetails(isProfile ? id : editUserId);
|
|
7399
|
+
} else {
|
|
7400
|
+
fetchLoggedUserCardsDetails();
|
|
7401
|
+
}
|
|
7353
7402
|
}
|
|
7354
7403
|
});
|
|
7355
7404
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
@@ -7678,7 +7727,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7678
7727
|
return Promise.reject(e);
|
|
7679
7728
|
}
|
|
7680
7729
|
};
|
|
7681
|
-
var formSubmitHandler = function formSubmitHandler() {
|
|
7730
|
+
var formSubmitHandler = function formSubmitHandler(send_welcome_email) {
|
|
7731
|
+
if (send_welcome_email === void 0) {
|
|
7732
|
+
send_welcome_email = false;
|
|
7733
|
+
}
|
|
7682
7734
|
try {
|
|
7683
7735
|
var checkAnyError = doesFormHasError();
|
|
7684
7736
|
if (checkAnyError) {
|
|
@@ -7716,6 +7768,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7716
7768
|
cardsRole: cardsRole,
|
|
7717
7769
|
isCardsAdmin: isCardsAdmin
|
|
7718
7770
|
};
|
|
7771
|
+
if (!isEditMode && !isProfile) {
|
|
7772
|
+
payload.send_welcome_email = send_welcome_email;
|
|
7773
|
+
}
|
|
7719
7774
|
if (verifyUserId) {
|
|
7720
7775
|
payload.verifyUserId = verifyUserId;
|
|
7721
7776
|
}
|
|
@@ -8104,12 +8159,34 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
8104
8159
|
onClick: handleCancelNavigation
|
|
8105
8160
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8106
8161
|
component: "div",
|
|
8107
|
-
className:
|
|
8108
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8162
|
+
className: clsx('pageHeader--button-single', styles.buttonRight)
|
|
8163
|
+
}, isEditMode || isProfile ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
8109
8164
|
buttonText: "Save",
|
|
8110
8165
|
type: "contained",
|
|
8111
8166
|
onClick: formSubmitHandler,
|
|
8112
8167
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
8168
|
+
}) : /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
8169
|
+
buttonText: "Create user",
|
|
8170
|
+
outlinedBtn: false,
|
|
8171
|
+
className: styles.containedDropdownBtn,
|
|
8172
|
+
placement: "bottom-end",
|
|
8173
|
+
endIcon: /*#__PURE__*/React.createElement(ExpandMoreIcon, {
|
|
8174
|
+
fillColor: "white",
|
|
8175
|
+
width: "10",
|
|
8176
|
+
height: "10",
|
|
8177
|
+
fill: true
|
|
8178
|
+
}),
|
|
8179
|
+
menuListInfo: [{
|
|
8180
|
+
label: 'Send email invite',
|
|
8181
|
+
handler: function handler() {
|
|
8182
|
+
return formSubmitHandler(true);
|
|
8183
|
+
}
|
|
8184
|
+
}, {
|
|
8185
|
+
label: 'Do not send email',
|
|
8186
|
+
handler: function handler() {
|
|
8187
|
+
return formSubmitHandler(false);
|
|
8188
|
+
}
|
|
8189
|
+
}]
|
|
8113
8190
|
}))))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8114
8191
|
component: "div",
|
|
8115
8192
|
marginTop: "8rem",
|
|
@@ -8323,7 +8400,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
8323
8400
|
isProfile: isProfile,
|
|
8324
8401
|
editUserId: editUserId,
|
|
8325
8402
|
roles: renderFields.travelRoles,
|
|
8326
|
-
paymentMethod: paymentMethod
|
|
8403
|
+
paymentMethod: paymentMethod,
|
|
8404
|
+
sendLog: sendLog
|
|
8327
8405
|
}), /*#__PURE__*/React.createElement(AdditionalInfo, {
|
|
8328
8406
|
membershipInfoInput: membershipInfoInput,
|
|
8329
8407
|
onMemInfoInputChange: onMemInfoInputChange,
|
|
@@ -8368,7 +8446,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
8368
8446
|
isProfile: isProfile,
|
|
8369
8447
|
editUserId: editUserId,
|
|
8370
8448
|
roles: renderFields.expenseRoles,
|
|
8371
|
-
paymentMethod: paymentMethod
|
|
8449
|
+
paymentMethod: paymentMethod,
|
|
8450
|
+
sendLog: sendLog
|
|
8372
8451
|
}), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
8373
8452
|
className: styles.dividerColor
|
|
8374
8453
|
}), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React.createElement(CardsField, {
|
|
@@ -8619,10 +8698,15 @@ var downloadUploadedRecords = function downloadUploadedRecords(type, jobId) {
|
|
|
8619
8698
|
});
|
|
8620
8699
|
};
|
|
8621
8700
|
};
|
|
8622
|
-
var importUploadedRecords = function importUploadedRecords(jobId, canUpdateExistingUsers) {
|
|
8701
|
+
var importUploadedRecords = function importUploadedRecords(jobId, canUpdateExistingUsers, sendInvite) {
|
|
8702
|
+
if (sendInvite === void 0) {
|
|
8703
|
+
sendInvite = false;
|
|
8704
|
+
}
|
|
8623
8705
|
return function (dispatch) {
|
|
8624
8706
|
return new Promise(function (resolve, reject) {
|
|
8625
|
-
api$8.post(userBulkImport.importRecords() + "?job_id=" + jobId + "&update=" + canUpdateExistingUsers
|
|
8707
|
+
api$8.post(userBulkImport.importRecords() + "?job_id=" + jobId + "&update=" + canUpdateExistingUsers, {
|
|
8708
|
+
should_send_welcome_email: sendInvite
|
|
8709
|
+
}).then(function (res) {
|
|
8626
8710
|
resolve(res);
|
|
8627
8711
|
})["catch"](function (err) {
|
|
8628
8712
|
reject(err);
|
|
@@ -8883,9 +8967,12 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8883
8967
|
var _useState5 = useState(false),
|
|
8884
8968
|
canUpdateExistingUsers = _useState5[0],
|
|
8885
8969
|
setCanUpdateExistingUsers = _useState5[1];
|
|
8886
|
-
var _useState6 = useState(
|
|
8887
|
-
|
|
8888
|
-
|
|
8970
|
+
var _useState6 = useState(true),
|
|
8971
|
+
sendInvite = _useState6[0],
|
|
8972
|
+
setSendInvite = _useState6[1];
|
|
8973
|
+
var _useState7 = useState(false),
|
|
8974
|
+
isFileDownloading = _useState7[0],
|
|
8975
|
+
setDownlStatus = _useState7[1];
|
|
8889
8976
|
var _useSelector = useSelector(function (state) {
|
|
8890
8977
|
return state.common;
|
|
8891
8978
|
}),
|
|
@@ -8993,7 +9080,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8993
9080
|
}
|
|
8994
9081
|
}
|
|
8995
9082
|
setImportStatus(1);
|
|
8996
|
-
return Promise.resolve(dispatch(importUploadedRecords(jobId, canUpdateExistingUsers ? 1 : 0))).then(function (res) {
|
|
9083
|
+
return Promise.resolve(dispatch(importUploadedRecords(jobId, canUpdateExistingUsers ? 1 : 0, sendInvite))).then(function (res) {
|
|
8997
9084
|
var _temp = function () {
|
|
8998
9085
|
if (res.data.status) {
|
|
8999
9086
|
return Promise.resolve(dispatch(_executionJob(jobId, 'is_job_completed')).then(function (resp) {
|
|
@@ -9024,6 +9111,9 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
9024
9111
|
var handleExistingUserUpdation = function handleExistingUserUpdation(event) {
|
|
9025
9112
|
setCanUpdateExistingUsers(!canUpdateExistingUsers);
|
|
9026
9113
|
};
|
|
9114
|
+
var handleSendInvite = function handleSendInvite() {
|
|
9115
|
+
setSendInvite(!sendInvite);
|
|
9116
|
+
};
|
|
9027
9117
|
var CustomStepIcon = function CustomStepIcon(step) {
|
|
9028
9118
|
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step === Number(activeStep)) {
|
|
9029
9119
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
@@ -9333,6 +9423,18 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
9333
9423
|
label: "Update any existing users",
|
|
9334
9424
|
className: clsx(styles$5.checkboxlabel, (_clsx5 = {}, _clsx5[styles$5.disabledText] = +userBulkImportInfo.exist_users === 0, _clsx5)),
|
|
9335
9425
|
disabled: +userBulkImportInfo.exist_users === 0
|
|
9426
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9427
|
+
display: "flex",
|
|
9428
|
+
style: {
|
|
9429
|
+
paddingLeft: '28px'
|
|
9430
|
+
}
|
|
9431
|
+
}, /*#__PURE__*/React.createElement(IUIFormControlLabel, {
|
|
9432
|
+
control: /*#__PURE__*/React.createElement(IUICheckBox, {
|
|
9433
|
+
handleCheckBoxHandler: handleSendInvite,
|
|
9434
|
+
checked: sendInvite
|
|
9435
|
+
}),
|
|
9436
|
+
label: "Send invitation emails to new users who have not logged into the platform.",
|
|
9437
|
+
className: clsx(styles$5.checkboxlabel)
|
|
9336
9438
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9337
9439
|
display: "flex",
|
|
9338
9440
|
style: {
|