@itilite/iui-user-management 0.0.14 → 0.0.16
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 +126 -58
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +126 -58
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/style.css +0 -1
- package/dist/style.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -161,52 +161,24 @@ function _catch(body, recover) {
|
|
|
161
161
|
|
|
162
162
|
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"};
|
|
163
163
|
|
|
164
|
-
function
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (Array.isArray(mix)) {
|
|
173
|
-
for (k = 0; k < mix.length; k++) {
|
|
174
|
-
if (mix[k]) {
|
|
175
|
-
if (y = toVal(mix[k])) {
|
|
176
|
-
str && (str += ' ');
|
|
177
|
-
str += y;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
} else {
|
|
182
|
-
for (k in mix) {
|
|
183
|
-
if (mix[k]) {
|
|
184
|
-
str && (str += ' ');
|
|
185
|
-
str += k;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
164
|
+
function r(e) {
|
|
165
|
+
var t,
|
|
166
|
+
f,
|
|
167
|
+
n = "";
|
|
168
|
+
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++) {
|
|
169
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
170
|
+
} else for (t in e) {
|
|
171
|
+
e[t] && (n && (n += " "), n += t);
|
|
189
172
|
}
|
|
190
|
-
|
|
191
|
-
return str;
|
|
173
|
+
return n;
|
|
192
174
|
}
|
|
193
175
|
|
|
194
176
|
function clsx() {
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
x,
|
|
198
|
-
str = '';
|
|
199
|
-
|
|
200
|
-
while (i < arguments.length) {
|
|
201
|
-
if (tmp = arguments[i++]) {
|
|
202
|
-
if (x = toVal(tmp)) {
|
|
203
|
-
str && (str += ' ');
|
|
204
|
-
str += x;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
177
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) {
|
|
178
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
207
179
|
}
|
|
208
180
|
|
|
209
|
-
return
|
|
181
|
+
return n;
|
|
210
182
|
}
|
|
211
183
|
|
|
212
184
|
var env = utils.configs.env;
|
|
@@ -250,6 +222,9 @@ var userAddEditUrl = {
|
|
|
250
222
|
},
|
|
251
223
|
verifyUserInfo: function verifyUserInfo(userId) {
|
|
252
224
|
return "api/v1/onboarding/user-sign-up-info/" + userId + "?company_id=" + IUILocalStorageService.getCompanyId();
|
|
225
|
+
},
|
|
226
|
+
rejectUserVerification: function rejectUserVerification(userId) {
|
|
227
|
+
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
253
228
|
}
|
|
254
229
|
};
|
|
255
230
|
var userListUrl = {
|
|
@@ -351,6 +326,51 @@ var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref)
|
|
|
351
326
|
return Promise.reject(e);
|
|
352
327
|
}
|
|
353
328
|
};
|
|
329
|
+
var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
|
|
330
|
+
var page = _ref2.page,
|
|
331
|
+
tabelName = _ref2.tabelName,
|
|
332
|
+
placeholder = _ref2.placeholder,
|
|
333
|
+
defaultData = _ref2.defaultData;
|
|
334
|
+
|
|
335
|
+
try {
|
|
336
|
+
return Promise.resolve(_catch(function () {
|
|
337
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
338
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
339
|
+
return res.data;
|
|
340
|
+
})).then(function (response) {
|
|
341
|
+
var arrList = response.results.filter(function (item) {
|
|
342
|
+
return item.name !== defaultData;
|
|
343
|
+
});
|
|
344
|
+
var mappedValue = arrList.map(function (item) {
|
|
345
|
+
return {
|
|
346
|
+
value: item.id,
|
|
347
|
+
label: item.name
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
return {
|
|
351
|
+
options: mappedValue,
|
|
352
|
+
hasMore: !!response.next,
|
|
353
|
+
additional: {
|
|
354
|
+
page: page + 1,
|
|
355
|
+
tabelName: tabelName
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
});
|
|
359
|
+
}, function () {
|
|
360
|
+
return {
|
|
361
|
+
options: [],
|
|
362
|
+
hasMore: false,
|
|
363
|
+
additional: {
|
|
364
|
+
page: 1,
|
|
365
|
+
tabelName: tabelName,
|
|
366
|
+
placeholder: placeholder
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
}));
|
|
370
|
+
} catch (e) {
|
|
371
|
+
return Promise.reject(e);
|
|
372
|
+
}
|
|
373
|
+
};
|
|
354
374
|
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
355
375
|
var page = _ref3.page;
|
|
356
376
|
|
|
@@ -1772,12 +1792,12 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1772
1792
|
return new Promise(function (resolve, reject) {
|
|
1773
1793
|
var _travelApprovers = getState().userAddEdit.renderFields.travelApprovers;
|
|
1774
1794
|
var sNo = _travelApprovers.length + 1;
|
|
1775
|
-
var label = "Travel
|
|
1795
|
+
var label = "Travel approver " + sNo;
|
|
1776
1796
|
|
|
1777
1797
|
_travelApprovers.forEach(function (approver) {
|
|
1778
1798
|
if (approver.label === label) {
|
|
1779
1799
|
sNo++;
|
|
1780
|
-
label = "Travel
|
|
1800
|
+
label = "Travel approver " + sNo;
|
|
1781
1801
|
}
|
|
1782
1802
|
});
|
|
1783
1803
|
|
|
@@ -1816,12 +1836,12 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1816
1836
|
return new Promise(function (resolve, reject) {
|
|
1817
1837
|
var _expenseApprovers = getState().userAddEdit.renderFields.expenseApprovers;
|
|
1818
1838
|
var sNo = _expenseApprovers.length + 1;
|
|
1819
|
-
var label = "Expense
|
|
1839
|
+
var label = "Expense approver " + sNo;
|
|
1820
1840
|
|
|
1821
1841
|
_expenseApprovers.forEach(function (approver) {
|
|
1822
1842
|
if (approver.label === label) {
|
|
1823
1843
|
sNo++;
|
|
1824
|
-
label = "Expense
|
|
1844
|
+
label = "Expense approver " + sNo;
|
|
1825
1845
|
}
|
|
1826
1846
|
});
|
|
1827
1847
|
|
|
@@ -2118,6 +2138,36 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
2118
2138
|
});
|
|
2119
2139
|
};
|
|
2120
2140
|
};
|
|
2141
|
+
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
2142
|
+
return function (dispatch) {
|
|
2143
|
+
return new Promise(function (resolve, reject) {
|
|
2144
|
+
api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
2145
|
+
console.log(res);
|
|
2146
|
+
|
|
2147
|
+
if (res.data.status === true) {
|
|
2148
|
+
var _res$data5;
|
|
2149
|
+
|
|
2150
|
+
resolve(res.data);
|
|
2151
|
+
IUIToastMessageService.sNotify((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.message) || 'User rejected successfully.');
|
|
2152
|
+
setTimeout(function () {
|
|
2153
|
+
window.history.back();
|
|
2154
|
+
}, 1000);
|
|
2155
|
+
} else {
|
|
2156
|
+
var _res$data6;
|
|
2157
|
+
|
|
2158
|
+
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.message) || 'Opps, Unable to reject user.');
|
|
2159
|
+
reject(res);
|
|
2160
|
+
}
|
|
2161
|
+
})["catch"](function (err) {
|
|
2162
|
+
var _err$response10, _err$response10$data;
|
|
2163
|
+
|
|
2164
|
+
console.log(err);
|
|
2165
|
+
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : _err$response10$data.message) || 'Opps, Unable to reject user.');
|
|
2166
|
+
reject(err);
|
|
2167
|
+
});
|
|
2168
|
+
});
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2121
2171
|
|
|
2122
2172
|
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
2123
2173
|
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
@@ -2598,8 +2648,10 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2598
2648
|
var AddCard = function AddCard(_ref2) {
|
|
2599
2649
|
var pg = _ref2.pg;
|
|
2600
2650
|
|
|
2651
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2652
|
+
|
|
2601
2653
|
var handleAddCard = function handleAddCard() {
|
|
2602
|
-
window.location.assign(
|
|
2654
|
+
window.location.assign(_url);
|
|
2603
2655
|
};
|
|
2604
2656
|
|
|
2605
2657
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -2800,13 +2852,13 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2800
2852
|
var rgx = null;
|
|
2801
2853
|
|
|
2802
2854
|
if (type === 'travel') {
|
|
2803
|
-
rgx = /^(travel
|
|
2855
|
+
rgx = /^(travel approver)( )[0-9]*$/i;
|
|
2804
2856
|
} else {
|
|
2805
|
-
rgx = /^(expense
|
|
2857
|
+
rgx = /^(expense approver)( )[0-9]*$/i;
|
|
2806
2858
|
}
|
|
2807
2859
|
|
|
2808
|
-
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + "
|
|
2809
|
-
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2860
|
+
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + " approver " + (editedLabel.approvers[i].indexAt + 1)) {
|
|
2861
|
+
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (editedLabel.approvers[i].indexAt + 1) + "' to '" + editedLabel.approvers[i].label + "'";
|
|
2810
2862
|
|
|
2811
2863
|
if (!hasError) {
|
|
2812
2864
|
hasError = true;
|
|
@@ -2921,10 +2973,10 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2921
2973
|
return null;
|
|
2922
2974
|
}
|
|
2923
2975
|
|
|
2924
|
-
if (p.label.toLowerCase() === type + "
|
|
2976
|
+
if (p.label.toLowerCase() === type + " approver " + (i + 1)) {
|
|
2925
2977
|
p.secondaryLabel = '';
|
|
2926
2978
|
} else {
|
|
2927
|
-
p.secondaryLabel = type + "
|
|
2979
|
+
p.secondaryLabel = type + " approver " + (i + 1);
|
|
2928
2980
|
}
|
|
2929
2981
|
|
|
2930
2982
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
@@ -3040,7 +3092,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3040
3092
|
className: styles.fieldMargin
|
|
3041
3093
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
3042
3094
|
defaultValue: p.label,
|
|
3043
|
-
label: (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
3095
|
+
label: (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (i + 1),
|
|
3044
3096
|
className: styles.inputWidth,
|
|
3045
3097
|
id: type + '_' + p.sequence,
|
|
3046
3098
|
name: type + '_' + p.sequence,
|
|
@@ -5409,7 +5461,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5409
5461
|
userTagType: userTagType
|
|
5410
5462
|
};
|
|
5411
5463
|
|
|
5412
|
-
if (verifyUserId) {
|
|
5464
|
+
if (verifyUserId && isILadmin) {
|
|
5413
5465
|
payload.verifyUserId = verifyUserId;
|
|
5414
5466
|
}
|
|
5415
5467
|
|
|
@@ -5729,7 +5781,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5729
5781
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
5730
5782
|
}
|
|
5731
5783
|
}
|
|
5732
|
-
} else if (verifyUserId) {
|
|
5784
|
+
} else if (verifyUserId && isILadmin) {
|
|
5733
5785
|
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
5734
5786
|
|
|
5735
5787
|
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$signu = _config$routes4.signupRequest) === null || _config$routes4$signu === void 0 ? void 0 : (_config$routes4$signu2 = _config$routes4$signu.list) === null || _config$routes4$signu2 === void 0 ? void 0 : _config$routes4$signu2.path) && history.push(config.routes.signupRequest.list.path);
|
|
@@ -5757,7 +5809,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5757
5809
|
};
|
|
5758
5810
|
|
|
5759
5811
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
5760
|
-
if (verifyUserId) {
|
|
5812
|
+
if (verifyUserId && isILadmin) {
|
|
5761
5813
|
dispatch(showLoader());
|
|
5762
5814
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
5763
5815
|
console.log(res);
|
|
@@ -5860,6 +5912,15 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5860
5912
|
}
|
|
5861
5913
|
};
|
|
5862
5914
|
|
|
5915
|
+
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
5916
|
+
if (verifyUserId && isILadmin) {
|
|
5917
|
+
dispatch(showLoader());
|
|
5918
|
+
dispatch(rejectUserVerification(verifyUserId))["finally"](function () {
|
|
5919
|
+
dispatch(stopLoader());
|
|
5920
|
+
});
|
|
5921
|
+
}
|
|
5922
|
+
};
|
|
5923
|
+
|
|
5863
5924
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
5864
5925
|
component: "div",
|
|
5865
5926
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -5876,7 +5937,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5876
5937
|
className: styles.breadcrumb
|
|
5877
5938
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBreadCrumb, {
|
|
5878
5939
|
breadCrumbs: [{
|
|
5879
|
-
href: verifyUserId ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
5940
|
+
href: verifyUserId && isILadmin ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
5880
5941
|
label: 'Users',
|
|
5881
5942
|
hasLink: true
|
|
5882
5943
|
}]
|
|
@@ -5911,7 +5972,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5911
5972
|
type: "contained",
|
|
5912
5973
|
onClick: formSubmitHandler,
|
|
5913
5974
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
5914
|
-
}))
|
|
5975
|
+
})), verifyUserId && isILadmin ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
5976
|
+
component: "div",
|
|
5977
|
+
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
5978
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
5979
|
+
buttonText: "Reject",
|
|
5980
|
+
type: "outlined",
|
|
5981
|
+
onClick: handleSignUpRequestRejection
|
|
5982
|
+
})) : null))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
5915
5983
|
component: "div",
|
|
5916
5984
|
marginTop: "8rem",
|
|
5917
5985
|
flexDirection: "column"
|
|
@@ -8787,7 +8855,7 @@ function MoveUserDialog(_ref) {
|
|
|
8787
8855
|
name: name,
|
|
8788
8856
|
isMove: isMove,
|
|
8789
8857
|
customSelectHandler: customSelectHandler,
|
|
8790
|
-
loadOption:
|
|
8858
|
+
loadOption: commonLoadOptionsUM,
|
|
8791
8859
|
isError: isError,
|
|
8792
8860
|
errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
|
|
8793
8861
|
placeHolderCheck: name !== undefined && name === ''
|