@itilite/iui-user-management 0.1.19 → 0.2.0
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 +714 -666
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +715 -667
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var iuistyles = require('@itilite/iuistyles');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var React__default = _interopDefault(React);
|
|
6
6
|
var utils = require('@itilite/utils');
|
|
7
|
-
var axios = _interopDefault(require('axios'));
|
|
8
7
|
var moment = _interopDefault(require('moment'));
|
|
8
|
+
var axios = _interopDefault(require('axios'));
|
|
9
9
|
var AddIcon$1 = _interopDefault(require('@material-ui/icons/Add'));
|
|
10
10
|
var DeleteIcon = _interopDefault(require('@material-ui/icons/Delete'));
|
|
11
11
|
var reactRedux = require('react-redux');
|
|
@@ -181,6 +181,186 @@ function clsx() {
|
|
|
181
181
|
return n;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
function GetInputType(_ref) {
|
|
185
|
+
var _p = _ref._p,
|
|
186
|
+
_ref$inputState = _ref.inputState,
|
|
187
|
+
inputState = _ref$inputState === void 0 ? {} : _ref$inputState,
|
|
188
|
+
_ref$customHandler = _ref.customHandler,
|
|
189
|
+
customHandler = _ref$customHandler === void 0 ? function () {} : _ref$customHandler,
|
|
190
|
+
_ref$dropdownList = _ref.dropdownList,
|
|
191
|
+
dropdownList = _ref$dropdownList === void 0 ? {} : _ref$dropdownList,
|
|
192
|
+
_ref$dateFormat = _ref.dateFormat,
|
|
193
|
+
dateFormat = _ref$dateFormat === void 0 ? 'dd MMM yyyy' : _ref$dateFormat,
|
|
194
|
+
_ref$errorArray = _ref.errorArray,
|
|
195
|
+
errorArray = _ref$errorArray === void 0 ? [] : _ref$errorArray,
|
|
196
|
+
_ref$errorMsg = _ref.errorMsg,
|
|
197
|
+
errorMsg = _ref$errorMsg === void 0 ? '' : _ref$errorMsg,
|
|
198
|
+
_ref$showNaOption = _ref.showNaOption,
|
|
199
|
+
showNaOption = _ref$showNaOption === void 0 ? false : _ref$showNaOption;
|
|
200
|
+
|
|
201
|
+
switch (_p.type) {
|
|
202
|
+
case 'input':
|
|
203
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
204
|
+
label: _p.label,
|
|
205
|
+
secondaryLabel: _p.secondaryLabel,
|
|
206
|
+
fullWidth: _p.fullWidth,
|
|
207
|
+
name: _p.name,
|
|
208
|
+
id: _p.name,
|
|
209
|
+
defaultValue: inputState[_p.name],
|
|
210
|
+
customHandler: customHandler,
|
|
211
|
+
placeholder: _p.placeholder,
|
|
212
|
+
validation: _p.validation,
|
|
213
|
+
isError: errorArray.indexOf(_p.name) !== -1,
|
|
214
|
+
errorMsg: errorMsg,
|
|
215
|
+
required: _p.required,
|
|
216
|
+
readOnly: _p.readOnly,
|
|
217
|
+
hasInfoIcon: !!_p.tooltip,
|
|
218
|
+
tooltipText: _p.tooltip,
|
|
219
|
+
disableText: _p.disableText
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
case 'datepicker':
|
|
223
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
224
|
+
label: _p.label,
|
|
225
|
+
required: _p.required
|
|
226
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIDatePicker, {
|
|
227
|
+
label: _p.label,
|
|
228
|
+
fullWidth: _p.fullWidth,
|
|
229
|
+
hasIcon: _p.hasIcon,
|
|
230
|
+
size: _p.size,
|
|
231
|
+
name: _p.name,
|
|
232
|
+
id: _p.name,
|
|
233
|
+
dateValue: inputState[_p.name],
|
|
234
|
+
customHandler: customHandler,
|
|
235
|
+
displayDateType: dateFormat,
|
|
236
|
+
placeholder: dateFormat.toUpperCase(),
|
|
237
|
+
maxDate: _p.maxDate,
|
|
238
|
+
minDate: _p.minDate,
|
|
239
|
+
isError: errorArray.indexOf(_p.name) !== -1,
|
|
240
|
+
errorMsg: errorMsg,
|
|
241
|
+
disabled: _p.readOnly,
|
|
242
|
+
hasInfoIcon: !!_p.tooltip,
|
|
243
|
+
tooltipText: _p.tooltip,
|
|
244
|
+
required: _p.required,
|
|
245
|
+
disableText: _p.disableText
|
|
246
|
+
}));
|
|
247
|
+
|
|
248
|
+
case 'select':
|
|
249
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUISelect, {
|
|
250
|
+
label: _p.label,
|
|
251
|
+
fullWidth: _p.fullWidth,
|
|
252
|
+
list: dropdownList[_p.name],
|
|
253
|
+
valueKey: "name",
|
|
254
|
+
required: _p.required,
|
|
255
|
+
name: _p.name,
|
|
256
|
+
id: _p.name,
|
|
257
|
+
value: inputState[_p.name],
|
|
258
|
+
customSelectHandler: customHandler,
|
|
259
|
+
menuItemTitle: _p.placeholder,
|
|
260
|
+
isError: errorArray.indexOf(_p.name) !== -1,
|
|
261
|
+
errorMsg: errorMsg,
|
|
262
|
+
readOnly: _p.readOnly,
|
|
263
|
+
hasInfoIcon: !!_p.tooltip,
|
|
264
|
+
tooltipText: _p.tooltip,
|
|
265
|
+
disableText: _p.disableText
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
case 'phone':
|
|
269
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
270
|
+
label: _p.label,
|
|
271
|
+
required: _p.required
|
|
272
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIPhone, {
|
|
273
|
+
list: dropdownList[_p.name],
|
|
274
|
+
name: _p.name,
|
|
275
|
+
id: _p.name,
|
|
276
|
+
value: inputState[_p.name],
|
|
277
|
+
required: _p.required,
|
|
278
|
+
selectedCountryOverride: inputState.country_code,
|
|
279
|
+
customHandler: customHandler,
|
|
280
|
+
validation: _p.validation,
|
|
281
|
+
isError: errorArray.indexOf(_p.name) !== -1,
|
|
282
|
+
errorMsg: errorMsg,
|
|
283
|
+
readOnly: _p.readOnly,
|
|
284
|
+
hasInfoIcon: !!_p.tooltip,
|
|
285
|
+
tooltipText: _p.tooltip
|
|
286
|
+
}));
|
|
287
|
+
|
|
288
|
+
case 'checkbox':
|
|
289
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUICheckboxButton, {
|
|
290
|
+
label: _p.label,
|
|
291
|
+
isCheckbox: true,
|
|
292
|
+
customHandler: customHandler,
|
|
293
|
+
checkboxFlag: inputState[_p.name],
|
|
294
|
+
disabled: _p.readOnly,
|
|
295
|
+
hasInfoIcon: !!_p.tooltip,
|
|
296
|
+
tooltipText: _p.tooltip,
|
|
297
|
+
id: _p.name,
|
|
298
|
+
disableText: _p.disableText
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
case 'file':
|
|
302
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
303
|
+
label: _p.label,
|
|
304
|
+
required: _p.required,
|
|
305
|
+
description: _p.description,
|
|
306
|
+
hasInfoIcon: !!_p.tooltip,
|
|
307
|
+
tooltipText: _p.tooltip
|
|
308
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIFileUpload, {
|
|
309
|
+
multiple: _p.multiple,
|
|
310
|
+
title: _p.title,
|
|
311
|
+
fileType: _p.fileType,
|
|
312
|
+
name: _p.name,
|
|
313
|
+
id: _p.name,
|
|
314
|
+
customHandler: customHandler,
|
|
315
|
+
value: inputState[_p.name],
|
|
316
|
+
maxFiles: _p.maxNoFiles,
|
|
317
|
+
maxFileSize: _p.fileSize,
|
|
318
|
+
isError: errorArray.indexOf(_p.name) !== -1,
|
|
319
|
+
errorMsg: errorMsg,
|
|
320
|
+
readOnly: _p.readOnly,
|
|
321
|
+
hasInfoIcon: !!_p.tooltip,
|
|
322
|
+
tooltipText: _p.tooltip,
|
|
323
|
+
disableText: _p.disableText,
|
|
324
|
+
buttonType: _p.buttonType
|
|
325
|
+
}));
|
|
326
|
+
|
|
327
|
+
case 'async_select':
|
|
328
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
329
|
+
id: _p.name,
|
|
330
|
+
additional: {
|
|
331
|
+
page: 1,
|
|
332
|
+
tabelName: _p.tabelName,
|
|
333
|
+
product: _p.product,
|
|
334
|
+
placeholder: _p.placeholder,
|
|
335
|
+
userId: _p.editUserId,
|
|
336
|
+
selectCTA: _p.selectCTA,
|
|
337
|
+
showNaOption: showNaOption
|
|
338
|
+
},
|
|
339
|
+
label: _p.label,
|
|
340
|
+
secondaryLabel: _p.secondaryLabel,
|
|
341
|
+
title: _p.title,
|
|
342
|
+
value: inputState[_p.name],
|
|
343
|
+
name: _p.name,
|
|
344
|
+
customSelectHandler: customHandler,
|
|
345
|
+
inputType: _p.inputType,
|
|
346
|
+
loadOption: _p.loadOption,
|
|
347
|
+
isError: errorArray.indexOf(_p.name) !== -1,
|
|
348
|
+
errorMsg: errorMsg,
|
|
349
|
+
required: _p.required,
|
|
350
|
+
readOnly: _p.readOnly,
|
|
351
|
+
placeHolderCheck: inputState[_p.name] !== undefined && inputState[_p.name].value === '',
|
|
352
|
+
hasInfoIcon: !!_p.tooltip,
|
|
353
|
+
tooltipText: _p.tooltip,
|
|
354
|
+
disableText: _p.disableText,
|
|
355
|
+
selectCTA: _p.selectCTA,
|
|
356
|
+
clearCache: _p.clearCache
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
default:
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
184
364
|
var env = utils.configs.env;
|
|
185
365
|
var IUILocalStorageService = utils.services.IUILocalStorageService;
|
|
186
366
|
var userAddEditUrl = {
|
|
@@ -225,9 +405,6 @@ var userAddEditUrl = {
|
|
|
225
405
|
},
|
|
226
406
|
airlineList: function airlineList() {
|
|
227
407
|
return "https://serviceearth.iltech.in/api/v1/paginated/airline/";
|
|
228
|
-
},
|
|
229
|
-
rejectUserVerification: function rejectUserVerification(userId) {
|
|
230
|
-
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
231
408
|
}
|
|
232
409
|
};
|
|
233
410
|
var userListUrl = {
|
|
@@ -278,309 +455,28 @@ var userPanelUrl = {
|
|
|
278
455
|
deleteUnit: function deleteUnit(tableName) {
|
|
279
456
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
280
457
|
},
|
|
281
|
-
getUnit: function getUnit(tableName, length) {
|
|
282
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length;
|
|
458
|
+
getUnit: function getUnit(tableName, length, sort) {
|
|
459
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&order=" + sort;
|
|
283
460
|
},
|
|
284
|
-
getPaginationUnit: function getPaginationUnit(tableName, length, page) {
|
|
285
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page;
|
|
461
|
+
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
462
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&order=" + sort;
|
|
286
463
|
},
|
|
287
464
|
moveUnit: function moveUnit() {
|
|
288
465
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
289
466
|
}
|
|
290
467
|
};
|
|
291
468
|
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
304
|
-
return Promise.resolve(api.get(url).then(function (res) {
|
|
305
|
-
return res.data;
|
|
306
|
-
})).then(function (response) {
|
|
307
|
-
var mappedValue = response.results.map(function (item) {
|
|
308
|
-
return {
|
|
309
|
-
value: item.id,
|
|
310
|
-
label: item.name
|
|
311
|
-
};
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
if (showNaOption && page === 1 && NAoptionConfig.applyFor.includes(tabelName)) {
|
|
315
|
-
mappedValue.unshift(NAoptionConfig.option);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
if (response.next === null && selectCTA) {
|
|
319
|
-
mappedValue.push({
|
|
320
|
-
value: selectCTA.value,
|
|
321
|
-
label: ''
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
return {
|
|
326
|
-
options: mappedValue,
|
|
327
|
-
hasMore: !!response.next,
|
|
328
|
-
additional: {
|
|
329
|
-
page: page + 1,
|
|
330
|
-
tabelName: tabelName,
|
|
331
|
-
placeholder: placeholder,
|
|
332
|
-
selectCTA: selectCTA
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
});
|
|
336
|
-
}, function () {
|
|
337
|
-
return {
|
|
338
|
-
options: [],
|
|
339
|
-
hasMore: false,
|
|
340
|
-
additional: {
|
|
341
|
-
page: 1,
|
|
342
|
-
tabelName: tabelName,
|
|
343
|
-
placeholder: placeholder,
|
|
344
|
-
selectCTA: selectCTA
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
}));
|
|
348
|
-
} catch (e) {
|
|
349
|
-
return Promise.reject(e);
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
|
|
353
|
-
var page = _ref2.page,
|
|
354
|
-
tabelName = _ref2.tabelName,
|
|
355
|
-
placeholder = _ref2.placeholder,
|
|
356
|
-
defaultData = _ref2.defaultData;
|
|
357
|
-
|
|
358
|
-
try {
|
|
359
|
-
return Promise.resolve(_catch(function () {
|
|
360
|
-
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
361
|
-
return Promise.resolve(api.get(url).then(function (res) {
|
|
362
|
-
return res.data;
|
|
363
|
-
})).then(function (response) {
|
|
364
|
-
var arrList = response.results.filter(function (item) {
|
|
365
|
-
return item.name !== defaultData;
|
|
366
|
-
});
|
|
367
|
-
var mappedValue = arrList.map(function (item) {
|
|
368
|
-
return {
|
|
369
|
-
value: item.id,
|
|
370
|
-
label: item.name
|
|
371
|
-
};
|
|
372
|
-
});
|
|
373
|
-
return {
|
|
374
|
-
options: mappedValue,
|
|
375
|
-
hasMore: !!response.next,
|
|
376
|
-
additional: {
|
|
377
|
-
page: page + 1,
|
|
378
|
-
tabelName: tabelName
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
});
|
|
382
|
-
}, function () {
|
|
383
|
-
return {
|
|
384
|
-
options: [],
|
|
385
|
-
hasMore: false,
|
|
386
|
-
additional: {
|
|
387
|
-
page: 1,
|
|
388
|
-
tabelName: tabelName,
|
|
389
|
-
placeholder: placeholder
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
}));
|
|
393
|
-
} catch (e) {
|
|
394
|
-
return Promise.reject(e);
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
398
|
-
var page = _ref3.page;
|
|
399
|
-
|
|
400
|
-
try {
|
|
401
|
-
return Promise.resolve(_catch(function () {
|
|
402
|
-
return Promise.resolve(api.get(userAddEditUrl.currencyCode() + "&search=" + search + "&page=" + page).then(function (res) {
|
|
403
|
-
return res.data;
|
|
404
|
-
})).then(function (response) {
|
|
405
|
-
var mappedValue = response.results.map(function (item) {
|
|
406
|
-
return {
|
|
407
|
-
value: item.currency_code,
|
|
408
|
-
label: item.currency_code
|
|
409
|
-
};
|
|
410
|
-
});
|
|
411
|
-
return {
|
|
412
|
-
options: mappedValue,
|
|
413
|
-
hasMore: !!response.next,
|
|
414
|
-
additional: {
|
|
415
|
-
page: page + 1
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
});
|
|
419
|
-
}, function () {
|
|
420
|
-
return {
|
|
421
|
-
options: [],
|
|
422
|
-
hasMore: false,
|
|
423
|
-
additional: {
|
|
424
|
-
page: 1
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
}));
|
|
428
|
-
} catch (e) {
|
|
429
|
-
return Promise.reject(e);
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
433
|
-
var page = _ref4.page,
|
|
434
|
-
product = _ref4.product,
|
|
435
|
-
userId = _ref4.userId,
|
|
436
|
-
placeholder = _ref4.placeholder;
|
|
437
|
-
|
|
438
|
-
try {
|
|
439
|
-
return Promise.resolve(_catch(function () {
|
|
440
|
-
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
441
|
-
return res.data;
|
|
442
|
-
})).then(function (response) {
|
|
443
|
-
var mappedValue = response.results.map(function (item) {
|
|
444
|
-
return {
|
|
445
|
-
value: item.approver,
|
|
446
|
-
label: item.approver
|
|
447
|
-
};
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
if (page === 1) {
|
|
451
|
-
var placeholderLbl = {
|
|
452
|
-
value: '',
|
|
453
|
-
label: placeholder
|
|
454
|
-
};
|
|
455
|
-
mappedValue.unshift(placeholderLbl);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
return {
|
|
459
|
-
options: mappedValue,
|
|
460
|
-
hasMore: !!response.next,
|
|
461
|
-
additional: {
|
|
462
|
-
page: page + 1,
|
|
463
|
-
product: product,
|
|
464
|
-
userId: userId
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
});
|
|
468
|
-
}, function () {
|
|
469
|
-
return {
|
|
470
|
-
options: [],
|
|
471
|
-
hasMore: false,
|
|
472
|
-
additional: {
|
|
473
|
-
page: 1,
|
|
474
|
-
product: product,
|
|
475
|
-
userId: userId
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
}));
|
|
479
|
-
} catch (e) {
|
|
480
|
-
return Promise.reject(e);
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
484
|
-
var page = _ref5.page,
|
|
485
|
-
tabelName = _ref5.tabelName;
|
|
486
|
-
|
|
487
|
-
try {
|
|
488
|
-
return Promise.resolve(_catch(function () {
|
|
489
|
-
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
490
|
-
return res.data;
|
|
491
|
-
})).then(function (response) {
|
|
492
|
-
var mappedValue = response.results.map(function (item) {
|
|
493
|
-
return {
|
|
494
|
-
value: item[tabelName],
|
|
495
|
-
label: item[tabelName]
|
|
496
|
-
};
|
|
497
|
-
});
|
|
498
|
-
return {
|
|
499
|
-
options: mappedValue,
|
|
500
|
-
hasMore: !!response.next,
|
|
501
|
-
additional: {
|
|
502
|
-
page: page + 1,
|
|
503
|
-
tabelName: tabelName
|
|
504
|
-
}
|
|
505
|
-
};
|
|
506
|
-
});
|
|
507
|
-
}, function () {
|
|
508
|
-
return {
|
|
509
|
-
options: [],
|
|
510
|
-
hasMore: false,
|
|
511
|
-
additional: {
|
|
512
|
-
page: 1,
|
|
513
|
-
tabelName: tabelName
|
|
514
|
-
}
|
|
515
|
-
};
|
|
516
|
-
}));
|
|
517
|
-
} catch (e) {
|
|
518
|
-
return Promise.reject(e);
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
522
|
-
var page = _ref6.page,
|
|
523
|
-
placeholder = _ref6.placeholder;
|
|
524
|
-
|
|
525
|
-
try {
|
|
526
|
-
return Promise.resolve(_catch(function () {
|
|
527
|
-
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
528
|
-
var token = IUILocalStorageService$1.getAccessToken();
|
|
529
|
-
return Promise.resolve(axios.get(url, {
|
|
530
|
-
headers: {
|
|
531
|
-
Authorization: 'Bearer ' + token
|
|
532
|
-
}
|
|
533
|
-
})).then(function (response) {
|
|
534
|
-
return Promise.resolve(response.data.results.map(function (item) {
|
|
535
|
-
return {
|
|
536
|
-
value: item.id,
|
|
537
|
-
label: item.name
|
|
538
|
-
};
|
|
539
|
-
})).then(function (mappedValue) {
|
|
540
|
-
if (placeholder) {
|
|
541
|
-
var placeholderLbl = {
|
|
542
|
-
value: '',
|
|
543
|
-
label: placeholder
|
|
544
|
-
};
|
|
545
|
-
mappedValue.unshift(placeholderLbl);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
return {
|
|
549
|
-
options: mappedValue,
|
|
550
|
-
hasMore: !!response.data.next,
|
|
551
|
-
additional: {
|
|
552
|
-
page: page + 1,
|
|
553
|
-
placeholder: placeholder
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
});
|
|
557
|
-
});
|
|
558
|
-
}, function () {
|
|
559
|
-
return {
|
|
560
|
-
options: [],
|
|
561
|
-
hasMore: false,
|
|
562
|
-
additional: {
|
|
563
|
-
page: 1,
|
|
564
|
-
placeholder: placeholder
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
}));
|
|
568
|
-
} catch (e) {
|
|
569
|
-
return Promise.reject(e);
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
var dob = {
|
|
574
|
-
maxDate: moment().subtract(18, 'years'),
|
|
575
|
-
minDate: moment().subtract(300, 'years')
|
|
576
|
-
};
|
|
577
|
-
var passportStart = {
|
|
578
|
-
maxDate: moment(),
|
|
579
|
-
minDate: moment().subtract(100, 'years')
|
|
580
|
-
};
|
|
581
|
-
var passportEnd = {
|
|
582
|
-
maxDate: moment().add(18, 'years'),
|
|
583
|
-
minDate: moment()
|
|
469
|
+
var dob = {
|
|
470
|
+
maxDate: moment().subtract(18, 'years'),
|
|
471
|
+
minDate: moment().subtract(300, 'years')
|
|
472
|
+
};
|
|
473
|
+
var passportStart = {
|
|
474
|
+
maxDate: moment(),
|
|
475
|
+
minDate: moment().subtract(100, 'years')
|
|
476
|
+
};
|
|
477
|
+
var passportEnd = {
|
|
478
|
+
maxDate: moment().add(18, 'years'),
|
|
479
|
+
minDate: moment()
|
|
584
480
|
};
|
|
585
481
|
|
|
586
482
|
var personalInfo = [{
|
|
@@ -725,7 +621,7 @@ var workInfo = [{
|
|
|
725
621
|
value: 'employee_level',
|
|
726
622
|
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
727
623
|
className: "iui__font--color-link iui__font--weight-500"
|
|
728
|
-
}, "+ Add
|
|
624
|
+
}, "+ Add Employee Level"),
|
|
729
625
|
callback: null
|
|
730
626
|
}
|
|
731
627
|
}, {
|
|
@@ -767,7 +663,7 @@ var workInfo = [{
|
|
|
767
663
|
value: 'entity',
|
|
768
664
|
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
769
665
|
className: "iui__font--color-link iui__font--weight-500"
|
|
770
|
-
}, "+ Add
|
|
666
|
+
}, "+ Add Entity"),
|
|
771
667
|
callback: null
|
|
772
668
|
}
|
|
773
669
|
}, {
|
|
@@ -789,7 +685,7 @@ var workInfo = [{
|
|
|
789
685
|
value: 'business_unit',
|
|
790
686
|
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
791
687
|
className: "iui__font--color-link iui__font--weight-500"
|
|
792
|
-
}, "+ Add
|
|
688
|
+
}, "+ Add Business Unit"),
|
|
793
689
|
callback: null
|
|
794
690
|
}
|
|
795
691
|
}, {
|
|
@@ -811,7 +707,7 @@ var workInfo = [{
|
|
|
811
707
|
value: 'department',
|
|
812
708
|
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
813
709
|
className: "iui__font--color-link iui__font--weight-500"
|
|
814
|
-
}, "+ Add
|
|
710
|
+
}, "+ Add Department"),
|
|
815
711
|
callback: null
|
|
816
712
|
}
|
|
817
713
|
}, {
|
|
@@ -1224,186 +1120,281 @@ var NAoptionConfig = {
|
|
|
1224
1120
|
},
|
|
1225
1121
|
applyFor: ['employee_level', 'department']
|
|
1226
1122
|
};
|
|
1123
|
+
var userAddPageFormLabels = {
|
|
1124
|
+
user_personal_info: {
|
|
1125
|
+
first_name: 'First and middle name',
|
|
1126
|
+
last_name: 'Last name',
|
|
1127
|
+
email: 'Email address',
|
|
1128
|
+
contact_number: 'Phone number',
|
|
1129
|
+
dob: 'Date of birth',
|
|
1130
|
+
gender: 'Gender',
|
|
1131
|
+
profile_pic: 'Profile photo'
|
|
1132
|
+
},
|
|
1133
|
+
employee_info: {
|
|
1134
|
+
emp_level: 'Employee level',
|
|
1135
|
+
employee_id: 'Employee ID',
|
|
1136
|
+
entity: 'Entity',
|
|
1137
|
+
business_unit: 'Business unit',
|
|
1138
|
+
department: 'Department',
|
|
1139
|
+
designation: 'Designation',
|
|
1140
|
+
base_location: 'Base location',
|
|
1141
|
+
currency: 'Default currency'
|
|
1142
|
+
},
|
|
1143
|
+
user_travel_info: {
|
|
1144
|
+
nationality: 'Nationality',
|
|
1145
|
+
passport_number: 'Passport number',
|
|
1146
|
+
passport_expiry_date: 'Date of expiry',
|
|
1147
|
+
passport_issue_country: 'Passport issuing country',
|
|
1148
|
+
passport_issue_date: 'Date of issue',
|
|
1149
|
+
passport_photo: 'Photo of passport',
|
|
1150
|
+
travel_docs: 'Travel documents',
|
|
1151
|
+
flight_seat_preference: 'Flight seat preference',
|
|
1152
|
+
meal_preference: 'Meals preference',
|
|
1153
|
+
trusted_traveller: 'Known traveler number',
|
|
1154
|
+
redress_number: 'Redress number'
|
|
1155
|
+
},
|
|
1156
|
+
products: {
|
|
1157
|
+
travel: 'Travel',
|
|
1158
|
+
expense: 'Expense'
|
|
1159
|
+
},
|
|
1160
|
+
travel_fyi_approver: 'FYI approver'
|
|
1161
|
+
};
|
|
1227
1162
|
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
_ref$dateFormat = _ref.dateFormat,
|
|
1237
|
-
dateFormat = _ref$dateFormat === void 0 ? 'dd MMM yyyy' : _ref$dateFormat,
|
|
1238
|
-
_ref$errorArray = _ref.errorArray,
|
|
1239
|
-
errorArray = _ref$errorArray === void 0 ? [] : _ref$errorArray,
|
|
1240
|
-
_ref$errorMsg = _ref.errorMsg,
|
|
1241
|
-
errorMsg = _ref$errorMsg === void 0 ? '' : _ref$errorMsg,
|
|
1242
|
-
_ref$showNaOption = _ref.showNaOption,
|
|
1243
|
-
showNaOption = _ref$showNaOption === void 0 ? false : _ref$showNaOption;
|
|
1163
|
+
var IUILocalStorageService$1 = utils.services.IUILocalStorageService;
|
|
1164
|
+
var api = utils.configs.api;
|
|
1165
|
+
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
1166
|
+
var page = _ref.page,
|
|
1167
|
+
tabelName = _ref.tabelName,
|
|
1168
|
+
placeholder = _ref.placeholder,
|
|
1169
|
+
selectCTA = _ref.selectCTA,
|
|
1170
|
+
showNaOption = _ref.showNaOption;
|
|
1244
1171
|
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
isError: errorArray.indexOf(_p.name) !== -1,
|
|
1258
|
-
errorMsg: errorMsg,
|
|
1259
|
-
required: _p.required,
|
|
1260
|
-
readOnly: _p.readOnly,
|
|
1261
|
-
hasInfoIcon: !!_p.tooltip,
|
|
1262
|
-
tooltipText: _p.tooltip,
|
|
1263
|
-
disableText: _p.disableText
|
|
1264
|
-
});
|
|
1172
|
+
try {
|
|
1173
|
+
return Promise.resolve(_catch(function () {
|
|
1174
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
1175
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
1176
|
+
return res.data;
|
|
1177
|
+
})).then(function (response) {
|
|
1178
|
+
var mappedValue = response.results.map(function (item) {
|
|
1179
|
+
return {
|
|
1180
|
+
value: item.id,
|
|
1181
|
+
label: item.name
|
|
1182
|
+
};
|
|
1183
|
+
});
|
|
1265
1184
|
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
required: _p.required
|
|
1270
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIDatePicker, {
|
|
1271
|
-
label: _p.label,
|
|
1272
|
-
fullWidth: _p.fullWidth,
|
|
1273
|
-
hasIcon: _p.hasIcon,
|
|
1274
|
-
size: _p.size,
|
|
1275
|
-
name: _p.name,
|
|
1276
|
-
id: _p.name,
|
|
1277
|
-
dateValue: inputState[_p.name],
|
|
1278
|
-
customHandler: customHandler,
|
|
1279
|
-
displayDateType: dateFormat,
|
|
1280
|
-
placeholder: dateFormat.toUpperCase(),
|
|
1281
|
-
maxDate: _p.maxDate,
|
|
1282
|
-
minDate: _p.minDate,
|
|
1283
|
-
isError: errorArray.indexOf(_p.name) !== -1,
|
|
1284
|
-
errorMsg: errorMsg,
|
|
1285
|
-
disabled: _p.readOnly,
|
|
1286
|
-
hasInfoIcon: !!_p.tooltip,
|
|
1287
|
-
tooltipText: _p.tooltip,
|
|
1288
|
-
required: _p.required,
|
|
1289
|
-
disableText: _p.disableText
|
|
1290
|
-
}));
|
|
1185
|
+
if (showNaOption && page === 1 && NAoptionConfig.applyFor.includes(tabelName)) {
|
|
1186
|
+
mappedValue.unshift(NAoptionConfig.option);
|
|
1187
|
+
}
|
|
1291
1188
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
disableText: _p.disableText
|
|
1189
|
+
if (response.next === null && selectCTA) {
|
|
1190
|
+
mappedValue.push({
|
|
1191
|
+
value: selectCTA.value,
|
|
1192
|
+
label: ''
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
return {
|
|
1197
|
+
options: mappedValue,
|
|
1198
|
+
hasMore: !!response.next,
|
|
1199
|
+
additional: {
|
|
1200
|
+
page: page + 1,
|
|
1201
|
+
tabelName: tabelName,
|
|
1202
|
+
placeholder: placeholder,
|
|
1203
|
+
selectCTA: selectCTA
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1310
1206
|
});
|
|
1207
|
+
}, function () {
|
|
1208
|
+
return {
|
|
1209
|
+
options: [],
|
|
1210
|
+
hasMore: false,
|
|
1211
|
+
additional: {
|
|
1212
|
+
page: 1,
|
|
1213
|
+
tabelName: tabelName,
|
|
1214
|
+
placeholder: placeholder,
|
|
1215
|
+
selectCTA: selectCTA
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
}));
|
|
1219
|
+
} catch (e) {
|
|
1220
|
+
return Promise.reject(e);
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
1224
|
+
var page = _ref3.page;
|
|
1311
1225
|
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
})
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
})
|
|
1226
|
+
try {
|
|
1227
|
+
return Promise.resolve(_catch(function () {
|
|
1228
|
+
return Promise.resolve(api.get(userAddEditUrl.currencyCode() + "&search=" + search + "&page=" + page).then(function (res) {
|
|
1229
|
+
return res.data;
|
|
1230
|
+
})).then(function (response) {
|
|
1231
|
+
var mappedValue = response.results.map(function (item) {
|
|
1232
|
+
return {
|
|
1233
|
+
value: item.currency_code,
|
|
1234
|
+
label: item.currency_code
|
|
1235
|
+
};
|
|
1236
|
+
});
|
|
1237
|
+
return {
|
|
1238
|
+
options: mappedValue,
|
|
1239
|
+
hasMore: !!response.next,
|
|
1240
|
+
additional: {
|
|
1241
|
+
page: page + 1
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
});
|
|
1245
|
+
}, function () {
|
|
1246
|
+
return {
|
|
1247
|
+
options: [],
|
|
1248
|
+
hasMore: false,
|
|
1249
|
+
additional: {
|
|
1250
|
+
page: 1
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
}));
|
|
1254
|
+
} catch (e) {
|
|
1255
|
+
return Promise.reject(e);
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
1259
|
+
var page = _ref4.page,
|
|
1260
|
+
product = _ref4.product,
|
|
1261
|
+
userId = _ref4.userId,
|
|
1262
|
+
placeholder = _ref4.placeholder;
|
|
1331
1263
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1264
|
+
try {
|
|
1265
|
+
return Promise.resolve(_catch(function () {
|
|
1266
|
+
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
1267
|
+
return res.data;
|
|
1268
|
+
})).then(function (response) {
|
|
1269
|
+
var mappedValue = response.results.map(function (item) {
|
|
1270
|
+
return {
|
|
1271
|
+
value: item.approver,
|
|
1272
|
+
label: item.approver
|
|
1273
|
+
};
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1276
|
+
if (page === 1) {
|
|
1277
|
+
var placeholderLbl = {
|
|
1278
|
+
value: '',
|
|
1279
|
+
label: placeholder
|
|
1280
|
+
};
|
|
1281
|
+
mappedValue.unshift(placeholderLbl);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
return {
|
|
1285
|
+
options: mappedValue,
|
|
1286
|
+
hasMore: !!response.next,
|
|
1287
|
+
additional: {
|
|
1288
|
+
page: page + 1,
|
|
1289
|
+
product: product,
|
|
1290
|
+
userId: userId
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1343
1293
|
});
|
|
1294
|
+
}, function () {
|
|
1295
|
+
return {
|
|
1296
|
+
options: [],
|
|
1297
|
+
hasMore: false,
|
|
1298
|
+
additional: {
|
|
1299
|
+
page: 1,
|
|
1300
|
+
product: product,
|
|
1301
|
+
userId: userId
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
}));
|
|
1305
|
+
} catch (e) {
|
|
1306
|
+
return Promise.reject(e);
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
1310
|
+
var page = _ref5.page,
|
|
1311
|
+
tabelName = _ref5.tabelName;
|
|
1344
1312
|
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1313
|
+
try {
|
|
1314
|
+
return Promise.resolve(_catch(function () {
|
|
1315
|
+
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
1316
|
+
return res.data;
|
|
1317
|
+
})).then(function (response) {
|
|
1318
|
+
var mappedValue = response.results.map(function (item) {
|
|
1319
|
+
return {
|
|
1320
|
+
value: item[tabelName],
|
|
1321
|
+
label: item[tabelName]
|
|
1322
|
+
};
|
|
1323
|
+
});
|
|
1324
|
+
return {
|
|
1325
|
+
options: mappedValue,
|
|
1326
|
+
hasMore: !!response.next,
|
|
1327
|
+
additional: {
|
|
1328
|
+
page: page + 1,
|
|
1329
|
+
tabelName: tabelName
|
|
1330
|
+
}
|
|
1331
|
+
};
|
|
1332
|
+
});
|
|
1333
|
+
}, function () {
|
|
1334
|
+
return {
|
|
1335
|
+
options: [],
|
|
1336
|
+
hasMore: false,
|
|
1337
|
+
additional: {
|
|
1338
|
+
page: 1,
|
|
1339
|
+
tabelName: tabelName
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1342
|
+
}));
|
|
1343
|
+
} catch (e) {
|
|
1344
|
+
return Promise.reject(e);
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
1348
|
+
var page = _ref6.page,
|
|
1349
|
+
placeholder = _ref6.placeholder;
|
|
1350
|
+
|
|
1351
|
+
try {
|
|
1352
|
+
return Promise.resolve(_catch(function () {
|
|
1353
|
+
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
1354
|
+
var token = IUILocalStorageService$1.getAccessToken();
|
|
1355
|
+
return Promise.resolve(axios.get(url, {
|
|
1356
|
+
headers: {
|
|
1357
|
+
Authorization: 'Bearer ' + token
|
|
1358
|
+
}
|
|
1359
|
+
})).then(function (response) {
|
|
1360
|
+
return Promise.resolve(response.data.results.map(function (item) {
|
|
1361
|
+
return {
|
|
1362
|
+
value: item.id,
|
|
1363
|
+
label: item.name
|
|
1364
|
+
};
|
|
1365
|
+
})).then(function (mappedValue) {
|
|
1366
|
+
if (placeholder) {
|
|
1367
|
+
var placeholderLbl = {
|
|
1368
|
+
value: '',
|
|
1369
|
+
label: placeholder
|
|
1370
|
+
};
|
|
1371
|
+
mappedValue.unshift(placeholderLbl);
|
|
1372
|
+
}
|
|
1370
1373
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
+
return {
|
|
1375
|
+
options: mappedValue,
|
|
1376
|
+
hasMore: !!response.data.next,
|
|
1377
|
+
additional: {
|
|
1378
|
+
page: page + 1,
|
|
1379
|
+
placeholder: placeholder
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
});
|
|
1383
|
+
});
|
|
1384
|
+
}, function () {
|
|
1385
|
+
return {
|
|
1386
|
+
options: [],
|
|
1387
|
+
hasMore: false,
|
|
1374
1388
|
additional: {
|
|
1375
1389
|
page: 1,
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
},
|
|
1383
|
-
label: _p.label,
|
|
1384
|
-
secondaryLabel: _p.secondaryLabel,
|
|
1385
|
-
title: _p.title,
|
|
1386
|
-
value: inputState[_p.name],
|
|
1387
|
-
name: _p.name,
|
|
1388
|
-
customSelectHandler: customHandler,
|
|
1389
|
-
inputType: _p.inputType,
|
|
1390
|
-
loadOption: _p.loadOption,
|
|
1391
|
-
isError: errorArray.indexOf(_p.name) !== -1,
|
|
1392
|
-
errorMsg: errorMsg,
|
|
1393
|
-
required: _p.required,
|
|
1394
|
-
readOnly: _p.readOnly,
|
|
1395
|
-
placeHolderCheck: inputState[_p.name] !== undefined && inputState[_p.name].value === '',
|
|
1396
|
-
hasInfoIcon: !!_p.tooltip,
|
|
1397
|
-
tooltipText: _p.tooltip,
|
|
1398
|
-
disableText: _p.disableText,
|
|
1399
|
-
selectCTA: _p.selectCTA,
|
|
1400
|
-
clearCache: _p.clearCache
|
|
1401
|
-
});
|
|
1402
|
-
|
|
1403
|
-
default:
|
|
1404
|
-
return null;
|
|
1390
|
+
placeholder: placeholder
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
}));
|
|
1394
|
+
} catch (e) {
|
|
1395
|
+
return Promise.reject(e);
|
|
1405
1396
|
}
|
|
1406
|
-
}
|
|
1397
|
+
};
|
|
1407
1398
|
|
|
1408
1399
|
var UserRole = function UserRole(_ref) {
|
|
1409
1400
|
var _ref$list = _ref.list,
|
|
@@ -1933,12 +1924,12 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1933
1924
|
return new Promise(function (resolve, reject) {
|
|
1934
1925
|
var _travelApprovers = getState().userAddEdit.renderFields.travelApprovers;
|
|
1935
1926
|
var sNo = _travelApprovers.length + 1;
|
|
1936
|
-
var label = "Travel
|
|
1927
|
+
var label = "Travel person " + sNo;
|
|
1937
1928
|
|
|
1938
1929
|
_travelApprovers.forEach(function (approver) {
|
|
1939
1930
|
if (approver.label === label) {
|
|
1940
1931
|
sNo++;
|
|
1941
|
-
label = "Travel
|
|
1932
|
+
label = "Travel person " + sNo;
|
|
1942
1933
|
}
|
|
1943
1934
|
});
|
|
1944
1935
|
|
|
@@ -1977,12 +1968,12 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1977
1968
|
return new Promise(function (resolve, reject) {
|
|
1978
1969
|
var _expenseApprovers = getState().userAddEdit.renderFields.expenseApprovers;
|
|
1979
1970
|
var sNo = _expenseApprovers.length + 1;
|
|
1980
|
-
var label = "Expense
|
|
1971
|
+
var label = "Expense person " + sNo;
|
|
1981
1972
|
|
|
1982
1973
|
_expenseApprovers.forEach(function (approver) {
|
|
1983
1974
|
if (approver.label === label) {
|
|
1984
1975
|
sNo++;
|
|
1985
|
-
label = "Expense
|
|
1976
|
+
label = "Expense person " + sNo;
|
|
1986
1977
|
}
|
|
1987
1978
|
});
|
|
1988
1979
|
|
|
@@ -2294,33 +2285,6 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
|
2294
2285
|
});
|
|
2295
2286
|
};
|
|
2296
2287
|
};
|
|
2297
|
-
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
2298
|
-
return function (dispatch) {
|
|
2299
|
-
return new Promise(function (resolve, reject) {
|
|
2300
|
-
api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
2301
|
-
console.log(res);
|
|
2302
|
-
|
|
2303
|
-
if (res.data.status === true) {
|
|
2304
|
-
var _res$data5;
|
|
2305
|
-
|
|
2306
|
-
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.');
|
|
2307
|
-
resolve(res.data);
|
|
2308
|
-
} else {
|
|
2309
|
-
var _res$data6;
|
|
2310
|
-
|
|
2311
|
-
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.');
|
|
2312
|
-
reject(res);
|
|
2313
|
-
}
|
|
2314
|
-
})["catch"](function (err) {
|
|
2315
|
-
var _err$response11, _err$response11$data;
|
|
2316
|
-
|
|
2317
|
-
console.log(err);
|
|
2318
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response11 = err.response) === null || _err$response11 === void 0 ? void 0 : (_err$response11$data = _err$response11.data) === null || _err$response11$data === void 0 ? void 0 : _err$response11$data.message) || 'Opps, Unable to reject user.');
|
|
2319
|
-
reject(err);
|
|
2320
|
-
});
|
|
2321
|
-
});
|
|
2322
|
-
};
|
|
2323
|
-
};
|
|
2324
2288
|
|
|
2325
2289
|
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
2326
2290
|
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
@@ -2464,98 +2428,85 @@ var closeDialog = function closeDialog() {
|
|
|
2464
2428
|
type: CLOSE_DIALOG
|
|
2465
2429
|
};
|
|
2466
2430
|
};
|
|
2467
|
-
var
|
|
2468
|
-
return function (dispatch) {
|
|
2469
|
-
return new Promise(function (resolve, reject) {
|
|
2470
|
-
api$3.get(userPanelUrl.getPaginationUnit(tableName, length, page)).then(function (res) {
|
|
2471
|
-
dispatch({
|
|
2472
|
-
type: FETCH_USERPANEL_DATA,
|
|
2473
|
-
payload: res.data
|
|
2474
|
-
});
|
|
2475
|
-
dispatch(userPanelStopLoader());
|
|
2476
|
-
resolve();
|
|
2477
|
-
})["catch"](function () {
|
|
2478
|
-
dispatch(userPanelStopLoader());
|
|
2479
|
-
});
|
|
2480
|
-
});
|
|
2481
|
-
};
|
|
2482
|
-
};
|
|
2483
|
-
var getUserPanalData = function getUserPanalData(tableName, length) {
|
|
2431
|
+
var getUserPanalData = function getUserPanalData(params) {
|
|
2484
2432
|
return function (dispatch) {
|
|
2485
2433
|
return new Promise(function (resolve, reject) {
|
|
2486
|
-
api$3.get(userPanelUrl.
|
|
2434
|
+
api$3.get(userPanelUrl.getPaginationUnit(params.tableName, params.rowsPerPage, params.page, params.orderingParam)).then(function (res) {
|
|
2487
2435
|
dispatch({
|
|
2488
2436
|
type: FETCH_USERPANEL_DATA,
|
|
2489
2437
|
payload: res.data
|
|
2490
2438
|
});
|
|
2491
2439
|
dispatch(userPanelStopLoader());
|
|
2492
2440
|
resolve();
|
|
2493
|
-
})["catch"](function () {
|
|
2441
|
+
})["catch"](function (err) {
|
|
2442
|
+
var _err$response, _err$response$data;
|
|
2443
|
+
|
|
2494
2444
|
dispatch(userPanelStopLoader());
|
|
2445
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || 'Opps, Something went wrong.');
|
|
2495
2446
|
});
|
|
2496
2447
|
});
|
|
2497
2448
|
};
|
|
2498
2449
|
};
|
|
2499
|
-
var addRecord = function addRecord(tableName, data) {
|
|
2450
|
+
var addRecord = function addRecord(tableName, data, getParam) {
|
|
2500
2451
|
return function (dispatch) {
|
|
2501
2452
|
return new Promise(function (resolve, reject) {
|
|
2502
2453
|
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
2503
|
-
dispatch(getUserPanalData(
|
|
2454
|
+
dispatch(getUserPanalData(getParam));
|
|
2504
2455
|
dispatch(closeDialog());
|
|
2505
2456
|
resolve(res);
|
|
2506
2457
|
})["catch"](function (err) {
|
|
2507
|
-
var _err$
|
|
2458
|
+
var _err$response2, _err$response2$data;
|
|
2508
2459
|
|
|
2509
2460
|
dispatch(userPanelStopLoader());
|
|
2510
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
2461
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.message) || 'Opps, Something went wrong.');
|
|
2511
2462
|
});
|
|
2512
2463
|
});
|
|
2513
2464
|
};
|
|
2514
2465
|
};
|
|
2515
|
-
var deleteRecord = function deleteRecord(tableName, id) {
|
|
2466
|
+
var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
2516
2467
|
return function (dispatch) {
|
|
2517
2468
|
return new Promise(function (resolve, reject) {
|
|
2518
2469
|
api$3.post(userPanelUrl.deleteUnit(tableName), id).then(function (res) {
|
|
2519
|
-
dispatch(
|
|
2470
|
+
dispatch(getUserPanalData(getParam));
|
|
2520
2471
|
dispatch(closeDialog());
|
|
2521
2472
|
dispatch(userPanelStopLoader());
|
|
2522
2473
|
resolve();
|
|
2523
2474
|
})["catch"](function (err) {
|
|
2524
|
-
var _err$
|
|
2475
|
+
var _err$response3, _err$response3$data;
|
|
2525
2476
|
|
|
2526
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
2477
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
2527
2478
|
dispatch(userPanelStopLoader());
|
|
2528
2479
|
});
|
|
2529
2480
|
});
|
|
2530
2481
|
};
|
|
2531
2482
|
};
|
|
2532
|
-
var editRecord = function editRecord(tableName, data) {
|
|
2483
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
2533
2484
|
return function (dispatch) {
|
|
2534
2485
|
return new Promise(function (resolve, reject) {
|
|
2535
2486
|
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
2536
|
-
dispatch(
|
|
2487
|
+
dispatch(getUserPanalData(getParam));
|
|
2537
2488
|
dispatch(closeDialog());
|
|
2538
2489
|
resolve();
|
|
2539
2490
|
})["catch"](function (err) {
|
|
2540
|
-
var _err$
|
|
2491
|
+
var _err$response4, _err$response4$data;
|
|
2541
2492
|
|
|
2542
2493
|
dispatch(userPanelStopLoader());
|
|
2543
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
2494
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.message) || 'Opps, Something went wrong.');
|
|
2544
2495
|
});
|
|
2545
2496
|
});
|
|
2546
2497
|
};
|
|
2547
2498
|
};
|
|
2548
|
-
var moveRecord = function moveRecord(tableName, data) {
|
|
2499
|
+
var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
2549
2500
|
return function (dispatch) {
|
|
2550
2501
|
return new Promise(function (resolve, reject) {
|
|
2551
2502
|
api$3.post(userPanelUrl.moveUnit(tableName), data).then(function (res) {
|
|
2552
|
-
dispatch(getUserPanalData(
|
|
2503
|
+
dispatch(getUserPanalData(getParam));
|
|
2553
2504
|
dispatch(closeDialog());
|
|
2554
2505
|
resolve(res);
|
|
2555
2506
|
})["catch"](function (err) {
|
|
2556
|
-
var _err$
|
|
2507
|
+
var _err$response5, _err$response5$data;
|
|
2557
2508
|
|
|
2558
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
2509
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.message) || 'Opps, Something went wrong.');
|
|
2559
2510
|
});
|
|
2560
2511
|
});
|
|
2561
2512
|
};
|
|
@@ -2801,10 +2752,8 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2801
2752
|
var AddCard = function AddCard(_ref2) {
|
|
2802
2753
|
var pg = _ref2.pg;
|
|
2803
2754
|
|
|
2804
|
-
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2805
|
-
|
|
2806
2755
|
var handleAddCard = function handleAddCard() {
|
|
2807
|
-
window.location.assign(
|
|
2756
|
+
window.location.assign(env$3.getPaymentUrl() + "/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2808
2757
|
};
|
|
2809
2758
|
|
|
2810
2759
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3005,13 +2954,13 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3005
2954
|
var rgx = null;
|
|
3006
2955
|
|
|
3007
2956
|
if (type === 'travel') {
|
|
3008
|
-
rgx = /^(travel
|
|
2957
|
+
rgx = /^(travel person)( )[0-9]*$/i;
|
|
3009
2958
|
} else {
|
|
3010
|
-
rgx = /^(expense
|
|
2959
|
+
rgx = /^(expense person)( )[0-9]*$/i;
|
|
3011
2960
|
}
|
|
3012
2961
|
|
|
3013
|
-
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + "
|
|
3014
|
-
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2962
|
+
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + " person " + (editedLabel.approvers[i].indexAt + 1)) {
|
|
2963
|
+
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + " person " + (editedLabel.approvers[i].indexAt + 1) + "' to '" + editedLabel.approvers[i].label + "'";
|
|
3015
2964
|
|
|
3016
2965
|
if (!hasError) {
|
|
3017
2966
|
hasError = true;
|
|
@@ -3126,10 +3075,10 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3126
3075
|
return null;
|
|
3127
3076
|
}
|
|
3128
3077
|
|
|
3129
|
-
if (p.label.toLowerCase() === type + "
|
|
3078
|
+
if (p.label.toLowerCase() === type + " person " + (i + 1)) {
|
|
3130
3079
|
p.secondaryLabel = '';
|
|
3131
3080
|
} else {
|
|
3132
|
-
p.secondaryLabel = type + "
|
|
3081
|
+
p.secondaryLabel = type + " person " + (i + 1);
|
|
3133
3082
|
}
|
|
3134
3083
|
|
|
3135
3084
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
@@ -3245,7 +3194,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3245
3194
|
className: styles.fieldMargin
|
|
3246
3195
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
3247
3196
|
defaultValue: p.label,
|
|
3248
|
-
label: (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
3197
|
+
label: (type === 'travel' ? 'Travel' : 'Expense') + " person " + (i + 1),
|
|
3249
3198
|
className: styles.inputWidth,
|
|
3250
3199
|
id: type + '_' + p.sequence,
|
|
3251
3200
|
name: type + '_' + p.sequence,
|
|
@@ -3506,7 +3455,9 @@ var initialState = {
|
|
|
3506
3455
|
secureTravelInfo: secureTravelInfo,
|
|
3507
3456
|
disableText: '',
|
|
3508
3457
|
travelRoles: travelConstants.roles,
|
|
3509
|
-
expenseRoles: expenseConstants.roles
|
|
3458
|
+
expenseRoles: expenseConstants.roles,
|
|
3459
|
+
travelConstants: travelConstants,
|
|
3460
|
+
expenseConstants: expenseConstants
|
|
3510
3461
|
},
|
|
3511
3462
|
dropdownList: dropdownList,
|
|
3512
3463
|
maxTravelApprovers: 10,
|
|
@@ -3541,6 +3492,10 @@ var reducer = function reducer(state, action) {
|
|
|
3541
3492
|
{
|
|
3542
3493
|
var _action$payload, _action$payload$appro, _action$payload$appro2, _action$payload2, _action$payload2$appr, _action$payload2$appr2, _action$payload3, _action$payload3$trav, _action$payload4, _action$payload4$expe, _action$payload5, _action$payload5$flig, _action$payload6, _action$payload6$meal, _action$payload7;
|
|
3543
3494
|
|
|
3495
|
+
if (!action.payload.labels) {
|
|
3496
|
+
action.payload.labels = userAddPageFormLabels;
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3544
3499
|
var renderFields = _extends({}, state.renderFields);
|
|
3545
3500
|
|
|
3546
3501
|
var _action$payload$visib = action.payload.visibility,
|
|
@@ -3551,14 +3506,36 @@ var reducer = function reducer(state, action) {
|
|
|
3551
3506
|
userPersonalInfoOptionalFields = _action$payload$optio.user_personal_info,
|
|
3552
3507
|
employeeInfoOptionalFields = _action$payload$optio.employee_info,
|
|
3553
3508
|
userTravelInfoOptionalFields = _action$payload$optio.user_travel_info;
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3509
|
+
var _action$payload$label = action.payload.labels,
|
|
3510
|
+
userPersonalInfoLabels = _action$payload$label.user_personal_info,
|
|
3511
|
+
employeeInfoLabels = _action$payload$label.employee_info,
|
|
3512
|
+
userTravelInfoLabels = _action$payload$label.user_travel_info,
|
|
3513
|
+
productLabels = _action$payload$label.products,
|
|
3514
|
+
travelFYIlabel = _action$payload$label.travel_fyi_approver,
|
|
3515
|
+
expenseFYIlabel = _action$payload$label.expense_fyi_approver;
|
|
3516
|
+
renderFields.personalInfo = setFieldsDisplayAtt(renderFields.personalInfo, userPersonalInfo, userPersonalInfoOptionalFields, userPersonalInfoLabels);
|
|
3517
|
+
renderFields.workInfo = setFieldsDisplayAtt(renderFields.workInfo, employeeInfo, employeeInfoOptionalFields, employeeInfoLabels);
|
|
3518
|
+
renderFields.passportInfo = setFieldsDisplayAtt(renderFields.passportInfo, userTravelInfo, userTravelInfoOptionalFields, userTravelInfoLabels);
|
|
3519
|
+
renderFields.travelPreference = setFieldsDisplayAtt(renderFields.travelPreference, userTravelInfo, userTravelInfoOptionalFields, userTravelInfoLabels);
|
|
3520
|
+
renderFields.secureTravelInfo = setFieldsDisplayAtt(renderFields.secureTravelInfo, userTravelInfo, userTravelInfoOptionalFields, userTravelInfoLabels);
|
|
3559
3521
|
renderFields.products = renderFields.products.filter(function (product) {
|
|
3560
3522
|
return action.payload.products.includes(product.name);
|
|
3523
|
+
}).map(function (product) {
|
|
3524
|
+
if (productLabels && Object.hasOwnProperty.call(productLabels, product.name)) {
|
|
3525
|
+
product.label = productLabels[product.name];
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
return product;
|
|
3561
3529
|
});
|
|
3530
|
+
|
|
3531
|
+
if (travelFYIlabel) {
|
|
3532
|
+
renderFields.travelConstants.FYILabel = travelFYIlabel;
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
if (expenseFYIlabel) {
|
|
3536
|
+
renderFields.expenseConstants.FYILabel = expenseFYIlabel;
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3562
3539
|
renderFields.custom_attributes = action.payload.custom_attributes;
|
|
3563
3540
|
|
|
3564
3541
|
if (action !== null && action !== void 0 && (_action$payload = action.payload) !== null && _action$payload !== void 0 && (_action$payload$appro = _action$payload.approvers) !== null && _action$payload$appro !== void 0 && (_action$payload$appro2 = _action$payload$appro.travel) !== null && _action$payload$appro2 !== void 0 && _action$payload$appro2.length) {
|
|
@@ -3815,7 +3792,7 @@ var reducer = function reducer(state, action) {
|
|
|
3815
3792
|
}
|
|
3816
3793
|
};
|
|
3817
3794
|
|
|
3818
|
-
var setFieldsDisplayAtt = function setFieldsDisplayAtt(objToLoop, visibilityObj, optionalObj) {
|
|
3795
|
+
var setFieldsDisplayAtt = function setFieldsDisplayAtt(objToLoop, visibilityObj, optionalObj, labelsObj) {
|
|
3819
3796
|
return objToLoop.map(function (p) {
|
|
3820
3797
|
var key = p.name;
|
|
3821
3798
|
|
|
@@ -3841,6 +3818,10 @@ var setFieldsDisplayAtt = function setFieldsDisplayAtt(objToLoop, visibilityObj,
|
|
|
3841
3818
|
p.required = false;
|
|
3842
3819
|
}
|
|
3843
3820
|
|
|
3821
|
+
if (labelsObj && Object.hasOwnProperty.call(labelsObj, p.name)) {
|
|
3822
|
+
p.label = labelsObj[p.name];
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3844
3825
|
return p;
|
|
3845
3826
|
});
|
|
3846
3827
|
};
|
|
@@ -5094,11 +5075,16 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5094
5075
|
} else if (id === 'department') {
|
|
5095
5076
|
title = 'Department';
|
|
5096
5077
|
} else if (id === 'business_unit') {
|
|
5097
|
-
title = 'Business
|
|
5078
|
+
title = 'Business Unit';
|
|
5098
5079
|
} else if (id === 'employee_level') {
|
|
5099
|
-
title = 'Employee
|
|
5080
|
+
title = 'Employee Level';
|
|
5100
5081
|
}
|
|
5101
5082
|
|
|
5083
|
+
console.log(_extends({}, addModalData, {
|
|
5084
|
+
isOpen: true,
|
|
5085
|
+
title: title,
|
|
5086
|
+
id: id
|
|
5087
|
+
}));
|
|
5102
5088
|
setAddModalData(_extends({}, addModalData, {
|
|
5103
5089
|
isOpen: true,
|
|
5104
5090
|
title: title,
|
|
@@ -5120,6 +5106,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5120
5106
|
})).then(function (res) {
|
|
5121
5107
|
var _extends2;
|
|
5122
5108
|
|
|
5109
|
+
console.log(res, "success add " + addModalData.title + " response");
|
|
5123
5110
|
setAddModalData(_extends({}, addModalData, {
|
|
5124
5111
|
isOpen: false
|
|
5125
5112
|
}));
|
|
@@ -5129,9 +5116,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5129
5116
|
value: res.data.value,
|
|
5130
5117
|
label: res.data.label
|
|
5131
5118
|
}, _extends2)));
|
|
5119
|
+
console.log('Set new value', res.data.label);
|
|
5132
5120
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5133
5121
|
var _extends3;
|
|
5134
5122
|
|
|
5123
|
+
console.log('ClearCache function called');
|
|
5135
5124
|
return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
|
|
5136
5125
|
});
|
|
5137
5126
|
dispatch(stopLoader());
|
|
@@ -5394,7 +5383,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5394
5383
|
if ((_name === 'passport_photo' || _name === 'travel_docs') && _obj.openFile === true) {
|
|
5395
5384
|
if (_obj.file.isExistingFile) {
|
|
5396
5385
|
var link = document.createElement('a');
|
|
5397
|
-
link.setAttribute('
|
|
5386
|
+
link.setAttribute('download', _obj.file.name);
|
|
5398
5387
|
link.href = _obj.file.presigned_url;
|
|
5399
5388
|
document.body.appendChild(link);
|
|
5400
5389
|
link.click();
|
|
@@ -5408,7 +5397,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5408
5397
|
})).then(function (res) {
|
|
5409
5398
|
dispatch(stopLoader());
|
|
5410
5399
|
var link = document.createElement('a');
|
|
5411
|
-
link.setAttribute('
|
|
5400
|
+
link.setAttribute('download', _obj.file.returned_file_name);
|
|
5412
5401
|
link.href = res.data.presigned_url;
|
|
5413
5402
|
document.body.appendChild(link);
|
|
5414
5403
|
link.click();
|
|
@@ -5891,7 +5880,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5891
5880
|
userTagType: userTagType
|
|
5892
5881
|
};
|
|
5893
5882
|
|
|
5894
|
-
if (verifyUserId
|
|
5883
|
+
if (verifyUserId) {
|
|
5895
5884
|
payload.verifyUserId = verifyUserId;
|
|
5896
5885
|
}
|
|
5897
5886
|
|
|
@@ -6211,10 +6200,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6211
6200
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6212
6201
|
}
|
|
6213
6202
|
}
|
|
6214
|
-
} else if (verifyUserId
|
|
6203
|
+
} else if (verifyUserId) {
|
|
6215
6204
|
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
6216
6205
|
|
|
6217
|
-
(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) &&
|
|
6206
|
+
(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);
|
|
6218
6207
|
} else {
|
|
6219
6208
|
var _config$routes5, _config$routes5$users, _config$routes5$users2;
|
|
6220
6209
|
|
|
@@ -6239,7 +6228,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6239
6228
|
};
|
|
6240
6229
|
|
|
6241
6230
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
6242
|
-
if (verifyUserId
|
|
6231
|
+
if (verifyUserId) {
|
|
6243
6232
|
dispatch(showLoader());
|
|
6244
6233
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6245
6234
|
setPersonalInfoInput(function (prevState) {
|
|
@@ -6341,19 +6330,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6341
6330
|
}
|
|
6342
6331
|
};
|
|
6343
6332
|
|
|
6344
|
-
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
6345
|
-
if (verifyUserId && isILadmin) {
|
|
6346
|
-
dispatch(showLoader());
|
|
6347
|
-
dispatch(rejectUserVerification(verifyUserId)).then(function (res) {
|
|
6348
|
-
setTimeout(function () {
|
|
6349
|
-
window.location.assign(config.routes.signupRequest.list.path);
|
|
6350
|
-
}, 1500);
|
|
6351
|
-
})["finally"](function () {
|
|
6352
|
-
dispatch(stopLoader());
|
|
6353
|
-
});
|
|
6354
|
-
}
|
|
6355
|
-
};
|
|
6356
|
-
|
|
6357
6333
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6358
6334
|
component: "div",
|
|
6359
6335
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6370,7 +6346,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6370
6346
|
className: styles.breadcrumb
|
|
6371
6347
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBreadCrumb, {
|
|
6372
6348
|
breadCrumbs: [{
|
|
6373
|
-
href: verifyUserId
|
|
6349
|
+
href: verifyUserId ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6374
6350
|
label: 'Users',
|
|
6375
6351
|
hasLink: true
|
|
6376
6352
|
}]
|
|
@@ -6405,14 +6381,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6405
6381
|
type: "contained",
|
|
6406
6382
|
onClick: formSubmitHandler,
|
|
6407
6383
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
6408
|
-
})),
|
|
6409
|
-
component: "div",
|
|
6410
|
-
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
6411
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
6412
|
-
buttonText: "Reject",
|
|
6413
|
-
type: "outlined",
|
|
6414
|
-
onClick: handleSignUpRequestRejection
|
|
6415
|
-
})) : null))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6384
|
+
}))))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6416
6385
|
component: "div",
|
|
6417
6386
|
marginTop: "8rem",
|
|
6418
6387
|
flexDirection: "column"
|
|
@@ -6595,7 +6564,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6595
6564
|
className: styles.dividerColor
|
|
6596
6565
|
}), productAccess && productAccess.travel && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(TravelExpenseFields, {
|
|
6597
6566
|
fieldsInfo: renderFields.travelApprovers,
|
|
6598
|
-
travelConstants: travelConstants,
|
|
6567
|
+
travelConstants: renderFields.travelConstants,
|
|
6599
6568
|
type: "travel",
|
|
6600
6569
|
addFields: function addFields() {
|
|
6601
6570
|
return dispatch(addTravelApproverField());
|
|
@@ -6633,7 +6602,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6633
6602
|
className: styles.dividerColor
|
|
6634
6603
|
}), productAccess && productAccess.expense && /*#__PURE__*/React__default.createElement(TravelExpenseFields, {
|
|
6635
6604
|
fieldsInfo: renderFields.expenseApprovers,
|
|
6636
|
-
travelConstants: expenseConstants,
|
|
6605
|
+
travelConstants: renderFields.expenseConstants,
|
|
6637
6606
|
type: "expense",
|
|
6638
6607
|
addFields: function addFields() {
|
|
6639
6608
|
return dispatch(addExpenseApproverField());
|
|
@@ -8930,9 +8899,13 @@ var index$2 = withStore(UserList);
|
|
|
8930
8899
|
|
|
8931
8900
|
function Header(props) {
|
|
8932
8901
|
var HeaderButton = props.HeaderButton,
|
|
8933
|
-
name = props.name,
|
|
8934
|
-
|
|
8935
|
-
|
|
8902
|
+
_props$name = props.name,
|
|
8903
|
+
name = _props$name === void 0 ? '' : _props$name,
|
|
8904
|
+
_props$headingName = props.headingName,
|
|
8905
|
+
headingName = _props$headingName === void 0 ? '' : _props$headingName,
|
|
8906
|
+
_props$subHeading = props.subHeading,
|
|
8907
|
+
subHeading = _props$subHeading === void 0 ? '' : _props$subHeading,
|
|
8908
|
+
loading = props.loading;
|
|
8936
8909
|
|
|
8937
8910
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
8938
8911
|
return state.common;
|
|
@@ -8965,7 +8938,7 @@ function Header(props) {
|
|
|
8965
8938
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8966
8939
|
variant: "h3",
|
|
8967
8940
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8968
|
-
}, isILadmin === 1 && companyName + " - ",
|
|
8941
|
+
}, isILadmin === 1 && companyName !== null && companyName + " - ", ' ', headingName)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8969
8942
|
component: "div",
|
|
8970
8943
|
className: styles$5.headingWrapper
|
|
8971
8944
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
@@ -8982,6 +8955,7 @@ function Header(props) {
|
|
|
8982
8955
|
component: "div",
|
|
8983
8956
|
className: "pageHeader--button-single button-right"
|
|
8984
8957
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8958
|
+
disabled: loading,
|
|
8985
8959
|
type: "contained",
|
|
8986
8960
|
buttonText: "+ Add " + name.toLowerCase(),
|
|
8987
8961
|
onClick: HeaderButton
|
|
@@ -8998,31 +8972,18 @@ var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sideb
|
|
|
8998
8972
|
function Listview(_ref) {
|
|
8999
8973
|
var data = _ref.data,
|
|
9000
8974
|
name = _ref.name,
|
|
9001
|
-
tableName = _ref.tableName,
|
|
9002
8975
|
handleEditDialog = _ref.handleEditDialog,
|
|
9003
|
-
handleDeleteDialog = _ref.handleDeleteDialog
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
var handleChangePage = function handleChangePage(e, newPage) {
|
|
9015
|
-
setPage(newPage);
|
|
9016
|
-
};
|
|
9017
|
-
|
|
9018
|
-
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9019
|
-
setRowsPerPage(+event.target.value);
|
|
9020
|
-
setPage(1);
|
|
9021
|
-
};
|
|
9022
|
-
|
|
9023
|
-
React.useEffect(function () {
|
|
9024
|
-
dispatch(getUserPanalOnPageChange(tableName, rowsPerPage, page));
|
|
9025
|
-
}, [rowsPerPage, page]);
|
|
8976
|
+
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
8977
|
+
orderBy = _ref.orderBy,
|
|
8978
|
+
order = _ref.order,
|
|
8979
|
+
_ref$onRequestSort = _ref.onRequestSort,
|
|
8980
|
+
onRequestSort = _ref$onRequestSort === void 0 ? function () {} : _ref$onRequestSort,
|
|
8981
|
+
_ref$handleChangeRows = _ref.handleChangeRowsPerPage,
|
|
8982
|
+
handleChangeRowsPerPage = _ref$handleChangeRows === void 0 ? function () {} : _ref$handleChangeRows,
|
|
8983
|
+
_ref$handleChangePage = _ref.handleChangePage,
|
|
8984
|
+
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
8985
|
+
page = _ref.page,
|
|
8986
|
+
rowsPerPage = _ref.rowsPerPage;
|
|
9026
8987
|
var columns = [{
|
|
9027
8988
|
id: 'name',
|
|
9028
8989
|
label: name,
|
|
@@ -9037,6 +8998,7 @@ function Listview(_ref) {
|
|
|
9037
8998
|
id: 'no_of_users',
|
|
9038
8999
|
label: 'Number of users',
|
|
9039
9000
|
width: '45%',
|
|
9001
|
+
sortable: true,
|
|
9040
9002
|
cell: function cell(row) {
|
|
9041
9003
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9042
9004
|
component: "div"
|
|
@@ -9073,16 +9035,19 @@ function Listview(_ref) {
|
|
|
9073
9035
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9074
9036
|
p: 3
|
|
9075
9037
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITable, {
|
|
9076
|
-
hasFilter: false,
|
|
9077
|
-
isCheckboxTable: false,
|
|
9078
9038
|
searchHide: true,
|
|
9039
|
+
hasFilter: true,
|
|
9040
|
+
isCheckboxTable: false,
|
|
9079
9041
|
count: data.count,
|
|
9080
9042
|
columns: columns,
|
|
9081
9043
|
rows: data.results,
|
|
9082
9044
|
page: page,
|
|
9083
9045
|
handleChangePage: handleChangePage,
|
|
9084
9046
|
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
9085
|
-
rowsPerPage: rowsPerPage
|
|
9047
|
+
rowsPerPage: rowsPerPage,
|
|
9048
|
+
orderBy: orderBy,
|
|
9049
|
+
order: order,
|
|
9050
|
+
onRequestSort: onRequestSort
|
|
9086
9051
|
})));
|
|
9087
9052
|
}
|
|
9088
9053
|
|
|
@@ -9258,7 +9223,7 @@ function MoveUserDialog(_ref) {
|
|
|
9258
9223
|
name: name,
|
|
9259
9224
|
isMove: isMove,
|
|
9260
9225
|
customSelectHandler: customSelectHandler,
|
|
9261
|
-
loadOption:
|
|
9226
|
+
loadOption: commonLoadOptions,
|
|
9262
9227
|
isError: isError,
|
|
9263
9228
|
errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
|
|
9264
9229
|
placeHolderCheck: name !== undefined && name === ''
|
|
@@ -9364,6 +9329,32 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9364
9329
|
alertModal = _useState11[0],
|
|
9365
9330
|
setAlertModal = _useState11[1];
|
|
9366
9331
|
|
|
9332
|
+
var _React$useState = React__default.useState('asc'),
|
|
9333
|
+
order = _React$useState[0],
|
|
9334
|
+
setOrder = _React$useState[1];
|
|
9335
|
+
|
|
9336
|
+
var _React$useState2 = React__default.useState('name'),
|
|
9337
|
+
orderBy = _React$useState2[0],
|
|
9338
|
+
setOrderBy = _React$useState2[1];
|
|
9339
|
+
|
|
9340
|
+
var _useState12 = React.useState(false),
|
|
9341
|
+
isSortingChange = _useState12[0],
|
|
9342
|
+
setSortingChange = _useState12[1];
|
|
9343
|
+
|
|
9344
|
+
var _useState13 = React.useState(false),
|
|
9345
|
+
isSortingChangeTemp = _useState13[0],
|
|
9346
|
+
setSortingChangeTemp = _useState13[1];
|
|
9347
|
+
|
|
9348
|
+
var _useState14 = React.useState(1),
|
|
9349
|
+
page = _useState14[0],
|
|
9350
|
+
setPage = _useState14[1];
|
|
9351
|
+
|
|
9352
|
+
var _useState15 = React.useState(5),
|
|
9353
|
+
rowsPerPage = _useState15[0],
|
|
9354
|
+
setRowsPerPage = _useState15[1];
|
|
9355
|
+
|
|
9356
|
+
var orderingParam = orderBy;
|
|
9357
|
+
|
|
9367
9358
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9368
9359
|
return state.userPanel;
|
|
9369
9360
|
}),
|
|
@@ -9393,16 +9384,37 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9393
9384
|
React.useEffect(function () {
|
|
9394
9385
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
9395
9386
|
dispatch(verifyAccessToken(roleCanAccess));
|
|
9387
|
+
window.scrollTo(0, 0);
|
|
9396
9388
|
}, []);
|
|
9397
9389
|
React.useEffect(function () {
|
|
9398
9390
|
dispatch(userPanelShowLoader());
|
|
9399
9391
|
|
|
9400
9392
|
if (isTokenVerified) {
|
|
9401
|
-
|
|
9402
|
-
return dispatch(userPanelStopLoader());
|
|
9403
|
-
});
|
|
9393
|
+
calApiPanelList();
|
|
9404
9394
|
}
|
|
9405
|
-
}, [isTokenVerified]);
|
|
9395
|
+
}, [isTokenVerified, isSortingChangeTemp]);
|
|
9396
|
+
|
|
9397
|
+
var calApiPanelList = function calApiPanelList() {
|
|
9398
|
+
dispatch(getUserPanalData(getApiData())).then(function () {
|
|
9399
|
+
return dispatch(userPanelStopLoader());
|
|
9400
|
+
})["finally"](function () {
|
|
9401
|
+
if (isSortingChange) {
|
|
9402
|
+
setSortingChange(false);
|
|
9403
|
+
}
|
|
9404
|
+
});
|
|
9405
|
+
};
|
|
9406
|
+
|
|
9407
|
+
var getApiData = function getApiData() {
|
|
9408
|
+
orderingParam = order === 'asc' ? orderBy : '-' + orderBy;
|
|
9409
|
+
var urlData = {
|
|
9410
|
+
tableName: tableName,
|
|
9411
|
+
rowsPerPage: rowsPerPage,
|
|
9412
|
+
page: page,
|
|
9413
|
+
orderingParam: orderingParam
|
|
9414
|
+
};
|
|
9415
|
+
return urlData;
|
|
9416
|
+
};
|
|
9417
|
+
|
|
9406
9418
|
React.useEffect(function () {
|
|
9407
9419
|
var arrList = userPanelData.results.filter(function (item) {
|
|
9408
9420
|
return item.name !== dialogData.data.name;
|
|
@@ -9461,48 +9473,61 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9461
9473
|
var handleAddUserPanel = function handleAddUserPanel() {
|
|
9462
9474
|
if (dataList) {
|
|
9463
9475
|
setErrorAdd(false);
|
|
9464
|
-
|
|
9465
|
-
dispatch(addRecord(tableName, {
|
|
9476
|
+
var payload = {
|
|
9466
9477
|
names: [dataList]
|
|
9467
|
-
}
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
dispatch(userPanelStopLoader());
|
|
9471
|
-
setDataList('');
|
|
9472
|
-
});
|
|
9478
|
+
};
|
|
9479
|
+
var message = title + " added successfully.";
|
|
9480
|
+
handleApiCall(addRecord, payload, message, 'add');
|
|
9473
9481
|
} else {
|
|
9474
9482
|
setErrorAdd(true);
|
|
9475
9483
|
}
|
|
9476
9484
|
};
|
|
9477
9485
|
|
|
9478
|
-
var handleDeletePanel = function handleDeletePanel(
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
+
var handleDeletePanel = function handleDeletePanel() {
|
|
9487
|
+
var payload = {
|
|
9488
|
+
row_ids: [dialogData.data.id]
|
|
9489
|
+
};
|
|
9490
|
+
var message = title + " deleted successfully.";
|
|
9491
|
+
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9492
|
+
};
|
|
9493
|
+
|
|
9494
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
9495
|
+
dispatch(userPanelShowLoader());
|
|
9496
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
9497
|
+
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9498
|
+
dispatch(userPanelStopLoader());
|
|
9499
|
+
|
|
9500
|
+
if (type === 'delete') {
|
|
9486
9501
|
closeDeleteModal();
|
|
9487
|
-
}
|
|
9488
|
-
|
|
9502
|
+
}
|
|
9503
|
+
|
|
9504
|
+
if (type === 'add') {
|
|
9505
|
+
closeDeActivateModal();
|
|
9506
|
+
setDataList('');
|
|
9507
|
+
}
|
|
9508
|
+
|
|
9509
|
+
if (type === 'move') {
|
|
9510
|
+
setMoveModal(false);
|
|
9511
|
+
dispatch(closeDialog());
|
|
9512
|
+
setSelectValue('');
|
|
9513
|
+
}
|
|
9514
|
+
|
|
9515
|
+
if (type === 'edit') {
|
|
9516
|
+
closeEditDialog();
|
|
9517
|
+
setDataList('');
|
|
9518
|
+
}
|
|
9519
|
+
});
|
|
9489
9520
|
};
|
|
9490
9521
|
|
|
9491
9522
|
var handleMovePanel = function handleMovePanel() {
|
|
9492
9523
|
if (selectValue) {
|
|
9493
|
-
|
|
9494
|
-
dispatch(userPanelShowLoader());
|
|
9495
|
-
dispatch(moveRecord(tableName, {
|
|
9524
|
+
var payload = {
|
|
9496
9525
|
table_name: tableName,
|
|
9497
9526
|
from: dialogData.data.name,
|
|
9498
9527
|
to: selectValue === null || selectValue === void 0 ? void 0 : selectValue.label
|
|
9499
|
-
}
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
dispatch(closeDialog());
|
|
9503
|
-
dispatch(userPanelStopLoader());
|
|
9504
|
-
setSelectValue('');
|
|
9505
|
-
});
|
|
9528
|
+
};
|
|
9529
|
+
handleApiCall(moveRecord, payload, 'message', 'move');
|
|
9530
|
+
setErrorMove(false);
|
|
9506
9531
|
} else {
|
|
9507
9532
|
setErrorMove(true);
|
|
9508
9533
|
}
|
|
@@ -9510,19 +9535,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9510
9535
|
|
|
9511
9536
|
var handleEditPanel = function handleEditPanel(data) {
|
|
9512
9537
|
if (dataList) {
|
|
9538
|
+
var payload = {
|
|
9539
|
+
table_name: tableName,
|
|
9540
|
+
from: dialogData.data.name,
|
|
9541
|
+
to: selectValue === null || selectValue === void 0 ? void 0 : selectValue.label
|
|
9542
|
+
};
|
|
9543
|
+
var message = title + " updated successfully.";
|
|
9544
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
9513
9545
|
setErrorEdit(false);
|
|
9514
|
-
dispatch(userPanelShowLoader());
|
|
9515
|
-
dispatch(editRecord(tableName, {
|
|
9516
|
-
rows: [{
|
|
9517
|
-
id: dialogData.data.id,
|
|
9518
|
-
name: dataList
|
|
9519
|
-
}]
|
|
9520
|
-
})).then(function (res) {
|
|
9521
|
-
dispatch(userPanelStopLoader());
|
|
9522
|
-
IUIToastMessageService$8.sNotify(title + " updated successfully.");
|
|
9523
|
-
closeEditDialog();
|
|
9524
|
-
setDataList('');
|
|
9525
|
-
});
|
|
9526
9546
|
} else {
|
|
9527
9547
|
setErrorEdit(true);
|
|
9528
9548
|
}
|
|
@@ -9546,21 +9566,49 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9546
9566
|
setAlertModal(false);
|
|
9547
9567
|
};
|
|
9548
9568
|
|
|
9569
|
+
var onRequestSort = function onRequestSort(event, property) {
|
|
9570
|
+
var isAsc = orderBy === property && order === 'asc';
|
|
9571
|
+
setOrder(isAsc ? 'desc' : 'asc');
|
|
9572
|
+
setOrderBy(property);
|
|
9573
|
+
setSortingChange(true);
|
|
9574
|
+
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9575
|
+
};
|
|
9576
|
+
|
|
9577
|
+
var handleChangePage = function handleChangePage(e, newPage) {
|
|
9578
|
+
setPage(newPage);
|
|
9579
|
+
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9580
|
+
};
|
|
9581
|
+
|
|
9582
|
+
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9583
|
+
setRowsPerPage(+event.target.value);
|
|
9584
|
+
setPage(1);
|
|
9585
|
+
setSortingChange(true);
|
|
9586
|
+
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9587
|
+
};
|
|
9588
|
+
|
|
9549
9589
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9550
9590
|
component: "div",
|
|
9551
9591
|
className: styles$5.UUIUserManagementList
|
|
9552
|
-
}, hasVerificationError === false ? /*#__PURE__*/React__default.createElement(React.Fragment, null,
|
|
9592
|
+
}, hasVerificationError === false ? /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Header, {
|
|
9553
9593
|
name: title,
|
|
9554
9594
|
headingName: headingName,
|
|
9555
9595
|
subHeading: subHeading,
|
|
9556
|
-
HeaderButton: addDialog
|
|
9557
|
-
|
|
9596
|
+
HeaderButton: addDialog,
|
|
9597
|
+
loading: loading
|
|
9598
|
+
}), loading ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Listview, {
|
|
9558
9599
|
data: userPanelData,
|
|
9559
9600
|
name: title,
|
|
9560
9601
|
tableName: tableName,
|
|
9561
9602
|
handleEditDialog: openEditDialog,
|
|
9562
9603
|
handleDeleteDialog: openDeleteModal,
|
|
9563
|
-
closeDeActivateModal: closeDeActivateModal
|
|
9604
|
+
closeDeActivateModal: closeDeActivateModal,
|
|
9605
|
+
orderBy: orderBy,
|
|
9606
|
+
order: order,
|
|
9607
|
+
onRequestSort: onRequestSort,
|
|
9608
|
+
handleChangePage: handleChangePage,
|
|
9609
|
+
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
9610
|
+
rowsPerPage: rowsPerPage,
|
|
9611
|
+
page: page
|
|
9564
9612
|
})), /*#__PURE__*/React__default.createElement(AddPanelDialog, {
|
|
9565
9613
|
name: title,
|
|
9566
9614
|
isOpen: addModal,
|