@itilite/iui-user-management 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1198 -1100
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1199 -1101
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/dist/index.modern.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput,
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, 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 moment from 'moment';
|
|
5
4
|
import axios from 'axios';
|
|
6
5
|
import AddIcon$1 from '@material-ui/icons/Add';
|
|
7
6
|
import DeleteIcon from '@material-ui/icons/Delete';
|
|
8
7
|
import { useDispatch, useSelector, Provider } from 'react-redux';
|
|
9
8
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
10
9
|
import thunk from 'redux-thunk';
|
|
10
|
+
import moment from 'moment';
|
|
11
11
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
12
12
|
import { useHistory } from 'react-router-dom';
|
|
13
13
|
import { withStyles } from '@material-ui/core/styles';
|
|
@@ -402,6 +402,9 @@ var userAddEditUrl = {
|
|
|
402
402
|
},
|
|
403
403
|
airlineList: function airlineList() {
|
|
404
404
|
return "https://serviceearth.iltech.in/api/v1/paginated/airline/";
|
|
405
|
+
},
|
|
406
|
+
rejectUserVerification: function rejectUserVerification(userId) {
|
|
407
|
+
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
405
408
|
}
|
|
406
409
|
};
|
|
407
410
|
var userListUrl = {
|
|
@@ -463,969 +466,327 @@ var userPanelUrl = {
|
|
|
463
466
|
}
|
|
464
467
|
};
|
|
465
468
|
|
|
466
|
-
var
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
469
|
+
var IUILocalStorageService$1 = services.IUILocalStorageService;
|
|
470
|
+
var api = configs.api;
|
|
471
|
+
var NAoptionConfig = {
|
|
472
|
+
option: {
|
|
473
|
+
label: 'Not assigned',
|
|
474
|
+
value: 'Not assigned'
|
|
475
|
+
},
|
|
476
|
+
applyFor: ['employee_level', 'department']
|
|
473
477
|
};
|
|
474
|
-
var
|
|
475
|
-
|
|
476
|
-
|
|
478
|
+
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
479
|
+
var page = _ref.page,
|
|
480
|
+
tabelName = _ref.tabelName,
|
|
481
|
+
placeholder = _ref.placeholder,
|
|
482
|
+
selectCTA = _ref.selectCTA,
|
|
483
|
+
showNaOption = _ref.showNaOption;
|
|
484
|
+
|
|
485
|
+
try {
|
|
486
|
+
return Promise.resolve(_catch(function () {
|
|
487
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
488
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
489
|
+
return res.data;
|
|
490
|
+
})).then(function (response) {
|
|
491
|
+
var mappedValue = response.results.map(function (item) {
|
|
492
|
+
return {
|
|
493
|
+
value: item.id,
|
|
494
|
+
label: item.name
|
|
495
|
+
};
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
if (showNaOption && page === 1 && NAoptionConfig.applyFor.includes(tabelName)) {
|
|
499
|
+
mappedValue.unshift(NAoptionConfig.option);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if (response.next === null && selectCTA) {
|
|
503
|
+
mappedValue.push({
|
|
504
|
+
value: selectCTA.value,
|
|
505
|
+
label: ''
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
return {
|
|
510
|
+
options: mappedValue,
|
|
511
|
+
hasMore: !!response.next,
|
|
512
|
+
additional: {
|
|
513
|
+
page: page + 1,
|
|
514
|
+
tabelName: tabelName,
|
|
515
|
+
placeholder: placeholder,
|
|
516
|
+
selectCTA: selectCTA
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
}, function () {
|
|
521
|
+
return {
|
|
522
|
+
options: [],
|
|
523
|
+
hasMore: false,
|
|
524
|
+
additional: {
|
|
525
|
+
page: 1,
|
|
526
|
+
tabelName: tabelName,
|
|
527
|
+
placeholder: placeholder,
|
|
528
|
+
selectCTA: selectCTA
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
}));
|
|
532
|
+
} catch (e) {
|
|
533
|
+
return Promise.reject(e);
|
|
534
|
+
}
|
|
477
535
|
};
|
|
536
|
+
var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
|
|
537
|
+
var page = _ref2.page,
|
|
538
|
+
tabelName = _ref2.tabelName,
|
|
539
|
+
placeholder = _ref2.placeholder,
|
|
540
|
+
defaultData = _ref2.defaultData;
|
|
478
541
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
517
|
-
}, {
|
|
518
|
-
id: 3,
|
|
519
|
-
label: 'Email address',
|
|
520
|
-
name: 'email',
|
|
521
|
-
required: true,
|
|
522
|
-
type: 'input',
|
|
523
|
-
fullWidth: false,
|
|
524
|
-
visibility: true,
|
|
525
|
-
readOnly: false,
|
|
526
|
-
placeholder: 'Enter email address',
|
|
527
|
-
validation: {
|
|
528
|
-
regexOnChange: null,
|
|
529
|
-
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
530
|
-
maxLimit: '',
|
|
531
|
-
minLimit: '',
|
|
532
|
-
maxLength: 100,
|
|
533
|
-
minLength: 0
|
|
534
|
-
},
|
|
535
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
536
|
-
}, {
|
|
537
|
-
id: 4,
|
|
538
|
-
label: 'Phone number',
|
|
539
|
-
name: 'contact_number',
|
|
540
|
-
required: true,
|
|
541
|
-
type: 'phone',
|
|
542
|
-
fullWidth: false,
|
|
543
|
-
visibility: true,
|
|
544
|
-
readOnly: false,
|
|
545
|
-
validation: {
|
|
546
|
-
regexOnChange: /^[\d]/,
|
|
547
|
-
regexOnBlur: null,
|
|
548
|
-
maxLimit: '',
|
|
549
|
-
minLimit: '',
|
|
550
|
-
maxLength: 100,
|
|
551
|
-
minLength: 0
|
|
552
|
-
},
|
|
553
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
554
|
-
}, {
|
|
555
|
-
id: 5,
|
|
556
|
-
label: 'Date of birth',
|
|
557
|
-
name: 'dob',
|
|
558
|
-
required: false,
|
|
559
|
-
type: 'datepicker',
|
|
560
|
-
fullWidth: false,
|
|
561
|
-
visibility: true,
|
|
562
|
-
readOnly: false,
|
|
563
|
-
hasIcon: false,
|
|
564
|
-
size: 'normal',
|
|
565
|
-
maxDate: dob.maxDate,
|
|
566
|
-
minDate: dob.minDate,
|
|
567
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
568
|
-
}, {
|
|
569
|
-
id: 6,
|
|
570
|
-
empty: true
|
|
571
|
-
}, {
|
|
572
|
-
id: 7,
|
|
573
|
-
label: 'Gender',
|
|
574
|
-
name: 'gender',
|
|
575
|
-
required: false,
|
|
576
|
-
type: 'select',
|
|
577
|
-
fullWidth: false,
|
|
578
|
-
visibility: true,
|
|
579
|
-
readOnly: false,
|
|
580
|
-
placeholder: 'Select gender',
|
|
581
|
-
tooltip: 'This information will be used for flight booking purpose',
|
|
582
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
583
|
-
}, {
|
|
584
|
-
id: 8,
|
|
585
|
-
label: 'Profile photo',
|
|
586
|
-
description: 'This will be displayed on your profile',
|
|
587
|
-
name: 'profile_pic',
|
|
588
|
-
required: false,
|
|
589
|
-
multiple: false,
|
|
590
|
-
fileType: 'image/png,image/jpeg,image/jpg,image/webp,image/JPG,image/JPEG',
|
|
591
|
-
fileSize: 5,
|
|
592
|
-
title: 'Select Profile',
|
|
593
|
-
type: 'file',
|
|
594
|
-
fullWidth: true,
|
|
595
|
-
visibility: true,
|
|
596
|
-
readOnly: false,
|
|
597
|
-
maxNoFiles: 2,
|
|
598
|
-
buttonType: 'profile',
|
|
599
|
-
disableText: 'Disable text here.'
|
|
600
|
-
}];
|
|
601
|
-
var workInfo = [{
|
|
602
|
-
id: 1,
|
|
603
|
-
label: 'Employee level',
|
|
604
|
-
name: 'emp_level',
|
|
605
|
-
required: false,
|
|
606
|
-
type: 'async_select',
|
|
607
|
-
fullWidth: false,
|
|
608
|
-
visibility: true,
|
|
609
|
-
readOnly: false,
|
|
610
|
-
title: 'Select employee level',
|
|
611
|
-
inputType: false,
|
|
612
|
-
placeholder: 'Select employee level',
|
|
613
|
-
loadOption: commonLoadOptions,
|
|
614
|
-
tabelName: 'employee_level',
|
|
615
|
-
tooltip: 'This information will be used in creation of policies and approval rules',
|
|
616
|
-
disableText: 'Please get in touch with your administrator to change this value.',
|
|
617
|
-
selectCTA: {
|
|
618
|
-
value: 'employee_level',
|
|
619
|
-
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
620
|
-
className: "iui__font--color-link iui__font--weight-500"
|
|
621
|
-
}, "+ Add Employee Level"),
|
|
622
|
-
callback: null
|
|
542
|
+
try {
|
|
543
|
+
return Promise.resolve(_catch(function () {
|
|
544
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
545
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
546
|
+
return res.data;
|
|
547
|
+
})).then(function (response) {
|
|
548
|
+
var arrList = response.results.filter(function (item) {
|
|
549
|
+
return item.name !== defaultData;
|
|
550
|
+
});
|
|
551
|
+
var mappedValue = arrList.map(function (item) {
|
|
552
|
+
return {
|
|
553
|
+
value: item.id,
|
|
554
|
+
label: item.name
|
|
555
|
+
};
|
|
556
|
+
});
|
|
557
|
+
return {
|
|
558
|
+
options: mappedValue,
|
|
559
|
+
hasMore: !!response.next,
|
|
560
|
+
additional: {
|
|
561
|
+
page: page + 1,
|
|
562
|
+
tabelName: tabelName
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
});
|
|
566
|
+
}, function () {
|
|
567
|
+
return {
|
|
568
|
+
options: [],
|
|
569
|
+
hasMore: false,
|
|
570
|
+
additional: {
|
|
571
|
+
page: 1,
|
|
572
|
+
tabelName: tabelName,
|
|
573
|
+
placeholder: placeholder
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
}));
|
|
577
|
+
} catch (e) {
|
|
578
|
+
return Promise.reject(e);
|
|
623
579
|
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
disableText: 'Please get in touch with your administrator to change this value.',
|
|
659
|
-
selectCTA: {
|
|
660
|
-
value: 'entity',
|
|
661
|
-
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
662
|
-
className: "iui__font--color-link iui__font--weight-500"
|
|
663
|
-
}, "+ Add Entity"),
|
|
664
|
-
callback: null
|
|
665
|
-
}
|
|
666
|
-
}, {
|
|
667
|
-
id: 4,
|
|
668
|
-
label: 'Business unit',
|
|
669
|
-
name: 'business_unit',
|
|
670
|
-
required: false,
|
|
671
|
-
type: 'async_select',
|
|
672
|
-
fullWidth: false,
|
|
673
|
-
visibility: true,
|
|
674
|
-
readOnly: false,
|
|
675
|
-
title: 'Select unit',
|
|
676
|
-
inputType: false,
|
|
677
|
-
placeholder: 'Select unit',
|
|
678
|
-
tabelName: 'business_unit',
|
|
679
|
-
loadOption: commonLoadOptions,
|
|
680
|
-
disableText: 'Please get in touch with your administrator to change this value.',
|
|
681
|
-
selectCTA: {
|
|
682
|
-
value: 'business_unit',
|
|
683
|
-
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
684
|
-
className: "iui__font--color-link iui__font--weight-500"
|
|
685
|
-
}, "+ Add Business Unit"),
|
|
686
|
-
callback: null
|
|
580
|
+
};
|
|
581
|
+
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
582
|
+
var page = _ref3.page;
|
|
583
|
+
|
|
584
|
+
try {
|
|
585
|
+
return Promise.resolve(_catch(function () {
|
|
586
|
+
return Promise.resolve(api.get(userAddEditUrl.currencyCode() + "&search=" + search + "&page=" + page).then(function (res) {
|
|
587
|
+
return res.data;
|
|
588
|
+
})).then(function (response) {
|
|
589
|
+
var mappedValue = response.results.map(function (item) {
|
|
590
|
+
return {
|
|
591
|
+
value: item.currency_code,
|
|
592
|
+
label: item.currency_code
|
|
593
|
+
};
|
|
594
|
+
});
|
|
595
|
+
return {
|
|
596
|
+
options: mappedValue,
|
|
597
|
+
hasMore: !!response.next,
|
|
598
|
+
additional: {
|
|
599
|
+
page: page + 1
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
});
|
|
603
|
+
}, function () {
|
|
604
|
+
return {
|
|
605
|
+
options: [],
|
|
606
|
+
hasMore: false,
|
|
607
|
+
additional: {
|
|
608
|
+
page: 1
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
}));
|
|
612
|
+
} catch (e) {
|
|
613
|
+
return Promise.reject(e);
|
|
687
614
|
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
615
|
+
};
|
|
616
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
617
|
+
var page = _ref4.page,
|
|
618
|
+
product = _ref4.product,
|
|
619
|
+
userId = _ref4.userId,
|
|
620
|
+
placeholder = _ref4.placeholder;
|
|
621
|
+
|
|
622
|
+
try {
|
|
623
|
+
return Promise.resolve(_catch(function () {
|
|
624
|
+
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
625
|
+
return res.data;
|
|
626
|
+
})).then(function (response) {
|
|
627
|
+
var mappedValue = response.results.map(function (item) {
|
|
628
|
+
return {
|
|
629
|
+
value: item.approver,
|
|
630
|
+
label: item.approver
|
|
631
|
+
};
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
if (page === 1) {
|
|
635
|
+
var placeholderLbl = {
|
|
636
|
+
value: '',
|
|
637
|
+
label: placeholder
|
|
638
|
+
};
|
|
639
|
+
mappedValue.unshift(placeholderLbl);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
return {
|
|
643
|
+
options: mappedValue,
|
|
644
|
+
hasMore: !!response.next,
|
|
645
|
+
additional: {
|
|
646
|
+
page: page + 1,
|
|
647
|
+
product: product,
|
|
648
|
+
userId: userId
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
});
|
|
652
|
+
}, function () {
|
|
653
|
+
return {
|
|
654
|
+
options: [],
|
|
655
|
+
hasMore: false,
|
|
656
|
+
additional: {
|
|
657
|
+
page: 1,
|
|
658
|
+
product: product,
|
|
659
|
+
userId: userId
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
}));
|
|
663
|
+
} catch (e) {
|
|
664
|
+
return Promise.reject(e);
|
|
709
665
|
}
|
|
710
|
-
}, {
|
|
711
|
-
id: 6,
|
|
712
|
-
label: 'Designation',
|
|
713
|
-
name: 'designation',
|
|
714
|
-
required: false,
|
|
715
|
-
type: 'input',
|
|
716
|
-
fullWidth: false,
|
|
717
|
-
visibility: true,
|
|
718
|
-
readOnly: false,
|
|
719
|
-
placeholder: 'Enter designation',
|
|
720
|
-
validation: {
|
|
721
|
-
regexOnChange: /^[A-Za-z0-9.&'()\- ]*$/,
|
|
722
|
-
regexOnBlur: /^[a-zA-Z][a-zA-Z0-9.&'()\- ]*$/,
|
|
723
|
-
maxLimit: '',
|
|
724
|
-
minLimit: '',
|
|
725
|
-
maxLength: 100,
|
|
726
|
-
minLength: 0
|
|
727
|
-
},
|
|
728
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
729
|
-
}, {
|
|
730
|
-
id: 7,
|
|
731
|
-
label: 'Base location',
|
|
732
|
-
name: 'base_location',
|
|
733
|
-
required: false,
|
|
734
|
-
type: 'input',
|
|
735
|
-
fullWidth: true,
|
|
736
|
-
placeholder: 'Enter city',
|
|
737
|
-
visibility: true,
|
|
738
|
-
readOnly: false,
|
|
739
|
-
validation: {
|
|
740
|
-
regexOnChange: /^[A-Za-z0-9 -.&'()]*$/,
|
|
741
|
-
regexOnBlur: null,
|
|
742
|
-
maxLimit: '',
|
|
743
|
-
minLimit: '',
|
|
744
|
-
maxLength: 500,
|
|
745
|
-
minLength: 0
|
|
746
|
-
},
|
|
747
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
748
|
-
}, {
|
|
749
|
-
id: 7,
|
|
750
|
-
label: 'Default currency',
|
|
751
|
-
name: 'currency',
|
|
752
|
-
required: false,
|
|
753
|
-
type: 'async_select',
|
|
754
|
-
fullWidth: false,
|
|
755
|
-
visibility: true,
|
|
756
|
-
readOnly: false,
|
|
757
|
-
inputType: false,
|
|
758
|
-
tabelName: 'default_currency',
|
|
759
|
-
loadOption: currencyLoadOptions,
|
|
760
|
-
tooltip: 'This only changes the currency for this user',
|
|
761
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
762
|
-
}, {
|
|
763
|
-
id: 8,
|
|
764
|
-
empty: true
|
|
765
|
-
}];
|
|
766
|
-
var products = [{
|
|
767
|
-
id: 1,
|
|
768
|
-
label: 'Travel',
|
|
769
|
-
name: 'travel',
|
|
770
|
-
type: 'checkbox',
|
|
771
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
772
|
-
}, {
|
|
773
|
-
id: 2,
|
|
774
|
-
label: 'Expense',
|
|
775
|
-
name: 'expense',
|
|
776
|
-
type: 'checkbox',
|
|
777
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
778
|
-
}];
|
|
779
|
-
var dropdownList = {
|
|
780
|
-
gender: [{
|
|
781
|
-
id: 1,
|
|
782
|
-
name: 'Male'
|
|
783
|
-
}, {
|
|
784
|
-
id: 2,
|
|
785
|
-
name: 'Female'
|
|
786
|
-
}, {
|
|
787
|
-
id: 3,
|
|
788
|
-
name: 'Others'
|
|
789
|
-
}],
|
|
790
|
-
flight_seat_preference: [],
|
|
791
|
-
meal_preference: [],
|
|
792
|
-
contact_number: [],
|
|
793
|
-
passport_issue_country: [],
|
|
794
|
-
nationality: []
|
|
795
666
|
};
|
|
796
|
-
var
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
id: 1,
|
|
834
|
-
label: 'Person 1',
|
|
835
|
-
name: 'travel_approver',
|
|
836
|
-
required: false,
|
|
837
|
-
type: 'input',
|
|
838
|
-
fullWidth: false,
|
|
839
|
-
visibility: true,
|
|
840
|
-
readOnly: false,
|
|
841
|
-
placeholder: 'Select Approver',
|
|
842
|
-
validation: {
|
|
843
|
-
regexOnChange: null,
|
|
844
|
-
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
845
|
-
maxLimit: '',
|
|
846
|
-
minLimit: '',
|
|
847
|
-
maxLength: 100,
|
|
848
|
-
minLength: 0
|
|
849
|
-
},
|
|
850
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
851
|
-
}, {
|
|
852
|
-
id: 2,
|
|
853
|
-
label: 'Person 2',
|
|
854
|
-
name: 'travel_approver',
|
|
855
|
-
required: false,
|
|
856
|
-
type: 'input',
|
|
857
|
-
fullWidth: false,
|
|
858
|
-
visibility: true,
|
|
859
|
-
readOnly: false,
|
|
860
|
-
placeholder: 'Select Approver',
|
|
861
|
-
validation: {
|
|
862
|
-
regexOnChange: null,
|
|
863
|
-
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
864
|
-
maxLimit: '',
|
|
865
|
-
minLimit: '',
|
|
866
|
-
maxLength: 100,
|
|
867
|
-
minLength: 0
|
|
868
|
-
},
|
|
869
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
870
|
-
}]
|
|
667
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
668
|
+
var page = _ref5.page,
|
|
669
|
+
tabelName = _ref5.tabelName;
|
|
670
|
+
|
|
671
|
+
try {
|
|
672
|
+
return Promise.resolve(_catch(function () {
|
|
673
|
+
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
674
|
+
return res.data;
|
|
675
|
+
})).then(function (response) {
|
|
676
|
+
var mappedValue = response.results.map(function (item) {
|
|
677
|
+
return {
|
|
678
|
+
value: item[tabelName],
|
|
679
|
+
label: item[tabelName]
|
|
680
|
+
};
|
|
681
|
+
});
|
|
682
|
+
return {
|
|
683
|
+
options: mappedValue,
|
|
684
|
+
hasMore: !!response.next,
|
|
685
|
+
additional: {
|
|
686
|
+
page: page + 1,
|
|
687
|
+
tabelName: tabelName
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
});
|
|
691
|
+
}, function () {
|
|
692
|
+
return {
|
|
693
|
+
options: [],
|
|
694
|
+
hasMore: false,
|
|
695
|
+
additional: {
|
|
696
|
+
page: 1,
|
|
697
|
+
tabelName: tabelName
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
}));
|
|
701
|
+
} catch (e) {
|
|
702
|
+
return Promise.reject(e);
|
|
703
|
+
}
|
|
871
704
|
};
|
|
872
|
-
var
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
minLimit: '',
|
|
923
|
-
maxLength: 100,
|
|
924
|
-
minLength: 0
|
|
925
|
-
},
|
|
926
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
927
|
-
}, {
|
|
928
|
-
id: 2,
|
|
929
|
-
label: 'Person 2',
|
|
930
|
-
name: 'expense_approver',
|
|
931
|
-
required: false,
|
|
932
|
-
type: 'input',
|
|
933
|
-
fullWidth: false,
|
|
934
|
-
visibility: true,
|
|
935
|
-
readOnly: false,
|
|
936
|
-
placeholder: 'Select Approver',
|
|
937
|
-
validation: {
|
|
938
|
-
regexOnChange: null,
|
|
939
|
-
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<a>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
940
|
-
maxLimit: '',
|
|
941
|
-
minLimit: '',
|
|
942
|
-
maxLength: 100,
|
|
943
|
-
minLength: 0
|
|
944
|
-
},
|
|
945
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
946
|
-
}]
|
|
947
|
-
};
|
|
948
|
-
var passportInfo = [{
|
|
949
|
-
id: 1,
|
|
950
|
-
label: 'Passport issuing country',
|
|
951
|
-
name: 'passport_issue_country',
|
|
952
|
-
required: false,
|
|
953
|
-
type: 'async_select',
|
|
954
|
-
fullWidth: false,
|
|
955
|
-
visibility: true,
|
|
956
|
-
readOnly: false,
|
|
957
|
-
placeholder: 'Select country',
|
|
958
|
-
tabelName: 'country_name',
|
|
959
|
-
loadOption: countryOptions,
|
|
960
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
961
|
-
}, {
|
|
962
|
-
id: 2,
|
|
963
|
-
label: 'Passport number',
|
|
964
|
-
name: 'passport_number',
|
|
965
|
-
required: false,
|
|
966
|
-
type: 'input',
|
|
967
|
-
fullWidth: false,
|
|
968
|
-
visibility: true,
|
|
969
|
-
readOnly: false,
|
|
970
|
-
placeholder: 'Enter passport number',
|
|
971
|
-
validation: {
|
|
972
|
-
regexOnChange: /^[A-Za-z0-9]*$/,
|
|
973
|
-
regexOnBlur: null,
|
|
974
|
-
maxLimit: '',
|
|
975
|
-
minLimit: '',
|
|
976
|
-
maxLength: 15,
|
|
977
|
-
minLength: 7
|
|
978
|
-
},
|
|
979
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
980
|
-
}, {
|
|
981
|
-
id: 3,
|
|
982
|
-
label: 'Nationality',
|
|
983
|
-
name: 'nationality',
|
|
984
|
-
required: false,
|
|
985
|
-
type: 'async_select',
|
|
986
|
-
fullWidth: true,
|
|
987
|
-
visibility: true,
|
|
988
|
-
readOnly: false,
|
|
989
|
-
placeholder: 'Select nationality',
|
|
990
|
-
tabelName: 'nationality',
|
|
991
|
-
loadOption: countryOptions,
|
|
992
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
993
|
-
}, {
|
|
994
|
-
id: 4,
|
|
995
|
-
label: 'Date of issue',
|
|
996
|
-
name: 'passport_issue_date',
|
|
997
|
-
required: false,
|
|
998
|
-
type: 'datepicker',
|
|
999
|
-
hasIcon: false,
|
|
1000
|
-
fullWidth: false,
|
|
1001
|
-
visibility: true,
|
|
1002
|
-
readOnly: false,
|
|
1003
|
-
size: 'small',
|
|
1004
|
-
maxDate: passportStart.maxDate,
|
|
1005
|
-
minDate: passportStart.minDate,
|
|
1006
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1007
|
-
}, {
|
|
1008
|
-
id: 5,
|
|
1009
|
-
label: 'Date of expiry',
|
|
1010
|
-
name: 'passport_expiry_date',
|
|
1011
|
-
required: false,
|
|
1012
|
-
type: 'datepicker',
|
|
1013
|
-
hasIcon: false,
|
|
1014
|
-
fullWidth: false,
|
|
1015
|
-
visibility: true,
|
|
1016
|
-
readOnly: false,
|
|
1017
|
-
size: 'small',
|
|
1018
|
-
maxDate: passportEnd.maxDate,
|
|
1019
|
-
minDate: passportEnd.minDate,
|
|
1020
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1021
|
-
}, {
|
|
1022
|
-
id: 6,
|
|
1023
|
-
label: 'Photo of passport',
|
|
1024
|
-
description: '',
|
|
1025
|
-
name: 'passport_photo',
|
|
1026
|
-
required: false,
|
|
1027
|
-
type: 'file',
|
|
1028
|
-
multiple: true,
|
|
1029
|
-
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
1030
|
-
fileSize: 5,
|
|
1031
|
-
title: 'Select Photo',
|
|
1032
|
-
fullWidth: true,
|
|
1033
|
-
visibility: true,
|
|
1034
|
-
readOnly: false,
|
|
1035
|
-
maxNoFiles: 2,
|
|
1036
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1037
|
-
}, {
|
|
1038
|
-
id: 7,
|
|
1039
|
-
label: 'Travel documents',
|
|
1040
|
-
description: 'You can add upto 5 documents',
|
|
1041
|
-
name: 'travel_docs',
|
|
1042
|
-
required: false,
|
|
1043
|
-
multiple: true,
|
|
1044
|
-
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
1045
|
-
fileSize: 5,
|
|
1046
|
-
title: 'Select document',
|
|
1047
|
-
type: 'file',
|
|
1048
|
-
fullWidth: true,
|
|
1049
|
-
visibility: true,
|
|
1050
|
-
readOnly: false,
|
|
1051
|
-
maxNoFiles: 5,
|
|
1052
|
-
tooltip: 'This is for quick access of important travel documents during your trip like Visa, Identification, Vaccine certificates etc.',
|
|
1053
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1054
|
-
}];
|
|
1055
|
-
var travelPreference = [{
|
|
1056
|
-
id: 1,
|
|
1057
|
-
label: 'Flight seat preference',
|
|
1058
|
-
name: 'flight_seat_preference',
|
|
1059
|
-
required: false,
|
|
1060
|
-
type: 'select',
|
|
1061
|
-
fullWidth: false,
|
|
1062
|
-
visibility: true,
|
|
1063
|
-
readOnly: false,
|
|
1064
|
-
placeholder: 'Select seat preference',
|
|
1065
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1066
|
-
}, {
|
|
1067
|
-
id: 1,
|
|
1068
|
-
label: 'Meals preference',
|
|
1069
|
-
name: 'meal_preference',
|
|
1070
|
-
required: false,
|
|
1071
|
-
type: 'select',
|
|
1072
|
-
fullWidth: false,
|
|
1073
|
-
visibility: true,
|
|
1074
|
-
readOnly: false,
|
|
1075
|
-
placeholder: 'Select meals preference',
|
|
1076
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1077
|
-
}];
|
|
1078
|
-
var secureTravelInfo = [{
|
|
1079
|
-
id: 1,
|
|
1080
|
-
label: 'Known traveler number',
|
|
1081
|
-
placeholder: 'Enter known traveler number',
|
|
1082
|
-
name: 'trusted_traveller',
|
|
1083
|
-
required: false,
|
|
1084
|
-
type: 'input',
|
|
1085
|
-
hasIcon: true,
|
|
1086
|
-
fullWidth: false,
|
|
1087
|
-
visibility: true,
|
|
1088
|
-
readOnly: false,
|
|
1089
|
-
tooltip: /*#__PURE__*/React.createElement(React.Fragment, null, "The Known Traveler Number is a unique number issued by the U.S. Government to identify customers who participate in a known traveler program (e.g.: Global Entry, SENTRI, NEXUS, TSA PreCheck application process). For more information about the Known Traveler Number,", ' ', /*#__PURE__*/React.createElement("a", {
|
|
1090
|
-
href: "https://www.tsa.gov/travel/frequently-asked-questions",
|
|
1091
|
-
target: "_blank",
|
|
1092
|
-
rel: "noreferrer"
|
|
1093
|
-
}, "visit TSA's PreCheck website")),
|
|
1094
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1095
|
-
}, {
|
|
1096
|
-
id: 1,
|
|
1097
|
-
label: 'Redress number',
|
|
1098
|
-
placeholder: 'Enter redress number',
|
|
1099
|
-
name: 'redress_number',
|
|
1100
|
-
required: false,
|
|
1101
|
-
type: 'input',
|
|
1102
|
-
hasIcon: true,
|
|
1103
|
-
fullWidth: false,
|
|
1104
|
-
visibility: true,
|
|
1105
|
-
readOnly: false,
|
|
1106
|
-
tooltip: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "The Redress Number is a unique number issued by the DHS (Department of Homeland Security) that is used to facilitate passenger clearance for persons who have the same name as someone on the TSA (Transportation Security Administration) watch list. For more information about the Secure Flight program,", ' ', /*#__PURE__*/React.createElement("a", {
|
|
1107
|
-
href: "https://www.tsa.gov/travel/passenger-support/travel-redress-program",
|
|
1108
|
-
target: "_blank",
|
|
1109
|
-
rel: "noreferrer"
|
|
1110
|
-
}, "visit TSA's Secure Flight website"))),
|
|
1111
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1112
|
-
}];
|
|
1113
|
-
var NAoptionConfig = {
|
|
1114
|
-
option: {
|
|
1115
|
-
label: 'Not assigned',
|
|
1116
|
-
value: 'Not assigned'
|
|
1117
|
-
},
|
|
1118
|
-
applyFor: ['employee_level', 'department']
|
|
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'
|
|
705
|
+
var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
706
|
+
var page = _ref6.page,
|
|
707
|
+
placeholder = _ref6.placeholder;
|
|
708
|
+
|
|
709
|
+
try {
|
|
710
|
+
return Promise.resolve(_catch(function () {
|
|
711
|
+
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
712
|
+
var token = IUILocalStorageService$1.getAccessToken();
|
|
713
|
+
return Promise.resolve(axios.get(url, {
|
|
714
|
+
headers: {
|
|
715
|
+
Authorization: 'Bearer ' + token
|
|
716
|
+
}
|
|
717
|
+
})).then(function (response) {
|
|
718
|
+
return Promise.resolve(response.data.results.map(function (item) {
|
|
719
|
+
return {
|
|
720
|
+
value: item.id,
|
|
721
|
+
label: item.name
|
|
722
|
+
};
|
|
723
|
+
})).then(function (mappedValue) {
|
|
724
|
+
if (placeholder) {
|
|
725
|
+
var placeholderLbl = {
|
|
726
|
+
value: '',
|
|
727
|
+
label: placeholder
|
|
728
|
+
};
|
|
729
|
+
mappedValue.unshift(placeholderLbl);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return {
|
|
733
|
+
options: mappedValue,
|
|
734
|
+
hasMore: !!response.data.next,
|
|
735
|
+
additional: {
|
|
736
|
+
page: page + 1,
|
|
737
|
+
placeholder: placeholder
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
}, function () {
|
|
743
|
+
return {
|
|
744
|
+
options: [],
|
|
745
|
+
hasMore: false,
|
|
746
|
+
additional: {
|
|
747
|
+
page: 1,
|
|
748
|
+
placeholder: placeholder
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
}));
|
|
752
|
+
} catch (e) {
|
|
753
|
+
return Promise.reject(e);
|
|
754
|
+
}
|
|
1158
755
|
};
|
|
1159
756
|
|
|
1160
|
-
var
|
|
1161
|
-
var
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
757
|
+
var UserRole = function UserRole(_ref) {
|
|
758
|
+
var _ref$list = _ref.list,
|
|
759
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
760
|
+
_ref$value = _ref.value,
|
|
761
|
+
value = _ref$value === void 0 ? '' : _ref$value;
|
|
762
|
+
var role = list.find(function (role) {
|
|
763
|
+
return role.name === value;
|
|
764
|
+
});
|
|
765
|
+
return /*#__PURE__*/React.createElement("div", null, role && /*#__PURE__*/React.createElement(IUILabel, {
|
|
766
|
+
label: role.label,
|
|
767
|
+
headerType: true,
|
|
768
|
+
description: role.description
|
|
769
|
+
}));
|
|
770
|
+
};
|
|
1168
771
|
|
|
1169
|
-
|
|
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
|
-
});
|
|
772
|
+
var styles$1 = {"card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expiryDate":"_2tBnF","cardImage":"_3QvZh","visa":"_1IpBm","mastercard":"_2x6IX","amex":"_2a38S","discover":"_2vksl","diners":"_2kQRs","jcb":"_2bO1f","unionpay":"_2_jfu","is_nothing":"_1Lrzs","addCard":"_3711U","cardDeleteBtn":"_7Da2t","cardLabel":"_PQTex","defaultLabel":"_smjc4","defaultBtn":"_1_ArA","cursonPointer":"_1L115","sectionWrapper":"_VpUCK","margin":"_1Fs_D","minGridWidth":"_1hl-Z","firstRowMargin":"_1WZZj","firstChildMargin":"_IT_O_","paddingTop":"_Mhnl7","dividerColor":"_3ltFd"};
|
|
1181
773
|
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
774
|
+
var SHOW_LOADER = 'SHOW_LOADER';
|
|
775
|
+
var STOP_LOADER = 'STOP_LOADER';
|
|
776
|
+
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
777
|
+
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
778
|
+
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
779
|
+
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
780
|
+
var SET_EDITED_TRAVEL_APPROVER_FIELD = 'SET_EDITED_TRAVEL_APPROVER_FIELD';
|
|
781
|
+
var SET_EDITED_EXPENSE_APPROVER_FIELD = 'SET_EDITED_EXPENSE_APPROVER_FIELD';
|
|
782
|
+
var SET_COUNTRY_CODES = 'SET_COUNTRY_CODES';
|
|
783
|
+
var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
784
|
+
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
1185
785
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
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
|
-
};
|
|
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;
|
|
1222
|
-
|
|
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;
|
|
1260
|
-
|
|
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
|
-
};
|
|
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;
|
|
1309
|
-
|
|
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
|
-
}
|
|
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,
|
|
1385
|
-
additional: {
|
|
1386
|
-
page: 1,
|
|
1387
|
-
placeholder: placeholder
|
|
1388
|
-
}
|
|
1389
|
-
};
|
|
1390
|
-
}));
|
|
1391
|
-
} catch (e) {
|
|
1392
|
-
return Promise.reject(e);
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
|
|
1396
|
-
var UserRole = function UserRole(_ref) {
|
|
1397
|
-
var _ref$list = _ref.list,
|
|
1398
|
-
list = _ref$list === void 0 ? [] : _ref$list,
|
|
1399
|
-
_ref$value = _ref.value,
|
|
1400
|
-
value = _ref$value === void 0 ? '' : _ref$value;
|
|
1401
|
-
var role = list.find(function (role) {
|
|
1402
|
-
return role.name === value;
|
|
1403
|
-
});
|
|
1404
|
-
return /*#__PURE__*/React.createElement("div", null, role && /*#__PURE__*/React.createElement(IUILabel, {
|
|
1405
|
-
label: role.label,
|
|
1406
|
-
headerType: true,
|
|
1407
|
-
description: role.description
|
|
1408
|
-
}));
|
|
1409
|
-
};
|
|
1410
|
-
|
|
1411
|
-
var styles$1 = {"card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expiryDate":"_2tBnF","cardImage":"_3QvZh","visa":"_1IpBm","mastercard":"_2x6IX","amex":"_2a38S","discover":"_2vksl","diners":"_2kQRs","jcb":"_2bO1f","unionpay":"_2_jfu","is_nothing":"_1Lrzs","addCard":"_3711U","cardDeleteBtn":"_7Da2t","cardLabel":"_PQTex","defaultLabel":"_smjc4","defaultBtn":"_1_ArA","cursonPointer":"_1L115","sectionWrapper":"_VpUCK","margin":"_1Fs_D","minGridWidth":"_1hl-Z","firstRowMargin":"_1WZZj","firstChildMargin":"_IT_O_","paddingTop":"_Mhnl7","dividerColor":"_3ltFd"};
|
|
1412
|
-
|
|
1413
|
-
var SHOW_LOADER = 'SHOW_LOADER';
|
|
1414
|
-
var STOP_LOADER = 'STOP_LOADER';
|
|
1415
|
-
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
1416
|
-
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
1417
|
-
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
1418
|
-
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
1419
|
-
var SET_EDITED_TRAVEL_APPROVER_FIELD = 'SET_EDITED_TRAVEL_APPROVER_FIELD';
|
|
1420
|
-
var SET_EDITED_EXPENSE_APPROVER_FIELD = 'SET_EDITED_EXPENSE_APPROVER_FIELD';
|
|
1421
|
-
var SET_COUNTRY_CODES = 'SET_COUNTRY_CODES';
|
|
1422
|
-
var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
1423
|
-
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
1424
|
-
|
|
1425
|
-
var env$1 = configs.env;
|
|
1426
|
-
var IUILocalStorageService$2 = services.IUILocalStorageService;
|
|
1427
|
-
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
1428
|
-
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
786
|
+
var env$1 = configs.env;
|
|
787
|
+
var IUILocalStorageService$2 = services.IUILocalStorageService;
|
|
788
|
+
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
789
|
+
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
1429
790
|
|
|
1430
791
|
var res = {
|
|
1431
792
|
company_id: +IUILocalStorageService$2.getCompanyId(),
|
|
@@ -1921,12 +1282,12 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1921
1282
|
return new Promise(function (resolve, reject) {
|
|
1922
1283
|
var _travelApprovers = getState().userAddEdit.renderFields.travelApprovers;
|
|
1923
1284
|
var sNo = _travelApprovers.length + 1;
|
|
1924
|
-
var label = "Travel
|
|
1285
|
+
var label = "Travel approver " + sNo;
|
|
1925
1286
|
|
|
1926
1287
|
_travelApprovers.forEach(function (approver) {
|
|
1927
1288
|
if (approver.label === label) {
|
|
1928
1289
|
sNo++;
|
|
1929
|
-
label = "Travel
|
|
1290
|
+
label = "Travel approver " + sNo;
|
|
1930
1291
|
}
|
|
1931
1292
|
});
|
|
1932
1293
|
|
|
@@ -1965,12 +1326,12 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1965
1326
|
return new Promise(function (resolve, reject) {
|
|
1966
1327
|
var _expenseApprovers = getState().userAddEdit.renderFields.expenseApprovers;
|
|
1967
1328
|
var sNo = _expenseApprovers.length + 1;
|
|
1968
|
-
var label = "Expense
|
|
1329
|
+
var label = "Expense approver " + sNo;
|
|
1969
1330
|
|
|
1970
1331
|
_expenseApprovers.forEach(function (approver) {
|
|
1971
1332
|
if (approver.label === label) {
|
|
1972
1333
|
sNo++;
|
|
1973
|
-
label = "Expense
|
|
1334
|
+
label = "Expense approver " + sNo;
|
|
1974
1335
|
}
|
|
1975
1336
|
});
|
|
1976
1337
|
|
|
@@ -2282,6 +1643,33 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
|
2282
1643
|
});
|
|
2283
1644
|
};
|
|
2284
1645
|
};
|
|
1646
|
+
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
1647
|
+
return function (dispatch) {
|
|
1648
|
+
return new Promise(function (resolve, reject) {
|
|
1649
|
+
api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
1650
|
+
console.log(res);
|
|
1651
|
+
|
|
1652
|
+
if (res.data.status === true) {
|
|
1653
|
+
var _res$data5;
|
|
1654
|
+
|
|
1655
|
+
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.');
|
|
1656
|
+
resolve(res.data);
|
|
1657
|
+
} else {
|
|
1658
|
+
var _res$data6;
|
|
1659
|
+
|
|
1660
|
+
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.');
|
|
1661
|
+
reject(res);
|
|
1662
|
+
}
|
|
1663
|
+
})["catch"](function (err) {
|
|
1664
|
+
var _err$response11, _err$response11$data;
|
|
1665
|
+
|
|
1666
|
+
console.log(err);
|
|
1667
|
+
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.');
|
|
1668
|
+
reject(err);
|
|
1669
|
+
});
|
|
1670
|
+
});
|
|
1671
|
+
};
|
|
1672
|
+
};
|
|
2285
1673
|
|
|
2286
1674
|
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
2287
1675
|
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
@@ -2749,8 +2137,10 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2749
2137
|
var AddCard = function AddCard(_ref2) {
|
|
2750
2138
|
var pg = _ref2.pg;
|
|
2751
2139
|
|
|
2140
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2141
|
+
|
|
2752
2142
|
var handleAddCard = function handleAddCard() {
|
|
2753
|
-
window.location.assign(
|
|
2143
|
+
window.location.assign(_url);
|
|
2754
2144
|
};
|
|
2755
2145
|
|
|
2756
2146
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -2951,13 +2341,13 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2951
2341
|
var rgx = null;
|
|
2952
2342
|
|
|
2953
2343
|
if (type === 'travel') {
|
|
2954
|
-
rgx = /^(travel
|
|
2344
|
+
rgx = /^(travel approver)( )[0-9]*$/i;
|
|
2955
2345
|
} else {
|
|
2956
|
-
rgx = /^(expense
|
|
2346
|
+
rgx = /^(expense approver)( )[0-9]*$/i;
|
|
2957
2347
|
}
|
|
2958
2348
|
|
|
2959
|
-
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + "
|
|
2960
|
-
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2349
|
+
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + " approver " + (editedLabel.approvers[i].indexAt + 1)) {
|
|
2350
|
+
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (editedLabel.approvers[i].indexAt + 1) + "' to '" + editedLabel.approvers[i].label + "'";
|
|
2961
2351
|
|
|
2962
2352
|
if (!hasError) {
|
|
2963
2353
|
hasError = true;
|
|
@@ -3072,10 +2462,10 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3072
2462
|
return null;
|
|
3073
2463
|
}
|
|
3074
2464
|
|
|
3075
|
-
if (p.label.toLowerCase() === type + "
|
|
2465
|
+
if (p.label.toLowerCase() === type + " approver " + (i + 1)) {
|
|
3076
2466
|
p.secondaryLabel = '';
|
|
3077
2467
|
} else {
|
|
3078
|
-
p.secondaryLabel = type + "
|
|
2468
|
+
p.secondaryLabel = type + " approver " + (i + 1);
|
|
3079
2469
|
}
|
|
3080
2470
|
|
|
3081
2471
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
@@ -3191,7 +2581,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3191
2581
|
className: styles.fieldMargin
|
|
3192
2582
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
3193
2583
|
defaultValue: p.label,
|
|
3194
|
-
label: (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2584
|
+
label: (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (i + 1),
|
|
3195
2585
|
className: styles.inputWidth,
|
|
3196
2586
|
id: type + '_' + p.sequence,
|
|
3197
2587
|
name: type + '_' + p.sequence,
|
|
@@ -3306,134 +2696,821 @@ var AddCustomFieldModal = function AddCustomFieldModal(_ref) {
|
|
|
3306
2696
|
overflow: 'auto',
|
|
3307
2697
|
margin: '0px'
|
|
3308
2698
|
},
|
|
3309
|
-
footerStyle: {
|
|
3310
|
-
justifyContent: 'end'
|
|
3311
|
-
}
|
|
3312
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
3313
|
-
component: "div",
|
|
3314
|
-
display: "flex",
|
|
3315
|
-
justifyContent: "center",
|
|
3316
|
-
alignItems: "center",
|
|
3317
|
-
flexDirection: "column",
|
|
3318
|
-
padding: "8px 20px"
|
|
3319
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
3320
|
-
label: "Field label",
|
|
3321
|
-
fullwidth: false,
|
|
3322
|
-
className: styles$2.inputWidth,
|
|
3323
|
-
customHandler: addCustomFieldsLabel,
|
|
3324
|
-
required: true,
|
|
3325
|
-
errorMsg: inputValueErr,
|
|
3326
|
-
isError: !!inputValueErr,
|
|
3327
|
-
defaultValue: inputValue
|
|
3328
|
-
})));
|
|
2699
|
+
footerStyle: {
|
|
2700
|
+
justifyContent: 'end'
|
|
2701
|
+
}
|
|
2702
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
2703
|
+
component: "div",
|
|
2704
|
+
display: "flex",
|
|
2705
|
+
justifyContent: "center",
|
|
2706
|
+
alignItems: "center",
|
|
2707
|
+
flexDirection: "column",
|
|
2708
|
+
padding: "8px 20px"
|
|
2709
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
2710
|
+
label: "Field label",
|
|
2711
|
+
fullwidth: false,
|
|
2712
|
+
className: styles$2.inputWidth,
|
|
2713
|
+
customHandler: addCustomFieldsLabel,
|
|
2714
|
+
required: true,
|
|
2715
|
+
errorMsg: inputValueErr,
|
|
2716
|
+
isError: !!inputValueErr,
|
|
2717
|
+
defaultValue: inputValue
|
|
2718
|
+
})));
|
|
2719
|
+
};
|
|
2720
|
+
|
|
2721
|
+
var CustomFields = function CustomFields(_ref) {
|
|
2722
|
+
var _ref$inputState = _ref.inputState,
|
|
2723
|
+
inputState = _ref$inputState === void 0 ? {} : _ref$inputState,
|
|
2724
|
+
_ref$onChangeHandler = _ref.onChangeHandler,
|
|
2725
|
+
onChangeHandler = _ref$onChangeHandler === void 0 ? function () {} : _ref$onChangeHandler,
|
|
2726
|
+
_ref$isProfile = _ref.isProfile,
|
|
2727
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
2728
|
+
var customFields = useSelector(function (state) {
|
|
2729
|
+
return state.userAddEdit.renderFields.custom_attributes;
|
|
2730
|
+
});
|
|
2731
|
+
var maxCustomAttributes = useSelector(function (state) {
|
|
2732
|
+
return state.userAddEdit.maxCustomAttributes;
|
|
2733
|
+
});
|
|
2734
|
+
|
|
2735
|
+
var _useState = useState(false),
|
|
2736
|
+
isOpenModal = _useState[0],
|
|
2737
|
+
setOpenModalFlag = _useState[1];
|
|
2738
|
+
|
|
2739
|
+
var openCustomFieldModal = function openCustomFieldModal() {
|
|
2740
|
+
setOpenModalFlag(true);
|
|
2741
|
+
};
|
|
2742
|
+
|
|
2743
|
+
if (isProfile && customFields.length === 0) {
|
|
2744
|
+
return null;
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIDivider, {
|
|
2748
|
+
className: styles.dividerColor
|
|
2749
|
+
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2750
|
+
container: true,
|
|
2751
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
2752
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2753
|
+
item: true,
|
|
2754
|
+
sm: 12,
|
|
2755
|
+
md: 4
|
|
2756
|
+
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
2757
|
+
label: "Custom fields",
|
|
2758
|
+
headerType: true,
|
|
2759
|
+
description: isProfile ? '' : "You can add up to " + maxCustomAttributes + " fields",
|
|
2760
|
+
hasInfoIcon: !isProfile,
|
|
2761
|
+
tooltipText: "Use custom fields to collect additional information that help you tailor data for your business\u2019 needs"
|
|
2762
|
+
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2763
|
+
item: true,
|
|
2764
|
+
sm: 12,
|
|
2765
|
+
md: 8,
|
|
2766
|
+
lg: 8,
|
|
2767
|
+
xl: 6
|
|
2768
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2769
|
+
container: true,
|
|
2770
|
+
className: styles.formFieldsWrapper
|
|
2771
|
+
}, customFields.length === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
2772
|
+
className: styles.emptyFieldContainer
|
|
2773
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
2774
|
+
className: styles.emptyFieldDescription
|
|
2775
|
+
}, "Add custom fields to collect additional information that help you tailor data for your business\u2019 needs"), !isProfile && /*#__PURE__*/React.createElement(IUIBox, {
|
|
2776
|
+
className: styles.emptyFieldBtnContainer
|
|
2777
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
2778
|
+
buttonText: "Add custom field",
|
|
2779
|
+
type: "text",
|
|
2780
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
2781
|
+
width: "10",
|
|
2782
|
+
height: "10",
|
|
2783
|
+
color: "#EC5D25"
|
|
2784
|
+
}),
|
|
2785
|
+
className: styles.paddingTop,
|
|
2786
|
+
onClick: openCustomFieldModal
|
|
2787
|
+
}))), customFields.length > 0 && customFields.map(function (p, i) {
|
|
2788
|
+
if (i >= maxCustomAttributes) {
|
|
2789
|
+
return null;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2793
|
+
key: i.toString(),
|
|
2794
|
+
item: true,
|
|
2795
|
+
md: 8,
|
|
2796
|
+
lg: 8,
|
|
2797
|
+
xl: 8
|
|
2798
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
2799
|
+
label: p.field_name || "Custom " + p.attribute_column,
|
|
2800
|
+
fullwidth: false,
|
|
2801
|
+
defaultValue: inputState["custom" + p.attribute_column],
|
|
2802
|
+
name: "custom" + p.attribute_column,
|
|
2803
|
+
customHandler: onChangeHandler,
|
|
2804
|
+
readOnly: isProfile
|
|
2805
|
+
}));
|
|
2806
|
+
}), !isProfile && customFields.length > 0 && customFields.length < maxCustomAttributes && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2807
|
+
item: true,
|
|
2808
|
+
md: 8,
|
|
2809
|
+
lg: 8,
|
|
2810
|
+
xl: 8
|
|
2811
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
2812
|
+
buttonText: "Add custom field",
|
|
2813
|
+
type: "text",
|
|
2814
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
2815
|
+
width: "10",
|
|
2816
|
+
height: "10",
|
|
2817
|
+
color: "#EC5D25"
|
|
2818
|
+
}),
|
|
2819
|
+
className: styles.paddingTop,
|
|
2820
|
+
onClick: openCustomFieldModal
|
|
2821
|
+
}))))), /*#__PURE__*/React.createElement(AddCustomFieldModal, {
|
|
2822
|
+
isOpenModal: isOpenModal,
|
|
2823
|
+
closeModalHandler: function closeModalHandler() {
|
|
2824
|
+
return setOpenModalFlag(false);
|
|
2825
|
+
}
|
|
2826
|
+
}));
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
var dob = {
|
|
2830
|
+
maxDate: moment().subtract(18, 'years'),
|
|
2831
|
+
minDate: moment().subtract(300, 'years')
|
|
2832
|
+
};
|
|
2833
|
+
var passportStart = {
|
|
2834
|
+
maxDate: moment(),
|
|
2835
|
+
minDate: moment().subtract(100, 'years')
|
|
2836
|
+
};
|
|
2837
|
+
var passportEnd = {
|
|
2838
|
+
maxDate: moment().add(18, 'years'),
|
|
2839
|
+
minDate: moment()
|
|
2840
|
+
};
|
|
2841
|
+
|
|
2842
|
+
var personalInfo = [{
|
|
2843
|
+
id: 1,
|
|
2844
|
+
label: 'First and middle name',
|
|
2845
|
+
name: 'first_name',
|
|
2846
|
+
required: true,
|
|
2847
|
+
type: 'input',
|
|
2848
|
+
fullWidth: false,
|
|
2849
|
+
visibility: true,
|
|
2850
|
+
readOnly: false,
|
|
2851
|
+
placeholder: 'Enter first and middle name',
|
|
2852
|
+
validation: {
|
|
2853
|
+
regexOnChange: /^[a-zA-Z ]*$/,
|
|
2854
|
+
regexOnBlur: null,
|
|
2855
|
+
maxLimit: '',
|
|
2856
|
+
minLimit: '',
|
|
2857
|
+
maxLength: 100,
|
|
2858
|
+
minLength: 0
|
|
2859
|
+
},
|
|
2860
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2861
|
+
}, {
|
|
2862
|
+
id: 2,
|
|
2863
|
+
label: 'Last name',
|
|
2864
|
+
name: 'last_name',
|
|
2865
|
+
required: true,
|
|
2866
|
+
type: 'input',
|
|
2867
|
+
fullWidth: false,
|
|
2868
|
+
visibility: true,
|
|
2869
|
+
readOnly: false,
|
|
2870
|
+
placeholder: 'Enter last name',
|
|
2871
|
+
validation: {
|
|
2872
|
+
regexOnChange: /^[a-zA-Z ]*$/,
|
|
2873
|
+
regexOnBlur: null,
|
|
2874
|
+
maxLimit: '',
|
|
2875
|
+
minLimit: '',
|
|
2876
|
+
maxLength: 100,
|
|
2877
|
+
minLength: 0
|
|
2878
|
+
},
|
|
2879
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2880
|
+
}, {
|
|
2881
|
+
id: 3,
|
|
2882
|
+
label: 'Email address',
|
|
2883
|
+
name: 'email',
|
|
2884
|
+
required: true,
|
|
2885
|
+
type: 'input',
|
|
2886
|
+
fullWidth: false,
|
|
2887
|
+
visibility: true,
|
|
2888
|
+
readOnly: false,
|
|
2889
|
+
placeholder: 'Enter email address',
|
|
2890
|
+
validation: {
|
|
2891
|
+
regexOnChange: null,
|
|
2892
|
+
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
2893
|
+
maxLimit: '',
|
|
2894
|
+
minLimit: '',
|
|
2895
|
+
maxLength: 100,
|
|
2896
|
+
minLength: 0
|
|
2897
|
+
},
|
|
2898
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2899
|
+
}, {
|
|
2900
|
+
id: 4,
|
|
2901
|
+
label: 'Phone number',
|
|
2902
|
+
name: 'contact_number',
|
|
2903
|
+
required: true,
|
|
2904
|
+
type: 'phone',
|
|
2905
|
+
fullWidth: false,
|
|
2906
|
+
visibility: true,
|
|
2907
|
+
readOnly: false,
|
|
2908
|
+
validation: {
|
|
2909
|
+
regexOnChange: /^[\d]/,
|
|
2910
|
+
regexOnBlur: null,
|
|
2911
|
+
maxLimit: '',
|
|
2912
|
+
minLimit: '',
|
|
2913
|
+
maxLength: 100,
|
|
2914
|
+
minLength: 0
|
|
2915
|
+
},
|
|
2916
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2917
|
+
}, {
|
|
2918
|
+
id: 5,
|
|
2919
|
+
label: 'Date of birth',
|
|
2920
|
+
name: 'dob',
|
|
2921
|
+
required: false,
|
|
2922
|
+
type: 'datepicker',
|
|
2923
|
+
fullWidth: false,
|
|
2924
|
+
visibility: true,
|
|
2925
|
+
readOnly: false,
|
|
2926
|
+
hasIcon: false,
|
|
2927
|
+
size: 'normal',
|
|
2928
|
+
maxDate: dob.maxDate,
|
|
2929
|
+
minDate: dob.minDate,
|
|
2930
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2931
|
+
}, {
|
|
2932
|
+
id: 6,
|
|
2933
|
+
empty: true
|
|
2934
|
+
}, {
|
|
2935
|
+
id: 7,
|
|
2936
|
+
label: 'Gender',
|
|
2937
|
+
name: 'gender',
|
|
2938
|
+
required: false,
|
|
2939
|
+
type: 'select',
|
|
2940
|
+
fullWidth: false,
|
|
2941
|
+
visibility: true,
|
|
2942
|
+
readOnly: false,
|
|
2943
|
+
placeholder: 'Select gender',
|
|
2944
|
+
tooltip: 'This information will be used for flight booking purpose',
|
|
2945
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2946
|
+
}, {
|
|
2947
|
+
id: 8,
|
|
2948
|
+
label: 'Profile photo',
|
|
2949
|
+
description: 'This will be displayed on your profile',
|
|
2950
|
+
name: 'profile_pic',
|
|
2951
|
+
required: false,
|
|
2952
|
+
multiple: false,
|
|
2953
|
+
fileType: 'image/png,image/jpeg,image/jpg,image/webp,image/JPG,image/JPEG',
|
|
2954
|
+
fileSize: 5,
|
|
2955
|
+
title: 'Select Profile',
|
|
2956
|
+
type: 'file',
|
|
2957
|
+
fullWidth: true,
|
|
2958
|
+
visibility: true,
|
|
2959
|
+
readOnly: false,
|
|
2960
|
+
maxNoFiles: 2,
|
|
2961
|
+
buttonType: 'profile',
|
|
2962
|
+
disableText: 'Disable text here.'
|
|
2963
|
+
}];
|
|
2964
|
+
var workInfo = [{
|
|
2965
|
+
id: 1,
|
|
2966
|
+
label: 'Employee level',
|
|
2967
|
+
name: 'emp_level',
|
|
2968
|
+
required: false,
|
|
2969
|
+
type: 'async_select',
|
|
2970
|
+
fullWidth: false,
|
|
2971
|
+
visibility: true,
|
|
2972
|
+
readOnly: false,
|
|
2973
|
+
title: 'Select employee level',
|
|
2974
|
+
inputType: false,
|
|
2975
|
+
placeholder: 'Select employee level',
|
|
2976
|
+
loadOption: commonLoadOptions,
|
|
2977
|
+
tabelName: 'employee_level',
|
|
2978
|
+
tooltip: 'This information will be used in creation of policies and approval rules',
|
|
2979
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
2980
|
+
selectCTA: {
|
|
2981
|
+
value: 'employee_level',
|
|
2982
|
+
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
2983
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
2984
|
+
}, "+ Add Employee Level"),
|
|
2985
|
+
callback: null
|
|
2986
|
+
}
|
|
2987
|
+
}, {
|
|
2988
|
+
id: 2,
|
|
2989
|
+
label: 'Employee ID',
|
|
2990
|
+
name: 'employee_id',
|
|
2991
|
+
required: false,
|
|
2992
|
+
type: 'input',
|
|
2993
|
+
fullWidth: false,
|
|
2994
|
+
visibility: true,
|
|
2995
|
+
readOnly: false,
|
|
2996
|
+
placeholder: 'Enter employee ID',
|
|
2997
|
+
validation: {
|
|
2998
|
+
regexOnChange: /^[A-Za-z0-9]*$/,
|
|
2999
|
+
regexOnBlur: null,
|
|
3000
|
+
maxLimit: '',
|
|
3001
|
+
minLimit: '',
|
|
3002
|
+
maxLength: 100,
|
|
3003
|
+
minLength: 0
|
|
3004
|
+
},
|
|
3005
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3006
|
+
}, {
|
|
3007
|
+
id: 3,
|
|
3008
|
+
label: 'Entity',
|
|
3009
|
+
name: 'entity',
|
|
3010
|
+
required: false,
|
|
3011
|
+
type: 'async_select',
|
|
3012
|
+
fullWidth: false,
|
|
3013
|
+
visibility: true,
|
|
3014
|
+
readOnly: false,
|
|
3015
|
+
title: '',
|
|
3016
|
+
inputType: false,
|
|
3017
|
+
placeholder: 'Select entity',
|
|
3018
|
+
loadOption: commonLoadOptions,
|
|
3019
|
+
tabelName: 'entity',
|
|
3020
|
+
tooltip: 'This information will be used in creation of policies and approval rules',
|
|
3021
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
3022
|
+
selectCTA: {
|
|
3023
|
+
value: 'entity',
|
|
3024
|
+
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
3025
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
3026
|
+
}, "+ Add Entity"),
|
|
3027
|
+
callback: null
|
|
3028
|
+
}
|
|
3029
|
+
}, {
|
|
3030
|
+
id: 4,
|
|
3031
|
+
label: 'Business unit',
|
|
3032
|
+
name: 'business_unit',
|
|
3033
|
+
required: false,
|
|
3034
|
+
type: 'async_select',
|
|
3035
|
+
fullWidth: false,
|
|
3036
|
+
visibility: true,
|
|
3037
|
+
readOnly: false,
|
|
3038
|
+
title: 'Select unit',
|
|
3039
|
+
inputType: false,
|
|
3040
|
+
placeholder: 'Select unit',
|
|
3041
|
+
tabelName: 'business_unit',
|
|
3042
|
+
loadOption: commonLoadOptions,
|
|
3043
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
3044
|
+
selectCTA: {
|
|
3045
|
+
value: 'business_unit',
|
|
3046
|
+
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
3047
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
3048
|
+
}, "+ Add Business Unit"),
|
|
3049
|
+
callback: null
|
|
3050
|
+
}
|
|
3051
|
+
}, {
|
|
3052
|
+
id: 5,
|
|
3053
|
+
label: 'Department',
|
|
3054
|
+
name: 'department',
|
|
3055
|
+
required: false,
|
|
3056
|
+
type: 'async_select',
|
|
3057
|
+
fullWidth: false,
|
|
3058
|
+
visibility: true,
|
|
3059
|
+
readOnly: false,
|
|
3060
|
+
title: 'Select department',
|
|
3061
|
+
inputType: false,
|
|
3062
|
+
placeholder: 'Select department',
|
|
3063
|
+
tabelName: 'department',
|
|
3064
|
+
loadOption: commonLoadOptions,
|
|
3065
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
3066
|
+
selectCTA: {
|
|
3067
|
+
value: 'department',
|
|
3068
|
+
component: /*#__PURE__*/React.createElement(IUITypography, {
|
|
3069
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
3070
|
+
}, "+ Add Department"),
|
|
3071
|
+
callback: null
|
|
3072
|
+
}
|
|
3073
|
+
}, {
|
|
3074
|
+
id: 6,
|
|
3075
|
+
label: 'Designation',
|
|
3076
|
+
name: 'designation',
|
|
3077
|
+
required: false,
|
|
3078
|
+
type: 'input',
|
|
3079
|
+
fullWidth: false,
|
|
3080
|
+
visibility: true,
|
|
3081
|
+
readOnly: false,
|
|
3082
|
+
placeholder: 'Enter designation',
|
|
3083
|
+
validation: {
|
|
3084
|
+
regexOnChange: /^[A-Za-z0-9.&'()\- ]*$/,
|
|
3085
|
+
regexOnBlur: /^[a-zA-Z][a-zA-Z0-9.&'()\- ]*$/,
|
|
3086
|
+
maxLimit: '',
|
|
3087
|
+
minLimit: '',
|
|
3088
|
+
maxLength: 100,
|
|
3089
|
+
minLength: 0
|
|
3090
|
+
},
|
|
3091
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3092
|
+
}, {
|
|
3093
|
+
id: 7,
|
|
3094
|
+
label: 'Base location',
|
|
3095
|
+
name: 'base_location',
|
|
3096
|
+
required: false,
|
|
3097
|
+
type: 'input',
|
|
3098
|
+
fullWidth: true,
|
|
3099
|
+
placeholder: 'Enter city',
|
|
3100
|
+
visibility: true,
|
|
3101
|
+
readOnly: false,
|
|
3102
|
+
validation: {
|
|
3103
|
+
regexOnChange: /^[A-Za-z0-9 -.&'()]*$/,
|
|
3104
|
+
regexOnBlur: null,
|
|
3105
|
+
maxLimit: '',
|
|
3106
|
+
minLimit: '',
|
|
3107
|
+
maxLength: 500,
|
|
3108
|
+
minLength: 0
|
|
3109
|
+
},
|
|
3110
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3111
|
+
}, {
|
|
3112
|
+
id: 7,
|
|
3113
|
+
label: 'Default currency',
|
|
3114
|
+
name: 'currency',
|
|
3115
|
+
required: false,
|
|
3116
|
+
type: 'async_select',
|
|
3117
|
+
fullWidth: false,
|
|
3118
|
+
visibility: true,
|
|
3119
|
+
readOnly: false,
|
|
3120
|
+
inputType: false,
|
|
3121
|
+
tabelName: 'default_currency',
|
|
3122
|
+
loadOption: currencyLoadOptions,
|
|
3123
|
+
tooltip: 'This only changes the currency for this user',
|
|
3124
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3125
|
+
}, {
|
|
3126
|
+
id: 8,
|
|
3127
|
+
empty: true
|
|
3128
|
+
}];
|
|
3129
|
+
var products = [{
|
|
3130
|
+
id: 1,
|
|
3131
|
+
label: 'Travel',
|
|
3132
|
+
name: 'travel',
|
|
3133
|
+
type: 'checkbox',
|
|
3134
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3135
|
+
}, {
|
|
3136
|
+
id: 2,
|
|
3137
|
+
label: 'Expense',
|
|
3138
|
+
name: 'expense',
|
|
3139
|
+
type: 'checkbox',
|
|
3140
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3141
|
+
}];
|
|
3142
|
+
var dropdownList = {
|
|
3143
|
+
gender: [{
|
|
3144
|
+
id: 1,
|
|
3145
|
+
name: 'Male'
|
|
3146
|
+
}, {
|
|
3147
|
+
id: 2,
|
|
3148
|
+
name: 'Female'
|
|
3149
|
+
}, {
|
|
3150
|
+
id: 3,
|
|
3151
|
+
name: 'Others'
|
|
3152
|
+
}],
|
|
3153
|
+
flight_seat_preference: [],
|
|
3154
|
+
meal_preference: [],
|
|
3155
|
+
contact_number: [],
|
|
3156
|
+
passport_issue_country: [],
|
|
3157
|
+
nationality: []
|
|
3158
|
+
};
|
|
3159
|
+
var travelConstants = {
|
|
3160
|
+
heading: 'Travel specific information',
|
|
3161
|
+
roleHeading: 'Travel role',
|
|
3162
|
+
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3163
|
+
approverHeading: 'Travel approvers',
|
|
3164
|
+
approverDescription: 'You can add upto :maxApprovers approvers',
|
|
3165
|
+
FYILabel: 'FYI approver',
|
|
3166
|
+
FYIDescription: 'Send travel approval alerts to this email',
|
|
3167
|
+
roles: [{
|
|
3168
|
+
id: 1,
|
|
3169
|
+
label: 'Traveler',
|
|
3170
|
+
description: 'Can create trips for themselves and guests',
|
|
3171
|
+
name: 'traveler',
|
|
3172
|
+
type: 'radio',
|
|
3173
|
+
fullWidth: false,
|
|
3174
|
+
visibility: true,
|
|
3175
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3176
|
+
}, {
|
|
3177
|
+
id: 2,
|
|
3178
|
+
label: 'Admin',
|
|
3179
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3180
|
+
name: 'travel_admin',
|
|
3181
|
+
type: 'radio',
|
|
3182
|
+
fullWidth: false,
|
|
3183
|
+
visibility: true,
|
|
3184
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3185
|
+
}, {
|
|
3186
|
+
id: 3,
|
|
3187
|
+
label: 'Finance admin',
|
|
3188
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3189
|
+
name: 'travel_finance_admin',
|
|
3190
|
+
type: 'radio',
|
|
3191
|
+
fullWidth: false,
|
|
3192
|
+
visibility: true,
|
|
3193
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3194
|
+
}],
|
|
3195
|
+
approvers: [{
|
|
3196
|
+
id: 1,
|
|
3197
|
+
label: 'Person 1',
|
|
3198
|
+
name: 'travel_approver',
|
|
3199
|
+
required: false,
|
|
3200
|
+
type: 'input',
|
|
3201
|
+
fullWidth: false,
|
|
3202
|
+
visibility: true,
|
|
3203
|
+
readOnly: false,
|
|
3204
|
+
placeholder: 'Select Approver',
|
|
3205
|
+
validation: {
|
|
3206
|
+
regexOnChange: null,
|
|
3207
|
+
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
3208
|
+
maxLimit: '',
|
|
3209
|
+
minLimit: '',
|
|
3210
|
+
maxLength: 100,
|
|
3211
|
+
minLength: 0
|
|
3212
|
+
},
|
|
3213
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3214
|
+
}, {
|
|
3215
|
+
id: 2,
|
|
3216
|
+
label: 'Person 2',
|
|
3217
|
+
name: 'travel_approver',
|
|
3218
|
+
required: false,
|
|
3219
|
+
type: 'input',
|
|
3220
|
+
fullWidth: false,
|
|
3221
|
+
visibility: true,
|
|
3222
|
+
readOnly: false,
|
|
3223
|
+
placeholder: 'Select Approver',
|
|
3224
|
+
validation: {
|
|
3225
|
+
regexOnChange: null,
|
|
3226
|
+
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
3227
|
+
maxLimit: '',
|
|
3228
|
+
minLimit: '',
|
|
3229
|
+
maxLength: 100,
|
|
3230
|
+
minLength: 0
|
|
3231
|
+
},
|
|
3232
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3233
|
+
}]
|
|
3329
3234
|
};
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
},
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
}
|
|
3235
|
+
var expenseConstants = {
|
|
3236
|
+
heading: 'Expense specific information',
|
|
3237
|
+
roleHeading: 'Expense role',
|
|
3238
|
+
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3239
|
+
approverHeading: 'Expense approvers',
|
|
3240
|
+
approverDescription: 'You can add upto :maxApprovers approvers',
|
|
3241
|
+
FYILabel: 'FYI approver',
|
|
3242
|
+
FYIDescription: 'Send expense approval alerts to this email',
|
|
3243
|
+
roles: [{
|
|
3244
|
+
id: 1,
|
|
3245
|
+
label: 'Submitter',
|
|
3246
|
+
description: 'Can submit expenses',
|
|
3247
|
+
name: 'submitter',
|
|
3248
|
+
type: 'radio',
|
|
3249
|
+
fullWidth: false,
|
|
3250
|
+
visibility: true,
|
|
3251
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3252
|
+
}, {
|
|
3253
|
+
id: 2,
|
|
3254
|
+
label: 'Admin',
|
|
3255
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3256
|
+
name: 'expense_admin',
|
|
3257
|
+
type: 'radio',
|
|
3258
|
+
fullWidth: false,
|
|
3259
|
+
visibility: true,
|
|
3260
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3261
|
+
}, {
|
|
3262
|
+
id: 3,
|
|
3263
|
+
label: 'Finance admin',
|
|
3264
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3265
|
+
name: 'expense_finance_admin',
|
|
3266
|
+
type: 'radio',
|
|
3267
|
+
fullWidth: false,
|
|
3268
|
+
visibility: true,
|
|
3269
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3270
|
+
}],
|
|
3271
|
+
approvers: [{
|
|
3272
|
+
id: 1,
|
|
3273
|
+
label: 'Person 1',
|
|
3274
|
+
name: 'expense_approver',
|
|
3275
|
+
required: false,
|
|
3276
|
+
type: 'input',
|
|
3277
|
+
fullWidth: false,
|
|
3278
|
+
visibility: true,
|
|
3279
|
+
readOnly: false,
|
|
3280
|
+
placeholder: 'Select Approver',
|
|
3281
|
+
validation: {
|
|
3282
|
+
regexOnChange: null,
|
|
3283
|
+
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
3284
|
+
maxLimit: '',
|
|
3285
|
+
minLimit: '',
|
|
3286
|
+
maxLength: 100,
|
|
3287
|
+
minLength: 0
|
|
3288
|
+
},
|
|
3289
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3290
|
+
}, {
|
|
3291
|
+
id: 2,
|
|
3292
|
+
label: 'Person 2',
|
|
3293
|
+
name: 'expense_approver',
|
|
3294
|
+
required: false,
|
|
3295
|
+
type: 'input',
|
|
3296
|
+
fullWidth: false,
|
|
3297
|
+
visibility: true,
|
|
3298
|
+
readOnly: false,
|
|
3299
|
+
placeholder: 'Select Approver',
|
|
3300
|
+
validation: {
|
|
3301
|
+
regexOnChange: null,
|
|
3302
|
+
regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<a>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
3303
|
+
maxLimit: '',
|
|
3304
|
+
minLimit: '',
|
|
3305
|
+
maxLength: 100,
|
|
3306
|
+
minLength: 0
|
|
3307
|
+
},
|
|
3308
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3309
|
+
}]
|
|
3310
|
+
};
|
|
3311
|
+
var passportInfo = [{
|
|
3312
|
+
id: 1,
|
|
3313
|
+
label: 'Passport issuing country',
|
|
3314
|
+
name: 'passport_issue_country',
|
|
3315
|
+
required: false,
|
|
3316
|
+
type: 'async_select',
|
|
3317
|
+
fullWidth: false,
|
|
3318
|
+
visibility: true,
|
|
3319
|
+
readOnly: false,
|
|
3320
|
+
placeholder: 'Select country',
|
|
3321
|
+
tabelName: 'country_name',
|
|
3322
|
+
loadOption: countryOptions,
|
|
3323
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3324
|
+
}, {
|
|
3325
|
+
id: 2,
|
|
3326
|
+
label: 'Passport number',
|
|
3327
|
+
name: 'passport_number',
|
|
3328
|
+
required: false,
|
|
3329
|
+
type: 'input',
|
|
3330
|
+
fullWidth: false,
|
|
3331
|
+
visibility: true,
|
|
3332
|
+
readOnly: false,
|
|
3333
|
+
placeholder: 'Enter passport number',
|
|
3334
|
+
validation: {
|
|
3335
|
+
regexOnChange: /^[A-Za-z0-9]*$/,
|
|
3336
|
+
regexOnBlur: null,
|
|
3337
|
+
maxLimit: '',
|
|
3338
|
+
minLimit: '',
|
|
3339
|
+
maxLength: 15,
|
|
3340
|
+
minLength: 7
|
|
3341
|
+
},
|
|
3342
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3343
|
+
}, {
|
|
3344
|
+
id: 3,
|
|
3345
|
+
label: 'Nationality',
|
|
3346
|
+
name: 'nationality',
|
|
3347
|
+
required: false,
|
|
3348
|
+
type: 'async_select',
|
|
3349
|
+
fullWidth: true,
|
|
3350
|
+
visibility: true,
|
|
3351
|
+
readOnly: false,
|
|
3352
|
+
placeholder: 'Select nationality',
|
|
3353
|
+
tabelName: 'nationality',
|
|
3354
|
+
loadOption: countryOptions,
|
|
3355
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3356
|
+
}, {
|
|
3357
|
+
id: 4,
|
|
3358
|
+
label: 'Date of issue',
|
|
3359
|
+
name: 'passport_issue_date',
|
|
3360
|
+
required: false,
|
|
3361
|
+
type: 'datepicker',
|
|
3362
|
+
hasIcon: false,
|
|
3363
|
+
fullWidth: false,
|
|
3364
|
+
visibility: true,
|
|
3365
|
+
readOnly: false,
|
|
3366
|
+
size: 'small',
|
|
3367
|
+
maxDate: passportStart.maxDate,
|
|
3368
|
+
minDate: passportStart.minDate,
|
|
3369
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3370
|
+
}, {
|
|
3371
|
+
id: 5,
|
|
3372
|
+
label: 'Date of expiry',
|
|
3373
|
+
name: 'passport_expiry_date',
|
|
3374
|
+
required: false,
|
|
3375
|
+
type: 'datepicker',
|
|
3376
|
+
hasIcon: false,
|
|
3377
|
+
fullWidth: false,
|
|
3378
|
+
visibility: true,
|
|
3379
|
+
readOnly: false,
|
|
3380
|
+
size: 'small',
|
|
3381
|
+
maxDate: passportEnd.maxDate,
|
|
3382
|
+
minDate: passportEnd.minDate,
|
|
3383
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3384
|
+
}, {
|
|
3385
|
+
id: 6,
|
|
3386
|
+
label: 'Photo of passport',
|
|
3387
|
+
description: '',
|
|
3388
|
+
name: 'passport_photo',
|
|
3389
|
+
required: false,
|
|
3390
|
+
type: 'file',
|
|
3391
|
+
multiple: true,
|
|
3392
|
+
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
3393
|
+
fileSize: 5,
|
|
3394
|
+
title: 'Select Photo',
|
|
3395
|
+
fullWidth: true,
|
|
3396
|
+
visibility: true,
|
|
3397
|
+
readOnly: false,
|
|
3398
|
+
maxNoFiles: 2,
|
|
3399
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3400
|
+
}, {
|
|
3401
|
+
id: 7,
|
|
3402
|
+
label: 'Travel documents',
|
|
3403
|
+
description: 'You can add upto 5 documents',
|
|
3404
|
+
name: 'travel_docs',
|
|
3405
|
+
required: false,
|
|
3406
|
+
multiple: true,
|
|
3407
|
+
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
3408
|
+
fileSize: 5,
|
|
3409
|
+
title: 'Select document',
|
|
3410
|
+
type: 'file',
|
|
3411
|
+
fullWidth: true,
|
|
3412
|
+
visibility: true,
|
|
3413
|
+
readOnly: false,
|
|
3414
|
+
maxNoFiles: 5,
|
|
3415
|
+
tooltip: 'This is for quick access of important travel documents during your trip like Visa, Identification, Vaccine certificates etc.',
|
|
3416
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3417
|
+
}];
|
|
3418
|
+
var travelPreference = [{
|
|
3419
|
+
id: 1,
|
|
3420
|
+
label: 'Flight seat preference',
|
|
3421
|
+
name: 'flight_seat_preference',
|
|
3422
|
+
required: false,
|
|
3423
|
+
type: 'select',
|
|
3424
|
+
fullWidth: false,
|
|
3425
|
+
visibility: true,
|
|
3426
|
+
readOnly: false,
|
|
3427
|
+
placeholder: 'Select seat preference',
|
|
3428
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3429
|
+
}, {
|
|
3430
|
+
id: 1,
|
|
3431
|
+
label: 'Meals preference',
|
|
3432
|
+
name: 'meal_preference',
|
|
3433
|
+
required: false,
|
|
3434
|
+
type: 'select',
|
|
3435
|
+
fullWidth: false,
|
|
3436
|
+
visibility: true,
|
|
3437
|
+
readOnly: false,
|
|
3438
|
+
placeholder: 'Select meals preference',
|
|
3439
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3440
|
+
}];
|
|
3441
|
+
var secureTravelInfo = [{
|
|
3442
|
+
id: 1,
|
|
3443
|
+
label: 'Known traveler number',
|
|
3444
|
+
placeholder: 'Enter known traveler number',
|
|
3445
|
+
name: 'trusted_traveller',
|
|
3446
|
+
required: false,
|
|
3447
|
+
type: 'input',
|
|
3448
|
+
hasIcon: true,
|
|
3449
|
+
fullWidth: false,
|
|
3450
|
+
visibility: true,
|
|
3451
|
+
readOnly: false,
|
|
3452
|
+
tooltip: /*#__PURE__*/React.createElement(React.Fragment, null, "The Known Traveler Number is a unique number issued by the U.S. Government to identify customers who participate in a known traveler program (e.g.: Global Entry, SENTRI, NEXUS, TSA PreCheck application process). For more information about the Known Traveler Number,", ' ', /*#__PURE__*/React.createElement("a", {
|
|
3453
|
+
href: "https://www.tsa.gov/travel/frequently-asked-questions",
|
|
3454
|
+
target: "_blank",
|
|
3455
|
+
rel: "noreferrer"
|
|
3456
|
+
}, "visit TSA's PreCheck website")),
|
|
3457
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3458
|
+
}, {
|
|
3459
|
+
id: 1,
|
|
3460
|
+
label: 'Redress number',
|
|
3461
|
+
placeholder: 'Enter redress number',
|
|
3462
|
+
name: 'redress_number',
|
|
3463
|
+
required: false,
|
|
3464
|
+
type: 'input',
|
|
3465
|
+
hasIcon: true,
|
|
3466
|
+
fullWidth: false,
|
|
3467
|
+
visibility: true,
|
|
3468
|
+
readOnly: false,
|
|
3469
|
+
tooltip: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "The Redress Number is a unique number issued by the DHS (Department of Homeland Security) that is used to facilitate passenger clearance for persons who have the same name as someone on the TSA (Transportation Security Administration) watch list. For more information about the Secure Flight program,", ' ', /*#__PURE__*/React.createElement("a", {
|
|
3470
|
+
href: "https://www.tsa.gov/travel/passenger-support/travel-redress-program",
|
|
3471
|
+
target: "_blank",
|
|
3472
|
+
rel: "noreferrer"
|
|
3473
|
+
}, "visit TSA's Secure Flight website"))),
|
|
3474
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3475
|
+
}];
|
|
3476
|
+
var userAddPageFormLabels = {
|
|
3477
|
+
user_personal_info: {
|
|
3478
|
+
first_name: 'First and middle name',
|
|
3479
|
+
last_name: 'Last name',
|
|
3480
|
+
email: 'Email address',
|
|
3481
|
+
contact_number: 'Phone number',
|
|
3482
|
+
dob: 'Date of birth',
|
|
3483
|
+
gender: 'Gender',
|
|
3484
|
+
profile_pic: 'Profile photo'
|
|
3485
|
+
},
|
|
3486
|
+
employee_info: {
|
|
3487
|
+
emp_level: 'Employee level',
|
|
3488
|
+
employee_id: 'Employee ID',
|
|
3489
|
+
entity: 'Entity',
|
|
3490
|
+
business_unit: 'Business unit',
|
|
3491
|
+
department: 'Department',
|
|
3492
|
+
designation: 'Designation',
|
|
3493
|
+
base_location: 'Base location',
|
|
3494
|
+
currency: 'Default currency'
|
|
3495
|
+
},
|
|
3496
|
+
user_travel_info: {
|
|
3497
|
+
nationality: 'Nationality',
|
|
3498
|
+
passport_number: 'Passport number',
|
|
3499
|
+
passport_expiry_date: 'Date of expiry',
|
|
3500
|
+
passport_issue_country: 'Passport issuing country',
|
|
3501
|
+
passport_issue_date: 'Date of issue',
|
|
3502
|
+
passport_photo: 'Photo of passport',
|
|
3503
|
+
travel_docs: 'Travel documents',
|
|
3504
|
+
flight_seat_preference: 'Flight seat preference',
|
|
3505
|
+
meal_preference: 'Meals preference',
|
|
3506
|
+
trusted_traveller: 'Known traveler number',
|
|
3507
|
+
redress_number: 'Redress number'
|
|
3508
|
+
},
|
|
3509
|
+
products: {
|
|
3510
|
+
travel: 'Travel',
|
|
3511
|
+
expense: 'Expense'
|
|
3512
|
+
},
|
|
3513
|
+
travel_fyi_approver: 'FYI approver'
|
|
3437
3514
|
};
|
|
3438
3515
|
|
|
3439
3516
|
var initialState = {
|
|
@@ -5877,7 +5954,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5877
5954
|
userTagType: userTagType
|
|
5878
5955
|
};
|
|
5879
5956
|
|
|
5880
|
-
if (verifyUserId) {
|
|
5957
|
+
if (verifyUserId && isILadmin) {
|
|
5881
5958
|
payload.verifyUserId = verifyUserId;
|
|
5882
5959
|
}
|
|
5883
5960
|
|
|
@@ -6197,10 +6274,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6197
6274
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6198
6275
|
}
|
|
6199
6276
|
}
|
|
6200
|
-
} else if (verifyUserId) {
|
|
6277
|
+
} else if (verifyUserId && isILadmin) {
|
|
6201
6278
|
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
6202
6279
|
|
|
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) &&
|
|
6280
|
+
(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) && window.location.assign(config.routes.signupRequest.list.path);
|
|
6204
6281
|
} else {
|
|
6205
6282
|
var _config$routes5, _config$routes5$users, _config$routes5$users2;
|
|
6206
6283
|
|
|
@@ -6225,7 +6302,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6225
6302
|
};
|
|
6226
6303
|
|
|
6227
6304
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
6228
|
-
if (verifyUserId) {
|
|
6305
|
+
if (verifyUserId && isILadmin) {
|
|
6229
6306
|
dispatch(showLoader());
|
|
6230
6307
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6231
6308
|
setPersonalInfoInput(function (prevState) {
|
|
@@ -6327,6 +6404,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6327
6404
|
}
|
|
6328
6405
|
};
|
|
6329
6406
|
|
|
6407
|
+
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
6408
|
+
if (verifyUserId && isILadmin) {
|
|
6409
|
+
dispatch(showLoader());
|
|
6410
|
+
dispatch(rejectUserVerification(verifyUserId)).then(function (res) {
|
|
6411
|
+
setTimeout(function () {
|
|
6412
|
+
window.location.assign(config.routes.signupRequest.list.path);
|
|
6413
|
+
}, 1500);
|
|
6414
|
+
})["finally"](function () {
|
|
6415
|
+
dispatch(stopLoader());
|
|
6416
|
+
});
|
|
6417
|
+
}
|
|
6418
|
+
};
|
|
6419
|
+
|
|
6330
6420
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
6331
6421
|
component: "div",
|
|
6332
6422
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6343,7 +6433,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6343
6433
|
className: styles.breadcrumb
|
|
6344
6434
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
6345
6435
|
breadCrumbs: [{
|
|
6346
|
-
href: verifyUserId ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6436
|
+
href: verifyUserId && isILadmin ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6347
6437
|
label: 'Users',
|
|
6348
6438
|
hasLink: true
|
|
6349
6439
|
}]
|
|
@@ -6378,7 +6468,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6378
6468
|
type: "contained",
|
|
6379
6469
|
onClick: formSubmitHandler,
|
|
6380
6470
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
6381
|
-
}))
|
|
6471
|
+
})), verifyUserId && isILadmin ? /*#__PURE__*/React.createElement(IUIBox, {
|
|
6472
|
+
component: "div",
|
|
6473
|
+
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
6474
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
6475
|
+
buttonText: "Reject",
|
|
6476
|
+
type: "outlined",
|
|
6477
|
+
onClick: handleSignUpRequestRejection
|
|
6478
|
+
})) : null))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
6382
6479
|
component: "div",
|
|
6383
6480
|
marginTop: "8rem",
|
|
6384
6481
|
flexDirection: "column"
|
|
@@ -9220,7 +9317,7 @@ function MoveUserDialog(_ref) {
|
|
|
9220
9317
|
name: name,
|
|
9221
9318
|
isMove: isMove,
|
|
9222
9319
|
customSelectHandler: customSelectHandler,
|
|
9223
|
-
loadOption:
|
|
9320
|
+
loadOption: commonLoadOptionsUM,
|
|
9224
9321
|
isError: isError,
|
|
9225
9322
|
errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
|
|
9226
9323
|
placeHolderCheck: name !== undefined && name === ''
|
|
@@ -9533,9 +9630,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9533
9630
|
var handleEditPanel = function handleEditPanel(data) {
|
|
9534
9631
|
if (dataList) {
|
|
9535
9632
|
var payload = {
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9633
|
+
rows: [{
|
|
9634
|
+
id: dialogData.data.id,
|
|
9635
|
+
name: dataList
|
|
9636
|
+
}]
|
|
9539
9637
|
};
|
|
9540
9638
|
var message = title + " updated successfully.";
|
|
9541
9639
|
handleApiCall(editRecord, payload, message, 'edit');
|