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