@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.js
CHANGED
|
@@ -4,13 +4,13 @@ var iuistyles = require('@itilite/iuistyles');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var React__default = _interopDefault(React);
|
|
6
6
|
var utils = require('@itilite/utils');
|
|
7
|
-
var moment = _interopDefault(require('moment'));
|
|
8
7
|
var axios = _interopDefault(require('axios'));
|
|
9
8
|
var AddIcon$1 = _interopDefault(require('@material-ui/icons/Add'));
|
|
10
9
|
var DeleteIcon = _interopDefault(require('@material-ui/icons/Delete'));
|
|
11
10
|
var reactRedux = require('react-redux');
|
|
12
11
|
var redux = require('redux');
|
|
13
12
|
var thunk = _interopDefault(require('redux-thunk'));
|
|
13
|
+
var moment = _interopDefault(require('moment'));
|
|
14
14
|
var reduxDevtoolsExtension = require('redux-devtools-extension');
|
|
15
15
|
var reactRouterDom = require('react-router-dom');
|
|
16
16
|
var styles$8 = require('@material-ui/core/styles');
|
|
@@ -405,6 +405,9 @@ var userAddEditUrl = {
|
|
|
405
405
|
},
|
|
406
406
|
airlineList: function airlineList() {
|
|
407
407
|
return "https://serviceearth.iltech.in/api/v1/paginated/airline/";
|
|
408
|
+
},
|
|
409
|
+
rejectUserVerification: function rejectUserVerification(userId) {
|
|
410
|
+
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
408
411
|
}
|
|
409
412
|
};
|
|
410
413
|
var userListUrl = {
|
|
@@ -466,969 +469,327 @@ var userPanelUrl = {
|
|
|
466
469
|
}
|
|
467
470
|
};
|
|
468
471
|
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
472
|
+
var IUILocalStorageService$1 = utils.services.IUILocalStorageService;
|
|
473
|
+
var api = utils.configs.api;
|
|
474
|
+
var NAoptionConfig = {
|
|
475
|
+
option: {
|
|
476
|
+
label: 'Not assigned',
|
|
477
|
+
value: 'Not assigned'
|
|
478
|
+
},
|
|
479
|
+
applyFor: ['employee_level', 'department']
|
|
476
480
|
};
|
|
477
|
-
var
|
|
478
|
-
|
|
479
|
-
|
|
481
|
+
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
482
|
+
var page = _ref.page,
|
|
483
|
+
tabelName = _ref.tabelName,
|
|
484
|
+
placeholder = _ref.placeholder,
|
|
485
|
+
selectCTA = _ref.selectCTA,
|
|
486
|
+
showNaOption = _ref.showNaOption;
|
|
487
|
+
|
|
488
|
+
try {
|
|
489
|
+
return Promise.resolve(_catch(function () {
|
|
490
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
491
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
492
|
+
return res.data;
|
|
493
|
+
})).then(function (response) {
|
|
494
|
+
var mappedValue = response.results.map(function (item) {
|
|
495
|
+
return {
|
|
496
|
+
value: item.id,
|
|
497
|
+
label: item.name
|
|
498
|
+
};
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
if (showNaOption && page === 1 && NAoptionConfig.applyFor.includes(tabelName)) {
|
|
502
|
+
mappedValue.unshift(NAoptionConfig.option);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (response.next === null && selectCTA) {
|
|
506
|
+
mappedValue.push({
|
|
507
|
+
value: selectCTA.value,
|
|
508
|
+
label: ''
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
return {
|
|
513
|
+
options: mappedValue,
|
|
514
|
+
hasMore: !!response.next,
|
|
515
|
+
additional: {
|
|
516
|
+
page: page + 1,
|
|
517
|
+
tabelName: tabelName,
|
|
518
|
+
placeholder: placeholder,
|
|
519
|
+
selectCTA: selectCTA
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
}, function () {
|
|
524
|
+
return {
|
|
525
|
+
options: [],
|
|
526
|
+
hasMore: false,
|
|
527
|
+
additional: {
|
|
528
|
+
page: 1,
|
|
529
|
+
tabelName: tabelName,
|
|
530
|
+
placeholder: placeholder,
|
|
531
|
+
selectCTA: selectCTA
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
}));
|
|
535
|
+
} catch (e) {
|
|
536
|
+
return Promise.reject(e);
|
|
537
|
+
}
|
|
480
538
|
};
|
|
539
|
+
var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
|
|
540
|
+
var page = _ref2.page,
|
|
541
|
+
tabelName = _ref2.tabelName,
|
|
542
|
+
placeholder = _ref2.placeholder,
|
|
543
|
+
defaultData = _ref2.defaultData;
|
|
481
544
|
|
|
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
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
520
|
-
}, {
|
|
521
|
-
id: 3,
|
|
522
|
-
label: 'Email address',
|
|
523
|
-
name: 'email',
|
|
524
|
-
required: true,
|
|
525
|
-
type: 'input',
|
|
526
|
-
fullWidth: false,
|
|
527
|
-
visibility: true,
|
|
528
|
-
readOnly: false,
|
|
529
|
-
placeholder: 'Enter email address',
|
|
530
|
-
validation: {
|
|
531
|
-
regexOnChange: null,
|
|
532
|
-
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,}))$/,
|
|
533
|
-
maxLimit: '',
|
|
534
|
-
minLimit: '',
|
|
535
|
-
maxLength: 100,
|
|
536
|
-
minLength: 0
|
|
537
|
-
},
|
|
538
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
539
|
-
}, {
|
|
540
|
-
id: 4,
|
|
541
|
-
label: 'Phone number',
|
|
542
|
-
name: 'contact_number',
|
|
543
|
-
required: true,
|
|
544
|
-
type: 'phone',
|
|
545
|
-
fullWidth: false,
|
|
546
|
-
visibility: true,
|
|
547
|
-
readOnly: false,
|
|
548
|
-
validation: {
|
|
549
|
-
regexOnChange: /^[\d]/,
|
|
550
|
-
regexOnBlur: null,
|
|
551
|
-
maxLimit: '',
|
|
552
|
-
minLimit: '',
|
|
553
|
-
maxLength: 100,
|
|
554
|
-
minLength: 0
|
|
555
|
-
},
|
|
556
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
557
|
-
}, {
|
|
558
|
-
id: 5,
|
|
559
|
-
label: 'Date of birth',
|
|
560
|
-
name: 'dob',
|
|
561
|
-
required: false,
|
|
562
|
-
type: 'datepicker',
|
|
563
|
-
fullWidth: false,
|
|
564
|
-
visibility: true,
|
|
565
|
-
readOnly: false,
|
|
566
|
-
hasIcon: false,
|
|
567
|
-
size: 'normal',
|
|
568
|
-
maxDate: dob.maxDate,
|
|
569
|
-
minDate: dob.minDate,
|
|
570
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
571
|
-
}, {
|
|
572
|
-
id: 6,
|
|
573
|
-
empty: true
|
|
574
|
-
}, {
|
|
575
|
-
id: 7,
|
|
576
|
-
label: 'Gender',
|
|
577
|
-
name: 'gender',
|
|
578
|
-
required: false,
|
|
579
|
-
type: 'select',
|
|
580
|
-
fullWidth: false,
|
|
581
|
-
visibility: true,
|
|
582
|
-
readOnly: false,
|
|
583
|
-
placeholder: 'Select gender',
|
|
584
|
-
tooltip: 'This information will be used for flight booking purpose',
|
|
585
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
586
|
-
}, {
|
|
587
|
-
id: 8,
|
|
588
|
-
label: 'Profile photo',
|
|
589
|
-
description: 'This will be displayed on your profile',
|
|
590
|
-
name: 'profile_pic',
|
|
591
|
-
required: false,
|
|
592
|
-
multiple: false,
|
|
593
|
-
fileType: 'image/png,image/jpeg,image/jpg,image/webp,image/JPG,image/JPEG',
|
|
594
|
-
fileSize: 5,
|
|
595
|
-
title: 'Select Profile',
|
|
596
|
-
type: 'file',
|
|
597
|
-
fullWidth: true,
|
|
598
|
-
visibility: true,
|
|
599
|
-
readOnly: false,
|
|
600
|
-
maxNoFiles: 2,
|
|
601
|
-
buttonType: 'profile',
|
|
602
|
-
disableText: 'Disable text here.'
|
|
603
|
-
}];
|
|
604
|
-
var workInfo = [{
|
|
605
|
-
id: 1,
|
|
606
|
-
label: 'Employee level',
|
|
607
|
-
name: 'emp_level',
|
|
608
|
-
required: false,
|
|
609
|
-
type: 'async_select',
|
|
610
|
-
fullWidth: false,
|
|
611
|
-
visibility: true,
|
|
612
|
-
readOnly: false,
|
|
613
|
-
title: 'Select employee level',
|
|
614
|
-
inputType: false,
|
|
615
|
-
placeholder: 'Select employee level',
|
|
616
|
-
loadOption: commonLoadOptions,
|
|
617
|
-
tabelName: 'employee_level',
|
|
618
|
-
tooltip: 'This information will be used in creation of policies and approval rules',
|
|
619
|
-
disableText: 'Please get in touch with your administrator to change this value.',
|
|
620
|
-
selectCTA: {
|
|
621
|
-
value: 'employee_level',
|
|
622
|
-
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
623
|
-
className: "iui__font--color-link iui__font--weight-500"
|
|
624
|
-
}, "+ Add Employee Level"),
|
|
625
|
-
callback: null
|
|
545
|
+
try {
|
|
546
|
+
return Promise.resolve(_catch(function () {
|
|
547
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
548
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
549
|
+
return res.data;
|
|
550
|
+
})).then(function (response) {
|
|
551
|
+
var arrList = response.results.filter(function (item) {
|
|
552
|
+
return item.name !== defaultData;
|
|
553
|
+
});
|
|
554
|
+
var mappedValue = arrList.map(function (item) {
|
|
555
|
+
return {
|
|
556
|
+
value: item.id,
|
|
557
|
+
label: item.name
|
|
558
|
+
};
|
|
559
|
+
});
|
|
560
|
+
return {
|
|
561
|
+
options: mappedValue,
|
|
562
|
+
hasMore: !!response.next,
|
|
563
|
+
additional: {
|
|
564
|
+
page: page + 1,
|
|
565
|
+
tabelName: tabelName
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
});
|
|
569
|
+
}, function () {
|
|
570
|
+
return {
|
|
571
|
+
options: [],
|
|
572
|
+
hasMore: false,
|
|
573
|
+
additional: {
|
|
574
|
+
page: 1,
|
|
575
|
+
tabelName: tabelName,
|
|
576
|
+
placeholder: placeholder
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
}));
|
|
580
|
+
} catch (e) {
|
|
581
|
+
return Promise.reject(e);
|
|
626
582
|
}
|
|
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
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
disableText: 'Please get in touch with your administrator to change this value.',
|
|
662
|
-
selectCTA: {
|
|
663
|
-
value: 'entity',
|
|
664
|
-
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
665
|
-
className: "iui__font--color-link iui__font--weight-500"
|
|
666
|
-
}, "+ Add Entity"),
|
|
667
|
-
callback: null
|
|
668
|
-
}
|
|
669
|
-
}, {
|
|
670
|
-
id: 4,
|
|
671
|
-
label: 'Business unit',
|
|
672
|
-
name: 'business_unit',
|
|
673
|
-
required: false,
|
|
674
|
-
type: 'async_select',
|
|
675
|
-
fullWidth: false,
|
|
676
|
-
visibility: true,
|
|
677
|
-
readOnly: false,
|
|
678
|
-
title: 'Select unit',
|
|
679
|
-
inputType: false,
|
|
680
|
-
placeholder: 'Select unit',
|
|
681
|
-
tabelName: 'business_unit',
|
|
682
|
-
loadOption: commonLoadOptions,
|
|
683
|
-
disableText: 'Please get in touch with your administrator to change this value.',
|
|
684
|
-
selectCTA: {
|
|
685
|
-
value: 'business_unit',
|
|
686
|
-
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
687
|
-
className: "iui__font--color-link iui__font--weight-500"
|
|
688
|
-
}, "+ Add Business Unit"),
|
|
689
|
-
callback: null
|
|
583
|
+
};
|
|
584
|
+
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
585
|
+
var page = _ref3.page;
|
|
586
|
+
|
|
587
|
+
try {
|
|
588
|
+
return Promise.resolve(_catch(function () {
|
|
589
|
+
return Promise.resolve(api.get(userAddEditUrl.currencyCode() + "&search=" + search + "&page=" + page).then(function (res) {
|
|
590
|
+
return res.data;
|
|
591
|
+
})).then(function (response) {
|
|
592
|
+
var mappedValue = response.results.map(function (item) {
|
|
593
|
+
return {
|
|
594
|
+
value: item.currency_code,
|
|
595
|
+
label: item.currency_code
|
|
596
|
+
};
|
|
597
|
+
});
|
|
598
|
+
return {
|
|
599
|
+
options: mappedValue,
|
|
600
|
+
hasMore: !!response.next,
|
|
601
|
+
additional: {
|
|
602
|
+
page: page + 1
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
});
|
|
606
|
+
}, function () {
|
|
607
|
+
return {
|
|
608
|
+
options: [],
|
|
609
|
+
hasMore: false,
|
|
610
|
+
additional: {
|
|
611
|
+
page: 1
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
}));
|
|
615
|
+
} catch (e) {
|
|
616
|
+
return Promise.reject(e);
|
|
690
617
|
}
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
618
|
+
};
|
|
619
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
620
|
+
var page = _ref4.page,
|
|
621
|
+
product = _ref4.product,
|
|
622
|
+
userId = _ref4.userId,
|
|
623
|
+
placeholder = _ref4.placeholder;
|
|
624
|
+
|
|
625
|
+
try {
|
|
626
|
+
return Promise.resolve(_catch(function () {
|
|
627
|
+
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
628
|
+
return res.data;
|
|
629
|
+
})).then(function (response) {
|
|
630
|
+
var mappedValue = response.results.map(function (item) {
|
|
631
|
+
return {
|
|
632
|
+
value: item.approver,
|
|
633
|
+
label: item.approver
|
|
634
|
+
};
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
if (page === 1) {
|
|
638
|
+
var placeholderLbl = {
|
|
639
|
+
value: '',
|
|
640
|
+
label: placeholder
|
|
641
|
+
};
|
|
642
|
+
mappedValue.unshift(placeholderLbl);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
return {
|
|
646
|
+
options: mappedValue,
|
|
647
|
+
hasMore: !!response.next,
|
|
648
|
+
additional: {
|
|
649
|
+
page: page + 1,
|
|
650
|
+
product: product,
|
|
651
|
+
userId: userId
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
});
|
|
655
|
+
}, function () {
|
|
656
|
+
return {
|
|
657
|
+
options: [],
|
|
658
|
+
hasMore: false,
|
|
659
|
+
additional: {
|
|
660
|
+
page: 1,
|
|
661
|
+
product: product,
|
|
662
|
+
userId: userId
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
}));
|
|
666
|
+
} catch (e) {
|
|
667
|
+
return Promise.reject(e);
|
|
712
668
|
}
|
|
713
|
-
}, {
|
|
714
|
-
id: 6,
|
|
715
|
-
label: 'Designation',
|
|
716
|
-
name: 'designation',
|
|
717
|
-
required: false,
|
|
718
|
-
type: 'input',
|
|
719
|
-
fullWidth: false,
|
|
720
|
-
visibility: true,
|
|
721
|
-
readOnly: false,
|
|
722
|
-
placeholder: 'Enter designation',
|
|
723
|
-
validation: {
|
|
724
|
-
regexOnChange: /^[A-Za-z0-9.&'()\- ]*$/,
|
|
725
|
-
regexOnBlur: /^[a-zA-Z][a-zA-Z0-9.&'()\- ]*$/,
|
|
726
|
-
maxLimit: '',
|
|
727
|
-
minLimit: '',
|
|
728
|
-
maxLength: 100,
|
|
729
|
-
minLength: 0
|
|
730
|
-
},
|
|
731
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
732
|
-
}, {
|
|
733
|
-
id: 7,
|
|
734
|
-
label: 'Base location',
|
|
735
|
-
name: 'base_location',
|
|
736
|
-
required: false,
|
|
737
|
-
type: 'input',
|
|
738
|
-
fullWidth: true,
|
|
739
|
-
placeholder: 'Enter city',
|
|
740
|
-
visibility: true,
|
|
741
|
-
readOnly: false,
|
|
742
|
-
validation: {
|
|
743
|
-
regexOnChange: /^[A-Za-z0-9 -.&'()]*$/,
|
|
744
|
-
regexOnBlur: null,
|
|
745
|
-
maxLimit: '',
|
|
746
|
-
minLimit: '',
|
|
747
|
-
maxLength: 500,
|
|
748
|
-
minLength: 0
|
|
749
|
-
},
|
|
750
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
751
|
-
}, {
|
|
752
|
-
id: 7,
|
|
753
|
-
label: 'Default currency',
|
|
754
|
-
name: 'currency',
|
|
755
|
-
required: false,
|
|
756
|
-
type: 'async_select',
|
|
757
|
-
fullWidth: false,
|
|
758
|
-
visibility: true,
|
|
759
|
-
readOnly: false,
|
|
760
|
-
inputType: false,
|
|
761
|
-
tabelName: 'default_currency',
|
|
762
|
-
loadOption: currencyLoadOptions,
|
|
763
|
-
tooltip: 'This only changes the currency for this user',
|
|
764
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
765
|
-
}, {
|
|
766
|
-
id: 8,
|
|
767
|
-
empty: true
|
|
768
|
-
}];
|
|
769
|
-
var products = [{
|
|
770
|
-
id: 1,
|
|
771
|
-
label: 'Travel',
|
|
772
|
-
name: 'travel',
|
|
773
|
-
type: 'checkbox',
|
|
774
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
775
|
-
}, {
|
|
776
|
-
id: 2,
|
|
777
|
-
label: 'Expense',
|
|
778
|
-
name: 'expense',
|
|
779
|
-
type: 'checkbox',
|
|
780
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
781
|
-
}];
|
|
782
|
-
var dropdownList = {
|
|
783
|
-
gender: [{
|
|
784
|
-
id: 1,
|
|
785
|
-
name: 'Male'
|
|
786
|
-
}, {
|
|
787
|
-
id: 2,
|
|
788
|
-
name: 'Female'
|
|
789
|
-
}, {
|
|
790
|
-
id: 3,
|
|
791
|
-
name: 'Others'
|
|
792
|
-
}],
|
|
793
|
-
flight_seat_preference: [],
|
|
794
|
-
meal_preference: [],
|
|
795
|
-
contact_number: [],
|
|
796
|
-
passport_issue_country: [],
|
|
797
|
-
nationality: []
|
|
798
669
|
};
|
|
799
|
-
var
|
|
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
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
id: 1,
|
|
837
|
-
label: 'Person 1',
|
|
838
|
-
name: 'travel_approver',
|
|
839
|
-
required: false,
|
|
840
|
-
type: 'input',
|
|
841
|
-
fullWidth: false,
|
|
842
|
-
visibility: true,
|
|
843
|
-
readOnly: false,
|
|
844
|
-
placeholder: 'Select Approver',
|
|
845
|
-
validation: {
|
|
846
|
-
regexOnChange: null,
|
|
847
|
-
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,}))$/,
|
|
848
|
-
maxLimit: '',
|
|
849
|
-
minLimit: '',
|
|
850
|
-
maxLength: 100,
|
|
851
|
-
minLength: 0
|
|
852
|
-
},
|
|
853
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
854
|
-
}, {
|
|
855
|
-
id: 2,
|
|
856
|
-
label: 'Person 2',
|
|
857
|
-
name: 'travel_approver',
|
|
858
|
-
required: false,
|
|
859
|
-
type: 'input',
|
|
860
|
-
fullWidth: false,
|
|
861
|
-
visibility: true,
|
|
862
|
-
readOnly: false,
|
|
863
|
-
placeholder: 'Select Approver',
|
|
864
|
-
validation: {
|
|
865
|
-
regexOnChange: null,
|
|
866
|
-
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,}))$/,
|
|
867
|
-
maxLimit: '',
|
|
868
|
-
minLimit: '',
|
|
869
|
-
maxLength: 100,
|
|
870
|
-
minLength: 0
|
|
871
|
-
},
|
|
872
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
873
|
-
}]
|
|
670
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
671
|
+
var page = _ref5.page,
|
|
672
|
+
tabelName = _ref5.tabelName;
|
|
673
|
+
|
|
674
|
+
try {
|
|
675
|
+
return Promise.resolve(_catch(function () {
|
|
676
|
+
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
677
|
+
return res.data;
|
|
678
|
+
})).then(function (response) {
|
|
679
|
+
var mappedValue = response.results.map(function (item) {
|
|
680
|
+
return {
|
|
681
|
+
value: item[tabelName],
|
|
682
|
+
label: item[tabelName]
|
|
683
|
+
};
|
|
684
|
+
});
|
|
685
|
+
return {
|
|
686
|
+
options: mappedValue,
|
|
687
|
+
hasMore: !!response.next,
|
|
688
|
+
additional: {
|
|
689
|
+
page: page + 1,
|
|
690
|
+
tabelName: tabelName
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
});
|
|
694
|
+
}, function () {
|
|
695
|
+
return {
|
|
696
|
+
options: [],
|
|
697
|
+
hasMore: false,
|
|
698
|
+
additional: {
|
|
699
|
+
page: 1,
|
|
700
|
+
tabelName: tabelName
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
}));
|
|
704
|
+
} catch (e) {
|
|
705
|
+
return Promise.reject(e);
|
|
706
|
+
}
|
|
874
707
|
};
|
|
875
|
-
var
|
|
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
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
minLimit: '',
|
|
926
|
-
maxLength: 100,
|
|
927
|
-
minLength: 0
|
|
928
|
-
},
|
|
929
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
930
|
-
}, {
|
|
931
|
-
id: 2,
|
|
932
|
-
label: 'Person 2',
|
|
933
|
-
name: 'expense_approver',
|
|
934
|
-
required: false,
|
|
935
|
-
type: 'input',
|
|
936
|
-
fullWidth: false,
|
|
937
|
-
visibility: true,
|
|
938
|
-
readOnly: false,
|
|
939
|
-
placeholder: 'Select Approver',
|
|
940
|
-
validation: {
|
|
941
|
-
regexOnChange: null,
|
|
942
|
-
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,}))$/,
|
|
943
|
-
maxLimit: '',
|
|
944
|
-
minLimit: '',
|
|
945
|
-
maxLength: 100,
|
|
946
|
-
minLength: 0
|
|
947
|
-
},
|
|
948
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
949
|
-
}]
|
|
950
|
-
};
|
|
951
|
-
var passportInfo = [{
|
|
952
|
-
id: 1,
|
|
953
|
-
label: 'Passport issuing country',
|
|
954
|
-
name: 'passport_issue_country',
|
|
955
|
-
required: false,
|
|
956
|
-
type: 'async_select',
|
|
957
|
-
fullWidth: false,
|
|
958
|
-
visibility: true,
|
|
959
|
-
readOnly: false,
|
|
960
|
-
placeholder: 'Select country',
|
|
961
|
-
tabelName: 'country_name',
|
|
962
|
-
loadOption: countryOptions,
|
|
963
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
964
|
-
}, {
|
|
965
|
-
id: 2,
|
|
966
|
-
label: 'Passport number',
|
|
967
|
-
name: 'passport_number',
|
|
968
|
-
required: false,
|
|
969
|
-
type: 'input',
|
|
970
|
-
fullWidth: false,
|
|
971
|
-
visibility: true,
|
|
972
|
-
readOnly: false,
|
|
973
|
-
placeholder: 'Enter passport number',
|
|
974
|
-
validation: {
|
|
975
|
-
regexOnChange: /^[A-Za-z0-9]*$/,
|
|
976
|
-
regexOnBlur: null,
|
|
977
|
-
maxLimit: '',
|
|
978
|
-
minLimit: '',
|
|
979
|
-
maxLength: 15,
|
|
980
|
-
minLength: 7
|
|
981
|
-
},
|
|
982
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
983
|
-
}, {
|
|
984
|
-
id: 3,
|
|
985
|
-
label: 'Nationality',
|
|
986
|
-
name: 'nationality',
|
|
987
|
-
required: false,
|
|
988
|
-
type: 'async_select',
|
|
989
|
-
fullWidth: true,
|
|
990
|
-
visibility: true,
|
|
991
|
-
readOnly: false,
|
|
992
|
-
placeholder: 'Select nationality',
|
|
993
|
-
tabelName: 'nationality',
|
|
994
|
-
loadOption: countryOptions,
|
|
995
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
996
|
-
}, {
|
|
997
|
-
id: 4,
|
|
998
|
-
label: 'Date of issue',
|
|
999
|
-
name: 'passport_issue_date',
|
|
1000
|
-
required: false,
|
|
1001
|
-
type: 'datepicker',
|
|
1002
|
-
hasIcon: false,
|
|
1003
|
-
fullWidth: false,
|
|
1004
|
-
visibility: true,
|
|
1005
|
-
readOnly: false,
|
|
1006
|
-
size: 'small',
|
|
1007
|
-
maxDate: passportStart.maxDate,
|
|
1008
|
-
minDate: passportStart.minDate,
|
|
1009
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1010
|
-
}, {
|
|
1011
|
-
id: 5,
|
|
1012
|
-
label: 'Date of expiry',
|
|
1013
|
-
name: 'passport_expiry_date',
|
|
1014
|
-
required: false,
|
|
1015
|
-
type: 'datepicker',
|
|
1016
|
-
hasIcon: false,
|
|
1017
|
-
fullWidth: false,
|
|
1018
|
-
visibility: true,
|
|
1019
|
-
readOnly: false,
|
|
1020
|
-
size: 'small',
|
|
1021
|
-
maxDate: passportEnd.maxDate,
|
|
1022
|
-
minDate: passportEnd.minDate,
|
|
1023
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1024
|
-
}, {
|
|
1025
|
-
id: 6,
|
|
1026
|
-
label: 'Photo of passport',
|
|
1027
|
-
description: '',
|
|
1028
|
-
name: 'passport_photo',
|
|
1029
|
-
required: false,
|
|
1030
|
-
type: 'file',
|
|
1031
|
-
multiple: true,
|
|
1032
|
-
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
1033
|
-
fileSize: 5,
|
|
1034
|
-
title: 'Select Photo',
|
|
1035
|
-
fullWidth: true,
|
|
1036
|
-
visibility: true,
|
|
1037
|
-
readOnly: false,
|
|
1038
|
-
maxNoFiles: 2,
|
|
1039
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1040
|
-
}, {
|
|
1041
|
-
id: 7,
|
|
1042
|
-
label: 'Travel documents',
|
|
1043
|
-
description: 'You can add upto 5 documents',
|
|
1044
|
-
name: 'travel_docs',
|
|
1045
|
-
required: false,
|
|
1046
|
-
multiple: true,
|
|
1047
|
-
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
1048
|
-
fileSize: 5,
|
|
1049
|
-
title: 'Select document',
|
|
1050
|
-
type: 'file',
|
|
1051
|
-
fullWidth: true,
|
|
1052
|
-
visibility: true,
|
|
1053
|
-
readOnly: false,
|
|
1054
|
-
maxNoFiles: 5,
|
|
1055
|
-
tooltip: 'This is for quick access of important travel documents during your trip like Visa, Identification, Vaccine certificates etc.',
|
|
1056
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1057
|
-
}];
|
|
1058
|
-
var travelPreference = [{
|
|
1059
|
-
id: 1,
|
|
1060
|
-
label: 'Flight seat preference',
|
|
1061
|
-
name: 'flight_seat_preference',
|
|
1062
|
-
required: false,
|
|
1063
|
-
type: 'select',
|
|
1064
|
-
fullWidth: false,
|
|
1065
|
-
visibility: true,
|
|
1066
|
-
readOnly: false,
|
|
1067
|
-
placeholder: 'Select seat preference',
|
|
1068
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1069
|
-
}, {
|
|
1070
|
-
id: 1,
|
|
1071
|
-
label: 'Meals preference',
|
|
1072
|
-
name: 'meal_preference',
|
|
1073
|
-
required: false,
|
|
1074
|
-
type: 'select',
|
|
1075
|
-
fullWidth: false,
|
|
1076
|
-
visibility: true,
|
|
1077
|
-
readOnly: false,
|
|
1078
|
-
placeholder: 'Select meals preference',
|
|
1079
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1080
|
-
}];
|
|
1081
|
-
var secureTravelInfo = [{
|
|
1082
|
-
id: 1,
|
|
1083
|
-
label: 'Known traveler number',
|
|
1084
|
-
placeholder: 'Enter known traveler number',
|
|
1085
|
-
name: 'trusted_traveller',
|
|
1086
|
-
required: false,
|
|
1087
|
-
type: 'input',
|
|
1088
|
-
hasIcon: true,
|
|
1089
|
-
fullWidth: false,
|
|
1090
|
-
visibility: true,
|
|
1091
|
-
readOnly: false,
|
|
1092
|
-
tooltip: /*#__PURE__*/React__default.createElement(React__default.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__default.createElement("a", {
|
|
1093
|
-
href: "https://www.tsa.gov/travel/frequently-asked-questions",
|
|
1094
|
-
target: "_blank",
|
|
1095
|
-
rel: "noreferrer"
|
|
1096
|
-
}, "visit TSA's PreCheck website")),
|
|
1097
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1098
|
-
}, {
|
|
1099
|
-
id: 1,
|
|
1100
|
-
label: 'Redress number',
|
|
1101
|
-
placeholder: 'Enter redress number',
|
|
1102
|
-
name: 'redress_number',
|
|
1103
|
-
required: false,
|
|
1104
|
-
type: 'input',
|
|
1105
|
-
hasIcon: true,
|
|
1106
|
-
fullWidth: false,
|
|
1107
|
-
visibility: true,
|
|
1108
|
-
readOnly: false,
|
|
1109
|
-
tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.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__default.createElement("a", {
|
|
1110
|
-
href: "https://www.tsa.gov/travel/passenger-support/travel-redress-program",
|
|
1111
|
-
target: "_blank",
|
|
1112
|
-
rel: "noreferrer"
|
|
1113
|
-
}, "visit TSA's Secure Flight website"))),
|
|
1114
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
1115
|
-
}];
|
|
1116
|
-
var NAoptionConfig = {
|
|
1117
|
-
option: {
|
|
1118
|
-
label: 'Not assigned',
|
|
1119
|
-
value: 'Not assigned'
|
|
1120
|
-
},
|
|
1121
|
-
applyFor: ['employee_level', 'department']
|
|
1122
|
-
};
|
|
1123
|
-
var userAddPageFormLabels = {
|
|
1124
|
-
user_personal_info: {
|
|
1125
|
-
first_name: 'First and middle name',
|
|
1126
|
-
last_name: 'Last name',
|
|
1127
|
-
email: 'Email address',
|
|
1128
|
-
contact_number: 'Phone number',
|
|
1129
|
-
dob: 'Date of birth',
|
|
1130
|
-
gender: 'Gender',
|
|
1131
|
-
profile_pic: 'Profile photo'
|
|
1132
|
-
},
|
|
1133
|
-
employee_info: {
|
|
1134
|
-
emp_level: 'Employee level',
|
|
1135
|
-
employee_id: 'Employee ID',
|
|
1136
|
-
entity: 'Entity',
|
|
1137
|
-
business_unit: 'Business unit',
|
|
1138
|
-
department: 'Department',
|
|
1139
|
-
designation: 'Designation',
|
|
1140
|
-
base_location: 'Base location',
|
|
1141
|
-
currency: 'Default currency'
|
|
1142
|
-
},
|
|
1143
|
-
user_travel_info: {
|
|
1144
|
-
nationality: 'Nationality',
|
|
1145
|
-
passport_number: 'Passport number',
|
|
1146
|
-
passport_expiry_date: 'Date of expiry',
|
|
1147
|
-
passport_issue_country: 'Passport issuing country',
|
|
1148
|
-
passport_issue_date: 'Date of issue',
|
|
1149
|
-
passport_photo: 'Photo of passport',
|
|
1150
|
-
travel_docs: 'Travel documents',
|
|
1151
|
-
flight_seat_preference: 'Flight seat preference',
|
|
1152
|
-
meal_preference: 'Meals preference',
|
|
1153
|
-
trusted_traveller: 'Known traveler number',
|
|
1154
|
-
redress_number: 'Redress number'
|
|
1155
|
-
},
|
|
1156
|
-
products: {
|
|
1157
|
-
travel: 'Travel',
|
|
1158
|
-
expense: 'Expense'
|
|
1159
|
-
},
|
|
1160
|
-
travel_fyi_approver: 'FYI approver'
|
|
708
|
+
var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
709
|
+
var page = _ref6.page,
|
|
710
|
+
placeholder = _ref6.placeholder;
|
|
711
|
+
|
|
712
|
+
try {
|
|
713
|
+
return Promise.resolve(_catch(function () {
|
|
714
|
+
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
715
|
+
var token = IUILocalStorageService$1.getAccessToken();
|
|
716
|
+
return Promise.resolve(axios.get(url, {
|
|
717
|
+
headers: {
|
|
718
|
+
Authorization: 'Bearer ' + token
|
|
719
|
+
}
|
|
720
|
+
})).then(function (response) {
|
|
721
|
+
return Promise.resolve(response.data.results.map(function (item) {
|
|
722
|
+
return {
|
|
723
|
+
value: item.id,
|
|
724
|
+
label: item.name
|
|
725
|
+
};
|
|
726
|
+
})).then(function (mappedValue) {
|
|
727
|
+
if (placeholder) {
|
|
728
|
+
var placeholderLbl = {
|
|
729
|
+
value: '',
|
|
730
|
+
label: placeholder
|
|
731
|
+
};
|
|
732
|
+
mappedValue.unshift(placeholderLbl);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
return {
|
|
736
|
+
options: mappedValue,
|
|
737
|
+
hasMore: !!response.data.next,
|
|
738
|
+
additional: {
|
|
739
|
+
page: page + 1,
|
|
740
|
+
placeholder: placeholder
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
});
|
|
744
|
+
});
|
|
745
|
+
}, function () {
|
|
746
|
+
return {
|
|
747
|
+
options: [],
|
|
748
|
+
hasMore: false,
|
|
749
|
+
additional: {
|
|
750
|
+
page: 1,
|
|
751
|
+
placeholder: placeholder
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
}));
|
|
755
|
+
} catch (e) {
|
|
756
|
+
return Promise.reject(e);
|
|
757
|
+
}
|
|
1161
758
|
};
|
|
1162
759
|
|
|
1163
|
-
var
|
|
1164
|
-
var
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
760
|
+
var UserRole = function UserRole(_ref) {
|
|
761
|
+
var _ref$list = _ref.list,
|
|
762
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
763
|
+
_ref$value = _ref.value,
|
|
764
|
+
value = _ref$value === void 0 ? '' : _ref$value;
|
|
765
|
+
var role = list.find(function (role) {
|
|
766
|
+
return role.name === value;
|
|
767
|
+
});
|
|
768
|
+
return /*#__PURE__*/React__default.createElement("div", null, role && /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
769
|
+
label: role.label,
|
|
770
|
+
headerType: true,
|
|
771
|
+
description: role.description
|
|
772
|
+
}));
|
|
773
|
+
};
|
|
1171
774
|
|
|
1172
|
-
|
|
1173
|
-
return Promise.resolve(_catch(function () {
|
|
1174
|
-
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
1175
|
-
return Promise.resolve(api.get(url).then(function (res) {
|
|
1176
|
-
return res.data;
|
|
1177
|
-
})).then(function (response) {
|
|
1178
|
-
var mappedValue = response.results.map(function (item) {
|
|
1179
|
-
return {
|
|
1180
|
-
value: item.id,
|
|
1181
|
-
label: item.name
|
|
1182
|
-
};
|
|
1183
|
-
});
|
|
775
|
+
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"};
|
|
1184
776
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
777
|
+
var SHOW_LOADER = 'SHOW_LOADER';
|
|
778
|
+
var STOP_LOADER = 'STOP_LOADER';
|
|
779
|
+
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
780
|
+
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
781
|
+
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
782
|
+
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
783
|
+
var SET_EDITED_TRAVEL_APPROVER_FIELD = 'SET_EDITED_TRAVEL_APPROVER_FIELD';
|
|
784
|
+
var SET_EDITED_EXPENSE_APPROVER_FIELD = 'SET_EDITED_EXPENSE_APPROVER_FIELD';
|
|
785
|
+
var SET_COUNTRY_CODES = 'SET_COUNTRY_CODES';
|
|
786
|
+
var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
787
|
+
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
1188
788
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
});
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
return {
|
|
1197
|
-
options: mappedValue,
|
|
1198
|
-
hasMore: !!response.next,
|
|
1199
|
-
additional: {
|
|
1200
|
-
page: page + 1,
|
|
1201
|
-
tabelName: tabelName,
|
|
1202
|
-
placeholder: placeholder,
|
|
1203
|
-
selectCTA: selectCTA
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
});
|
|
1207
|
-
}, function () {
|
|
1208
|
-
return {
|
|
1209
|
-
options: [],
|
|
1210
|
-
hasMore: false,
|
|
1211
|
-
additional: {
|
|
1212
|
-
page: 1,
|
|
1213
|
-
tabelName: tabelName,
|
|
1214
|
-
placeholder: placeholder,
|
|
1215
|
-
selectCTA: selectCTA
|
|
1216
|
-
}
|
|
1217
|
-
};
|
|
1218
|
-
}));
|
|
1219
|
-
} catch (e) {
|
|
1220
|
-
return Promise.reject(e);
|
|
1221
|
-
}
|
|
1222
|
-
};
|
|
1223
|
-
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
1224
|
-
var page = _ref3.page;
|
|
1225
|
-
|
|
1226
|
-
try {
|
|
1227
|
-
return Promise.resolve(_catch(function () {
|
|
1228
|
-
return Promise.resolve(api.get(userAddEditUrl.currencyCode() + "&search=" + search + "&page=" + page).then(function (res) {
|
|
1229
|
-
return res.data;
|
|
1230
|
-
})).then(function (response) {
|
|
1231
|
-
var mappedValue = response.results.map(function (item) {
|
|
1232
|
-
return {
|
|
1233
|
-
value: item.currency_code,
|
|
1234
|
-
label: item.currency_code
|
|
1235
|
-
};
|
|
1236
|
-
});
|
|
1237
|
-
return {
|
|
1238
|
-
options: mappedValue,
|
|
1239
|
-
hasMore: !!response.next,
|
|
1240
|
-
additional: {
|
|
1241
|
-
page: page + 1
|
|
1242
|
-
}
|
|
1243
|
-
};
|
|
1244
|
-
});
|
|
1245
|
-
}, function () {
|
|
1246
|
-
return {
|
|
1247
|
-
options: [],
|
|
1248
|
-
hasMore: false,
|
|
1249
|
-
additional: {
|
|
1250
|
-
page: 1
|
|
1251
|
-
}
|
|
1252
|
-
};
|
|
1253
|
-
}));
|
|
1254
|
-
} catch (e) {
|
|
1255
|
-
return Promise.reject(e);
|
|
1256
|
-
}
|
|
1257
|
-
};
|
|
1258
|
-
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
1259
|
-
var page = _ref4.page,
|
|
1260
|
-
product = _ref4.product,
|
|
1261
|
-
userId = _ref4.userId,
|
|
1262
|
-
placeholder = _ref4.placeholder;
|
|
1263
|
-
|
|
1264
|
-
try {
|
|
1265
|
-
return Promise.resolve(_catch(function () {
|
|
1266
|
-
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
1267
|
-
return res.data;
|
|
1268
|
-
})).then(function (response) {
|
|
1269
|
-
var mappedValue = response.results.map(function (item) {
|
|
1270
|
-
return {
|
|
1271
|
-
value: item.approver,
|
|
1272
|
-
label: item.approver
|
|
1273
|
-
};
|
|
1274
|
-
});
|
|
1275
|
-
|
|
1276
|
-
if (page === 1) {
|
|
1277
|
-
var placeholderLbl = {
|
|
1278
|
-
value: '',
|
|
1279
|
-
label: placeholder
|
|
1280
|
-
};
|
|
1281
|
-
mappedValue.unshift(placeholderLbl);
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
return {
|
|
1285
|
-
options: mappedValue,
|
|
1286
|
-
hasMore: !!response.next,
|
|
1287
|
-
additional: {
|
|
1288
|
-
page: page + 1,
|
|
1289
|
-
product: product,
|
|
1290
|
-
userId: userId
|
|
1291
|
-
}
|
|
1292
|
-
};
|
|
1293
|
-
});
|
|
1294
|
-
}, function () {
|
|
1295
|
-
return {
|
|
1296
|
-
options: [],
|
|
1297
|
-
hasMore: false,
|
|
1298
|
-
additional: {
|
|
1299
|
-
page: 1,
|
|
1300
|
-
product: product,
|
|
1301
|
-
userId: userId
|
|
1302
|
-
}
|
|
1303
|
-
};
|
|
1304
|
-
}));
|
|
1305
|
-
} catch (e) {
|
|
1306
|
-
return Promise.reject(e);
|
|
1307
|
-
}
|
|
1308
|
-
};
|
|
1309
|
-
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
1310
|
-
var page = _ref5.page,
|
|
1311
|
-
tabelName = _ref5.tabelName;
|
|
1312
|
-
|
|
1313
|
-
try {
|
|
1314
|
-
return Promise.resolve(_catch(function () {
|
|
1315
|
-
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
1316
|
-
return res.data;
|
|
1317
|
-
})).then(function (response) {
|
|
1318
|
-
var mappedValue = response.results.map(function (item) {
|
|
1319
|
-
return {
|
|
1320
|
-
value: item[tabelName],
|
|
1321
|
-
label: item[tabelName]
|
|
1322
|
-
};
|
|
1323
|
-
});
|
|
1324
|
-
return {
|
|
1325
|
-
options: mappedValue,
|
|
1326
|
-
hasMore: !!response.next,
|
|
1327
|
-
additional: {
|
|
1328
|
-
page: page + 1,
|
|
1329
|
-
tabelName: tabelName
|
|
1330
|
-
}
|
|
1331
|
-
};
|
|
1332
|
-
});
|
|
1333
|
-
}, function () {
|
|
1334
|
-
return {
|
|
1335
|
-
options: [],
|
|
1336
|
-
hasMore: false,
|
|
1337
|
-
additional: {
|
|
1338
|
-
page: 1,
|
|
1339
|
-
tabelName: tabelName
|
|
1340
|
-
}
|
|
1341
|
-
};
|
|
1342
|
-
}));
|
|
1343
|
-
} catch (e) {
|
|
1344
|
-
return Promise.reject(e);
|
|
1345
|
-
}
|
|
1346
|
-
};
|
|
1347
|
-
var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
1348
|
-
var page = _ref6.page,
|
|
1349
|
-
placeholder = _ref6.placeholder;
|
|
1350
|
-
|
|
1351
|
-
try {
|
|
1352
|
-
return Promise.resolve(_catch(function () {
|
|
1353
|
-
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
1354
|
-
var token = IUILocalStorageService$1.getAccessToken();
|
|
1355
|
-
return Promise.resolve(axios.get(url, {
|
|
1356
|
-
headers: {
|
|
1357
|
-
Authorization: 'Bearer ' + token
|
|
1358
|
-
}
|
|
1359
|
-
})).then(function (response) {
|
|
1360
|
-
return Promise.resolve(response.data.results.map(function (item) {
|
|
1361
|
-
return {
|
|
1362
|
-
value: item.id,
|
|
1363
|
-
label: item.name
|
|
1364
|
-
};
|
|
1365
|
-
})).then(function (mappedValue) {
|
|
1366
|
-
if (placeholder) {
|
|
1367
|
-
var placeholderLbl = {
|
|
1368
|
-
value: '',
|
|
1369
|
-
label: placeholder
|
|
1370
|
-
};
|
|
1371
|
-
mappedValue.unshift(placeholderLbl);
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
return {
|
|
1375
|
-
options: mappedValue,
|
|
1376
|
-
hasMore: !!response.data.next,
|
|
1377
|
-
additional: {
|
|
1378
|
-
page: page + 1,
|
|
1379
|
-
placeholder: placeholder
|
|
1380
|
-
}
|
|
1381
|
-
};
|
|
1382
|
-
});
|
|
1383
|
-
});
|
|
1384
|
-
}, function () {
|
|
1385
|
-
return {
|
|
1386
|
-
options: [],
|
|
1387
|
-
hasMore: false,
|
|
1388
|
-
additional: {
|
|
1389
|
-
page: 1,
|
|
1390
|
-
placeholder: placeholder
|
|
1391
|
-
}
|
|
1392
|
-
};
|
|
1393
|
-
}));
|
|
1394
|
-
} catch (e) {
|
|
1395
|
-
return Promise.reject(e);
|
|
1396
|
-
}
|
|
1397
|
-
};
|
|
1398
|
-
|
|
1399
|
-
var UserRole = function UserRole(_ref) {
|
|
1400
|
-
var _ref$list = _ref.list,
|
|
1401
|
-
list = _ref$list === void 0 ? [] : _ref$list,
|
|
1402
|
-
_ref$value = _ref.value,
|
|
1403
|
-
value = _ref$value === void 0 ? '' : _ref$value;
|
|
1404
|
-
var role = list.find(function (role) {
|
|
1405
|
-
return role.name === value;
|
|
1406
|
-
});
|
|
1407
|
-
return /*#__PURE__*/React__default.createElement("div", null, role && /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
1408
|
-
label: role.label,
|
|
1409
|
-
headerType: true,
|
|
1410
|
-
description: role.description
|
|
1411
|
-
}));
|
|
1412
|
-
};
|
|
1413
|
-
|
|
1414
|
-
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"};
|
|
1415
|
-
|
|
1416
|
-
var SHOW_LOADER = 'SHOW_LOADER';
|
|
1417
|
-
var STOP_LOADER = 'STOP_LOADER';
|
|
1418
|
-
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
1419
|
-
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
1420
|
-
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
1421
|
-
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
1422
|
-
var SET_EDITED_TRAVEL_APPROVER_FIELD = 'SET_EDITED_TRAVEL_APPROVER_FIELD';
|
|
1423
|
-
var SET_EDITED_EXPENSE_APPROVER_FIELD = 'SET_EDITED_EXPENSE_APPROVER_FIELD';
|
|
1424
|
-
var SET_COUNTRY_CODES = 'SET_COUNTRY_CODES';
|
|
1425
|
-
var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
1426
|
-
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
1427
|
-
|
|
1428
|
-
var env$1 = utils.configs.env;
|
|
1429
|
-
var IUILocalStorageService$2 = utils.services.IUILocalStorageService;
|
|
1430
|
-
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
1431
|
-
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
789
|
+
var env$1 = utils.configs.env;
|
|
790
|
+
var IUILocalStorageService$2 = utils.services.IUILocalStorageService;
|
|
791
|
+
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
792
|
+
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
1432
793
|
|
|
1433
794
|
var res = {
|
|
1434
795
|
company_id: +IUILocalStorageService$2.getCompanyId(),
|
|
@@ -1924,12 +1285,12 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1924
1285
|
return new Promise(function (resolve, reject) {
|
|
1925
1286
|
var _travelApprovers = getState().userAddEdit.renderFields.travelApprovers;
|
|
1926
1287
|
var sNo = _travelApprovers.length + 1;
|
|
1927
|
-
var label = "Travel
|
|
1288
|
+
var label = "Travel approver " + sNo;
|
|
1928
1289
|
|
|
1929
1290
|
_travelApprovers.forEach(function (approver) {
|
|
1930
1291
|
if (approver.label === label) {
|
|
1931
1292
|
sNo++;
|
|
1932
|
-
label = "Travel
|
|
1293
|
+
label = "Travel approver " + sNo;
|
|
1933
1294
|
}
|
|
1934
1295
|
});
|
|
1935
1296
|
|
|
@@ -1968,12 +1329,12 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1968
1329
|
return new Promise(function (resolve, reject) {
|
|
1969
1330
|
var _expenseApprovers = getState().userAddEdit.renderFields.expenseApprovers;
|
|
1970
1331
|
var sNo = _expenseApprovers.length + 1;
|
|
1971
|
-
var label = "Expense
|
|
1332
|
+
var label = "Expense approver " + sNo;
|
|
1972
1333
|
|
|
1973
1334
|
_expenseApprovers.forEach(function (approver) {
|
|
1974
1335
|
if (approver.label === label) {
|
|
1975
1336
|
sNo++;
|
|
1976
|
-
label = "Expense
|
|
1337
|
+
label = "Expense approver " + sNo;
|
|
1977
1338
|
}
|
|
1978
1339
|
});
|
|
1979
1340
|
|
|
@@ -2285,6 +1646,33 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
|
2285
1646
|
});
|
|
2286
1647
|
};
|
|
2287
1648
|
};
|
|
1649
|
+
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
1650
|
+
return function (dispatch) {
|
|
1651
|
+
return new Promise(function (resolve, reject) {
|
|
1652
|
+
api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
1653
|
+
console.log(res);
|
|
1654
|
+
|
|
1655
|
+
if (res.data.status === true) {
|
|
1656
|
+
var _res$data5;
|
|
1657
|
+
|
|
1658
|
+
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.');
|
|
1659
|
+
resolve(res.data);
|
|
1660
|
+
} else {
|
|
1661
|
+
var _res$data6;
|
|
1662
|
+
|
|
1663
|
+
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.');
|
|
1664
|
+
reject(res);
|
|
1665
|
+
}
|
|
1666
|
+
})["catch"](function (err) {
|
|
1667
|
+
var _err$response11, _err$response11$data;
|
|
1668
|
+
|
|
1669
|
+
console.log(err);
|
|
1670
|
+
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.');
|
|
1671
|
+
reject(err);
|
|
1672
|
+
});
|
|
1673
|
+
});
|
|
1674
|
+
};
|
|
1675
|
+
};
|
|
2288
1676
|
|
|
2289
1677
|
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
2290
1678
|
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
@@ -2752,8 +2140,10 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2752
2140
|
var AddCard = function AddCard(_ref2) {
|
|
2753
2141
|
var pg = _ref2.pg;
|
|
2754
2142
|
|
|
2143
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2144
|
+
|
|
2755
2145
|
var handleAddCard = function handleAddCard() {
|
|
2756
|
-
window.location.assign(
|
|
2146
|
+
window.location.assign(_url);
|
|
2757
2147
|
};
|
|
2758
2148
|
|
|
2759
2149
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -2954,13 +2344,13 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2954
2344
|
var rgx = null;
|
|
2955
2345
|
|
|
2956
2346
|
if (type === 'travel') {
|
|
2957
|
-
rgx = /^(travel
|
|
2347
|
+
rgx = /^(travel approver)( )[0-9]*$/i;
|
|
2958
2348
|
} else {
|
|
2959
|
-
rgx = /^(expense
|
|
2349
|
+
rgx = /^(expense approver)( )[0-9]*$/i;
|
|
2960
2350
|
}
|
|
2961
2351
|
|
|
2962
|
-
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + "
|
|
2963
|
-
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2352
|
+
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + " approver " + (editedLabel.approvers[i].indexAt + 1)) {
|
|
2353
|
+
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (editedLabel.approvers[i].indexAt + 1) + "' to '" + editedLabel.approvers[i].label + "'";
|
|
2964
2354
|
|
|
2965
2355
|
if (!hasError) {
|
|
2966
2356
|
hasError = true;
|
|
@@ -3075,10 +2465,10 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3075
2465
|
return null;
|
|
3076
2466
|
}
|
|
3077
2467
|
|
|
3078
|
-
if (p.label.toLowerCase() === type + "
|
|
2468
|
+
if (p.label.toLowerCase() === type + " approver " + (i + 1)) {
|
|
3079
2469
|
p.secondaryLabel = '';
|
|
3080
2470
|
} else {
|
|
3081
|
-
p.secondaryLabel = type + "
|
|
2471
|
+
p.secondaryLabel = type + " approver " + (i + 1);
|
|
3082
2472
|
}
|
|
3083
2473
|
|
|
3084
2474
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
@@ -3194,7 +2584,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3194
2584
|
className: styles.fieldMargin
|
|
3195
2585
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
3196
2586
|
defaultValue: p.label,
|
|
3197
|
-
label: (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2587
|
+
label: (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (i + 1),
|
|
3198
2588
|
className: styles.inputWidth,
|
|
3199
2589
|
id: type + '_' + p.sequence,
|
|
3200
2590
|
name: type + '_' + p.sequence,
|
|
@@ -3309,134 +2699,821 @@ var AddCustomFieldModal = function AddCustomFieldModal(_ref) {
|
|
|
3309
2699
|
overflow: 'auto',
|
|
3310
2700
|
margin: '0px'
|
|
3311
2701
|
},
|
|
3312
|
-
footerStyle: {
|
|
3313
|
-
justifyContent: 'end'
|
|
3314
|
-
}
|
|
3315
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
3316
|
-
component: "div",
|
|
3317
|
-
display: "flex",
|
|
3318
|
-
justifyContent: "center",
|
|
3319
|
-
alignItems: "center",
|
|
3320
|
-
flexDirection: "column",
|
|
3321
|
-
padding: "8px 20px"
|
|
3322
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
3323
|
-
label: "Field label",
|
|
3324
|
-
fullwidth: false,
|
|
3325
|
-
className: styles$2.inputWidth,
|
|
3326
|
-
customHandler: addCustomFieldsLabel,
|
|
3327
|
-
required: true,
|
|
3328
|
-
errorMsg: inputValueErr,
|
|
3329
|
-
isError: !!inputValueErr,
|
|
3330
|
-
defaultValue: inputValue
|
|
3331
|
-
})));
|
|
2702
|
+
footerStyle: {
|
|
2703
|
+
justifyContent: 'end'
|
|
2704
|
+
}
|
|
2705
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
2706
|
+
component: "div",
|
|
2707
|
+
display: "flex",
|
|
2708
|
+
justifyContent: "center",
|
|
2709
|
+
alignItems: "center",
|
|
2710
|
+
flexDirection: "column",
|
|
2711
|
+
padding: "8px 20px"
|
|
2712
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
2713
|
+
label: "Field label",
|
|
2714
|
+
fullwidth: false,
|
|
2715
|
+
className: styles$2.inputWidth,
|
|
2716
|
+
customHandler: addCustomFieldsLabel,
|
|
2717
|
+
required: true,
|
|
2718
|
+
errorMsg: inputValueErr,
|
|
2719
|
+
isError: !!inputValueErr,
|
|
2720
|
+
defaultValue: inputValue
|
|
2721
|
+
})));
|
|
2722
|
+
};
|
|
2723
|
+
|
|
2724
|
+
var CustomFields = function CustomFields(_ref) {
|
|
2725
|
+
var _ref$inputState = _ref.inputState,
|
|
2726
|
+
inputState = _ref$inputState === void 0 ? {} : _ref$inputState,
|
|
2727
|
+
_ref$onChangeHandler = _ref.onChangeHandler,
|
|
2728
|
+
onChangeHandler = _ref$onChangeHandler === void 0 ? function () {} : _ref$onChangeHandler,
|
|
2729
|
+
_ref$isProfile = _ref.isProfile,
|
|
2730
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
2731
|
+
var customFields = reactRedux.useSelector(function (state) {
|
|
2732
|
+
return state.userAddEdit.renderFields.custom_attributes;
|
|
2733
|
+
});
|
|
2734
|
+
var maxCustomAttributes = reactRedux.useSelector(function (state) {
|
|
2735
|
+
return state.userAddEdit.maxCustomAttributes;
|
|
2736
|
+
});
|
|
2737
|
+
|
|
2738
|
+
var _useState = React.useState(false),
|
|
2739
|
+
isOpenModal = _useState[0],
|
|
2740
|
+
setOpenModalFlag = _useState[1];
|
|
2741
|
+
|
|
2742
|
+
var openCustomFieldModal = function openCustomFieldModal() {
|
|
2743
|
+
setOpenModalFlag(true);
|
|
2744
|
+
};
|
|
2745
|
+
|
|
2746
|
+
if (isProfile && customFields.length === 0) {
|
|
2747
|
+
return null;
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
2751
|
+
className: styles.dividerColor
|
|
2752
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2753
|
+
container: true,
|
|
2754
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
2755
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2756
|
+
item: true,
|
|
2757
|
+
sm: 12,
|
|
2758
|
+
md: 4
|
|
2759
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
2760
|
+
label: "Custom fields",
|
|
2761
|
+
headerType: true,
|
|
2762
|
+
description: isProfile ? '' : "You can add up to " + maxCustomAttributes + " fields",
|
|
2763
|
+
hasInfoIcon: !isProfile,
|
|
2764
|
+
tooltipText: "Use custom fields to collect additional information that help you tailor data for your business\u2019 needs"
|
|
2765
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2766
|
+
item: true,
|
|
2767
|
+
sm: 12,
|
|
2768
|
+
md: 8,
|
|
2769
|
+
lg: 8,
|
|
2770
|
+
xl: 6
|
|
2771
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2772
|
+
container: true,
|
|
2773
|
+
className: styles.formFieldsWrapper
|
|
2774
|
+
}, customFields.length === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
2775
|
+
className: styles.emptyFieldContainer
|
|
2776
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
2777
|
+
className: styles.emptyFieldDescription
|
|
2778
|
+
}, "Add custom fields to collect additional information that help you tailor data for your business\u2019 needs"), !isProfile && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
2779
|
+
className: styles.emptyFieldBtnContainer
|
|
2780
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
2781
|
+
buttonText: "Add custom field",
|
|
2782
|
+
type: "text",
|
|
2783
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
2784
|
+
width: "10",
|
|
2785
|
+
height: "10",
|
|
2786
|
+
color: "#EC5D25"
|
|
2787
|
+
}),
|
|
2788
|
+
className: styles.paddingTop,
|
|
2789
|
+
onClick: openCustomFieldModal
|
|
2790
|
+
}))), customFields.length > 0 && customFields.map(function (p, i) {
|
|
2791
|
+
if (i >= maxCustomAttributes) {
|
|
2792
|
+
return null;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2796
|
+
key: i.toString(),
|
|
2797
|
+
item: true,
|
|
2798
|
+
md: 8,
|
|
2799
|
+
lg: 8,
|
|
2800
|
+
xl: 8
|
|
2801
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
2802
|
+
label: p.field_name || "Custom " + p.attribute_column,
|
|
2803
|
+
fullwidth: false,
|
|
2804
|
+
defaultValue: inputState["custom" + p.attribute_column],
|
|
2805
|
+
name: "custom" + p.attribute_column,
|
|
2806
|
+
customHandler: onChangeHandler,
|
|
2807
|
+
readOnly: isProfile
|
|
2808
|
+
}));
|
|
2809
|
+
}), !isProfile && customFields.length > 0 && customFields.length < maxCustomAttributes && /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2810
|
+
item: true,
|
|
2811
|
+
md: 8,
|
|
2812
|
+
lg: 8,
|
|
2813
|
+
xl: 8
|
|
2814
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
2815
|
+
buttonText: "Add custom field",
|
|
2816
|
+
type: "text",
|
|
2817
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
2818
|
+
width: "10",
|
|
2819
|
+
height: "10",
|
|
2820
|
+
color: "#EC5D25"
|
|
2821
|
+
}),
|
|
2822
|
+
className: styles.paddingTop,
|
|
2823
|
+
onClick: openCustomFieldModal
|
|
2824
|
+
}))))), /*#__PURE__*/React__default.createElement(AddCustomFieldModal, {
|
|
2825
|
+
isOpenModal: isOpenModal,
|
|
2826
|
+
closeModalHandler: function closeModalHandler() {
|
|
2827
|
+
return setOpenModalFlag(false);
|
|
2828
|
+
}
|
|
2829
|
+
}));
|
|
2830
|
+
};
|
|
2831
|
+
|
|
2832
|
+
var dob = {
|
|
2833
|
+
maxDate: moment().subtract(18, 'years'),
|
|
2834
|
+
minDate: moment().subtract(300, 'years')
|
|
2835
|
+
};
|
|
2836
|
+
var passportStart = {
|
|
2837
|
+
maxDate: moment(),
|
|
2838
|
+
minDate: moment().subtract(100, 'years')
|
|
2839
|
+
};
|
|
2840
|
+
var passportEnd = {
|
|
2841
|
+
maxDate: moment().add(18, 'years'),
|
|
2842
|
+
minDate: moment()
|
|
2843
|
+
};
|
|
2844
|
+
|
|
2845
|
+
var personalInfo = [{
|
|
2846
|
+
id: 1,
|
|
2847
|
+
label: 'First and middle name',
|
|
2848
|
+
name: 'first_name',
|
|
2849
|
+
required: true,
|
|
2850
|
+
type: 'input',
|
|
2851
|
+
fullWidth: false,
|
|
2852
|
+
visibility: true,
|
|
2853
|
+
readOnly: false,
|
|
2854
|
+
placeholder: 'Enter first and middle name',
|
|
2855
|
+
validation: {
|
|
2856
|
+
regexOnChange: /^[a-zA-Z ]*$/,
|
|
2857
|
+
regexOnBlur: null,
|
|
2858
|
+
maxLimit: '',
|
|
2859
|
+
minLimit: '',
|
|
2860
|
+
maxLength: 100,
|
|
2861
|
+
minLength: 0
|
|
2862
|
+
},
|
|
2863
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2864
|
+
}, {
|
|
2865
|
+
id: 2,
|
|
2866
|
+
label: 'Last name',
|
|
2867
|
+
name: 'last_name',
|
|
2868
|
+
required: true,
|
|
2869
|
+
type: 'input',
|
|
2870
|
+
fullWidth: false,
|
|
2871
|
+
visibility: true,
|
|
2872
|
+
readOnly: false,
|
|
2873
|
+
placeholder: 'Enter last name',
|
|
2874
|
+
validation: {
|
|
2875
|
+
regexOnChange: /^[a-zA-Z ]*$/,
|
|
2876
|
+
regexOnBlur: null,
|
|
2877
|
+
maxLimit: '',
|
|
2878
|
+
minLimit: '',
|
|
2879
|
+
maxLength: 100,
|
|
2880
|
+
minLength: 0
|
|
2881
|
+
},
|
|
2882
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2883
|
+
}, {
|
|
2884
|
+
id: 3,
|
|
2885
|
+
label: 'Email address',
|
|
2886
|
+
name: 'email',
|
|
2887
|
+
required: true,
|
|
2888
|
+
type: 'input',
|
|
2889
|
+
fullWidth: false,
|
|
2890
|
+
visibility: true,
|
|
2891
|
+
readOnly: false,
|
|
2892
|
+
placeholder: 'Enter email address',
|
|
2893
|
+
validation: {
|
|
2894
|
+
regexOnChange: null,
|
|
2895
|
+
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,}))$/,
|
|
2896
|
+
maxLimit: '',
|
|
2897
|
+
minLimit: '',
|
|
2898
|
+
maxLength: 100,
|
|
2899
|
+
minLength: 0
|
|
2900
|
+
},
|
|
2901
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2902
|
+
}, {
|
|
2903
|
+
id: 4,
|
|
2904
|
+
label: 'Phone number',
|
|
2905
|
+
name: 'contact_number',
|
|
2906
|
+
required: true,
|
|
2907
|
+
type: 'phone',
|
|
2908
|
+
fullWidth: false,
|
|
2909
|
+
visibility: true,
|
|
2910
|
+
readOnly: false,
|
|
2911
|
+
validation: {
|
|
2912
|
+
regexOnChange: /^[\d]/,
|
|
2913
|
+
regexOnBlur: null,
|
|
2914
|
+
maxLimit: '',
|
|
2915
|
+
minLimit: '',
|
|
2916
|
+
maxLength: 100,
|
|
2917
|
+
minLength: 0
|
|
2918
|
+
},
|
|
2919
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2920
|
+
}, {
|
|
2921
|
+
id: 5,
|
|
2922
|
+
label: 'Date of birth',
|
|
2923
|
+
name: 'dob',
|
|
2924
|
+
required: false,
|
|
2925
|
+
type: 'datepicker',
|
|
2926
|
+
fullWidth: false,
|
|
2927
|
+
visibility: true,
|
|
2928
|
+
readOnly: false,
|
|
2929
|
+
hasIcon: false,
|
|
2930
|
+
size: 'normal',
|
|
2931
|
+
maxDate: dob.maxDate,
|
|
2932
|
+
minDate: dob.minDate,
|
|
2933
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2934
|
+
}, {
|
|
2935
|
+
id: 6,
|
|
2936
|
+
empty: true
|
|
2937
|
+
}, {
|
|
2938
|
+
id: 7,
|
|
2939
|
+
label: 'Gender',
|
|
2940
|
+
name: 'gender',
|
|
2941
|
+
required: false,
|
|
2942
|
+
type: 'select',
|
|
2943
|
+
fullWidth: false,
|
|
2944
|
+
visibility: true,
|
|
2945
|
+
readOnly: false,
|
|
2946
|
+
placeholder: 'Select gender',
|
|
2947
|
+
tooltip: 'This information will be used for flight booking purpose',
|
|
2948
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2949
|
+
}, {
|
|
2950
|
+
id: 8,
|
|
2951
|
+
label: 'Profile photo',
|
|
2952
|
+
description: 'This will be displayed on your profile',
|
|
2953
|
+
name: 'profile_pic',
|
|
2954
|
+
required: false,
|
|
2955
|
+
multiple: false,
|
|
2956
|
+
fileType: 'image/png,image/jpeg,image/jpg,image/webp,image/JPG,image/JPEG',
|
|
2957
|
+
fileSize: 5,
|
|
2958
|
+
title: 'Select Profile',
|
|
2959
|
+
type: 'file',
|
|
2960
|
+
fullWidth: true,
|
|
2961
|
+
visibility: true,
|
|
2962
|
+
readOnly: false,
|
|
2963
|
+
maxNoFiles: 2,
|
|
2964
|
+
buttonType: 'profile',
|
|
2965
|
+
disableText: 'Disable text here.'
|
|
2966
|
+
}];
|
|
2967
|
+
var workInfo = [{
|
|
2968
|
+
id: 1,
|
|
2969
|
+
label: 'Employee level',
|
|
2970
|
+
name: 'emp_level',
|
|
2971
|
+
required: false,
|
|
2972
|
+
type: 'async_select',
|
|
2973
|
+
fullWidth: false,
|
|
2974
|
+
visibility: true,
|
|
2975
|
+
readOnly: false,
|
|
2976
|
+
title: 'Select employee level',
|
|
2977
|
+
inputType: false,
|
|
2978
|
+
placeholder: 'Select employee level',
|
|
2979
|
+
loadOption: commonLoadOptions,
|
|
2980
|
+
tabelName: 'employee_level',
|
|
2981
|
+
tooltip: 'This information will be used in creation of policies and approval rules',
|
|
2982
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
2983
|
+
selectCTA: {
|
|
2984
|
+
value: 'employee_level',
|
|
2985
|
+
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
2986
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
2987
|
+
}, "+ Add Employee Level"),
|
|
2988
|
+
callback: null
|
|
2989
|
+
}
|
|
2990
|
+
}, {
|
|
2991
|
+
id: 2,
|
|
2992
|
+
label: 'Employee ID',
|
|
2993
|
+
name: 'employee_id',
|
|
2994
|
+
required: false,
|
|
2995
|
+
type: 'input',
|
|
2996
|
+
fullWidth: false,
|
|
2997
|
+
visibility: true,
|
|
2998
|
+
readOnly: false,
|
|
2999
|
+
placeholder: 'Enter employee ID',
|
|
3000
|
+
validation: {
|
|
3001
|
+
regexOnChange: /^[A-Za-z0-9]*$/,
|
|
3002
|
+
regexOnBlur: null,
|
|
3003
|
+
maxLimit: '',
|
|
3004
|
+
minLimit: '',
|
|
3005
|
+
maxLength: 100,
|
|
3006
|
+
minLength: 0
|
|
3007
|
+
},
|
|
3008
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3009
|
+
}, {
|
|
3010
|
+
id: 3,
|
|
3011
|
+
label: 'Entity',
|
|
3012
|
+
name: 'entity',
|
|
3013
|
+
required: false,
|
|
3014
|
+
type: 'async_select',
|
|
3015
|
+
fullWidth: false,
|
|
3016
|
+
visibility: true,
|
|
3017
|
+
readOnly: false,
|
|
3018
|
+
title: '',
|
|
3019
|
+
inputType: false,
|
|
3020
|
+
placeholder: 'Select entity',
|
|
3021
|
+
loadOption: commonLoadOptions,
|
|
3022
|
+
tabelName: 'entity',
|
|
3023
|
+
tooltip: 'This information will be used in creation of policies and approval rules',
|
|
3024
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
3025
|
+
selectCTA: {
|
|
3026
|
+
value: 'entity',
|
|
3027
|
+
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
3028
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
3029
|
+
}, "+ Add Entity"),
|
|
3030
|
+
callback: null
|
|
3031
|
+
}
|
|
3032
|
+
}, {
|
|
3033
|
+
id: 4,
|
|
3034
|
+
label: 'Business unit',
|
|
3035
|
+
name: 'business_unit',
|
|
3036
|
+
required: false,
|
|
3037
|
+
type: 'async_select',
|
|
3038
|
+
fullWidth: false,
|
|
3039
|
+
visibility: true,
|
|
3040
|
+
readOnly: false,
|
|
3041
|
+
title: 'Select unit',
|
|
3042
|
+
inputType: false,
|
|
3043
|
+
placeholder: 'Select unit',
|
|
3044
|
+
tabelName: 'business_unit',
|
|
3045
|
+
loadOption: commonLoadOptions,
|
|
3046
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
3047
|
+
selectCTA: {
|
|
3048
|
+
value: 'business_unit',
|
|
3049
|
+
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
3050
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
3051
|
+
}, "+ Add Business Unit"),
|
|
3052
|
+
callback: null
|
|
3053
|
+
}
|
|
3054
|
+
}, {
|
|
3055
|
+
id: 5,
|
|
3056
|
+
label: 'Department',
|
|
3057
|
+
name: 'department',
|
|
3058
|
+
required: false,
|
|
3059
|
+
type: 'async_select',
|
|
3060
|
+
fullWidth: false,
|
|
3061
|
+
visibility: true,
|
|
3062
|
+
readOnly: false,
|
|
3063
|
+
title: 'Select department',
|
|
3064
|
+
inputType: false,
|
|
3065
|
+
placeholder: 'Select department',
|
|
3066
|
+
tabelName: 'department',
|
|
3067
|
+
loadOption: commonLoadOptions,
|
|
3068
|
+
disableText: 'Please get in touch with your administrator to change this value.',
|
|
3069
|
+
selectCTA: {
|
|
3070
|
+
value: 'department',
|
|
3071
|
+
component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
3072
|
+
className: "iui__font--color-link iui__font--weight-500"
|
|
3073
|
+
}, "+ Add Department"),
|
|
3074
|
+
callback: null
|
|
3075
|
+
}
|
|
3076
|
+
}, {
|
|
3077
|
+
id: 6,
|
|
3078
|
+
label: 'Designation',
|
|
3079
|
+
name: 'designation',
|
|
3080
|
+
required: false,
|
|
3081
|
+
type: 'input',
|
|
3082
|
+
fullWidth: false,
|
|
3083
|
+
visibility: true,
|
|
3084
|
+
readOnly: false,
|
|
3085
|
+
placeholder: 'Enter designation',
|
|
3086
|
+
validation: {
|
|
3087
|
+
regexOnChange: /^[A-Za-z0-9.&'()\- ]*$/,
|
|
3088
|
+
regexOnBlur: /^[a-zA-Z][a-zA-Z0-9.&'()\- ]*$/,
|
|
3089
|
+
maxLimit: '',
|
|
3090
|
+
minLimit: '',
|
|
3091
|
+
maxLength: 100,
|
|
3092
|
+
minLength: 0
|
|
3093
|
+
},
|
|
3094
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3095
|
+
}, {
|
|
3096
|
+
id: 7,
|
|
3097
|
+
label: 'Base location',
|
|
3098
|
+
name: 'base_location',
|
|
3099
|
+
required: false,
|
|
3100
|
+
type: 'input',
|
|
3101
|
+
fullWidth: true,
|
|
3102
|
+
placeholder: 'Enter city',
|
|
3103
|
+
visibility: true,
|
|
3104
|
+
readOnly: false,
|
|
3105
|
+
validation: {
|
|
3106
|
+
regexOnChange: /^[A-Za-z0-9 -.&'()]*$/,
|
|
3107
|
+
regexOnBlur: null,
|
|
3108
|
+
maxLimit: '',
|
|
3109
|
+
minLimit: '',
|
|
3110
|
+
maxLength: 500,
|
|
3111
|
+
minLength: 0
|
|
3112
|
+
},
|
|
3113
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3114
|
+
}, {
|
|
3115
|
+
id: 7,
|
|
3116
|
+
label: 'Default currency',
|
|
3117
|
+
name: 'currency',
|
|
3118
|
+
required: false,
|
|
3119
|
+
type: 'async_select',
|
|
3120
|
+
fullWidth: false,
|
|
3121
|
+
visibility: true,
|
|
3122
|
+
readOnly: false,
|
|
3123
|
+
inputType: false,
|
|
3124
|
+
tabelName: 'default_currency',
|
|
3125
|
+
loadOption: currencyLoadOptions,
|
|
3126
|
+
tooltip: 'This only changes the currency for this user',
|
|
3127
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3128
|
+
}, {
|
|
3129
|
+
id: 8,
|
|
3130
|
+
empty: true
|
|
3131
|
+
}];
|
|
3132
|
+
var products = [{
|
|
3133
|
+
id: 1,
|
|
3134
|
+
label: 'Travel',
|
|
3135
|
+
name: 'travel',
|
|
3136
|
+
type: 'checkbox',
|
|
3137
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3138
|
+
}, {
|
|
3139
|
+
id: 2,
|
|
3140
|
+
label: 'Expense',
|
|
3141
|
+
name: 'expense',
|
|
3142
|
+
type: 'checkbox',
|
|
3143
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3144
|
+
}];
|
|
3145
|
+
var dropdownList = {
|
|
3146
|
+
gender: [{
|
|
3147
|
+
id: 1,
|
|
3148
|
+
name: 'Male'
|
|
3149
|
+
}, {
|
|
3150
|
+
id: 2,
|
|
3151
|
+
name: 'Female'
|
|
3152
|
+
}, {
|
|
3153
|
+
id: 3,
|
|
3154
|
+
name: 'Others'
|
|
3155
|
+
}],
|
|
3156
|
+
flight_seat_preference: [],
|
|
3157
|
+
meal_preference: [],
|
|
3158
|
+
contact_number: [],
|
|
3159
|
+
passport_issue_country: [],
|
|
3160
|
+
nationality: []
|
|
3161
|
+
};
|
|
3162
|
+
var travelConstants = {
|
|
3163
|
+
heading: 'Travel specific information',
|
|
3164
|
+
roleHeading: 'Travel role',
|
|
3165
|
+
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3166
|
+
approverHeading: 'Travel approvers',
|
|
3167
|
+
approverDescription: 'You can add upto :maxApprovers approvers',
|
|
3168
|
+
FYILabel: 'FYI approver',
|
|
3169
|
+
FYIDescription: 'Send travel approval alerts to this email',
|
|
3170
|
+
roles: [{
|
|
3171
|
+
id: 1,
|
|
3172
|
+
label: 'Traveler',
|
|
3173
|
+
description: 'Can create trips for themselves and guests',
|
|
3174
|
+
name: 'traveler',
|
|
3175
|
+
type: 'radio',
|
|
3176
|
+
fullWidth: false,
|
|
3177
|
+
visibility: true,
|
|
3178
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3179
|
+
}, {
|
|
3180
|
+
id: 2,
|
|
3181
|
+
label: 'Admin',
|
|
3182
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3183
|
+
name: 'travel_admin',
|
|
3184
|
+
type: 'radio',
|
|
3185
|
+
fullWidth: false,
|
|
3186
|
+
visibility: true,
|
|
3187
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3188
|
+
}, {
|
|
3189
|
+
id: 3,
|
|
3190
|
+
label: 'Finance admin',
|
|
3191
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3192
|
+
name: 'travel_finance_admin',
|
|
3193
|
+
type: 'radio',
|
|
3194
|
+
fullWidth: false,
|
|
3195
|
+
visibility: true,
|
|
3196
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3197
|
+
}],
|
|
3198
|
+
approvers: [{
|
|
3199
|
+
id: 1,
|
|
3200
|
+
label: 'Person 1',
|
|
3201
|
+
name: 'travel_approver',
|
|
3202
|
+
required: false,
|
|
3203
|
+
type: 'input',
|
|
3204
|
+
fullWidth: false,
|
|
3205
|
+
visibility: true,
|
|
3206
|
+
readOnly: false,
|
|
3207
|
+
placeholder: 'Select Approver',
|
|
3208
|
+
validation: {
|
|
3209
|
+
regexOnChange: null,
|
|
3210
|
+
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,}))$/,
|
|
3211
|
+
maxLimit: '',
|
|
3212
|
+
minLimit: '',
|
|
3213
|
+
maxLength: 100,
|
|
3214
|
+
minLength: 0
|
|
3215
|
+
},
|
|
3216
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3217
|
+
}, {
|
|
3218
|
+
id: 2,
|
|
3219
|
+
label: 'Person 2',
|
|
3220
|
+
name: 'travel_approver',
|
|
3221
|
+
required: false,
|
|
3222
|
+
type: 'input',
|
|
3223
|
+
fullWidth: false,
|
|
3224
|
+
visibility: true,
|
|
3225
|
+
readOnly: false,
|
|
3226
|
+
placeholder: 'Select Approver',
|
|
3227
|
+
validation: {
|
|
3228
|
+
regexOnChange: null,
|
|
3229
|
+
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,}))$/,
|
|
3230
|
+
maxLimit: '',
|
|
3231
|
+
minLimit: '',
|
|
3232
|
+
maxLength: 100,
|
|
3233
|
+
minLength: 0
|
|
3234
|
+
},
|
|
3235
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3236
|
+
}]
|
|
3332
3237
|
};
|
|
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
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
}
|
|
3238
|
+
var expenseConstants = {
|
|
3239
|
+
heading: 'Expense specific information',
|
|
3240
|
+
roleHeading: 'Expense role',
|
|
3241
|
+
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3242
|
+
approverHeading: 'Expense approvers',
|
|
3243
|
+
approverDescription: 'You can add upto :maxApprovers approvers',
|
|
3244
|
+
FYILabel: 'FYI approver',
|
|
3245
|
+
FYIDescription: 'Send expense approval alerts to this email',
|
|
3246
|
+
roles: [{
|
|
3247
|
+
id: 1,
|
|
3248
|
+
label: 'Submitter',
|
|
3249
|
+
description: 'Can submit expenses',
|
|
3250
|
+
name: 'submitter',
|
|
3251
|
+
type: 'radio',
|
|
3252
|
+
fullWidth: false,
|
|
3253
|
+
visibility: true,
|
|
3254
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3255
|
+
}, {
|
|
3256
|
+
id: 2,
|
|
3257
|
+
label: 'Admin',
|
|
3258
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3259
|
+
name: 'expense_admin',
|
|
3260
|
+
type: 'radio',
|
|
3261
|
+
fullWidth: false,
|
|
3262
|
+
visibility: true,
|
|
3263
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3264
|
+
}, {
|
|
3265
|
+
id: 3,
|
|
3266
|
+
label: 'Finance admin',
|
|
3267
|
+
description: 'Can administer the product, manage user access, billing details, company settings etc.',
|
|
3268
|
+
name: 'expense_finance_admin',
|
|
3269
|
+
type: 'radio',
|
|
3270
|
+
fullWidth: false,
|
|
3271
|
+
visibility: true,
|
|
3272
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3273
|
+
}],
|
|
3274
|
+
approvers: [{
|
|
3275
|
+
id: 1,
|
|
3276
|
+
label: 'Person 1',
|
|
3277
|
+
name: 'expense_approver',
|
|
3278
|
+
required: false,
|
|
3279
|
+
type: 'input',
|
|
3280
|
+
fullWidth: false,
|
|
3281
|
+
visibility: true,
|
|
3282
|
+
readOnly: false,
|
|
3283
|
+
placeholder: 'Select Approver',
|
|
3284
|
+
validation: {
|
|
3285
|
+
regexOnChange: null,
|
|
3286
|
+
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,}))$/,
|
|
3287
|
+
maxLimit: '',
|
|
3288
|
+
minLimit: '',
|
|
3289
|
+
maxLength: 100,
|
|
3290
|
+
minLength: 0
|
|
3291
|
+
},
|
|
3292
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3293
|
+
}, {
|
|
3294
|
+
id: 2,
|
|
3295
|
+
label: 'Person 2',
|
|
3296
|
+
name: 'expense_approver',
|
|
3297
|
+
required: false,
|
|
3298
|
+
type: 'input',
|
|
3299
|
+
fullWidth: false,
|
|
3300
|
+
visibility: true,
|
|
3301
|
+
readOnly: false,
|
|
3302
|
+
placeholder: 'Select Approver',
|
|
3303
|
+
validation: {
|
|
3304
|
+
regexOnChange: null,
|
|
3305
|
+
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,}))$/,
|
|
3306
|
+
maxLimit: '',
|
|
3307
|
+
minLimit: '',
|
|
3308
|
+
maxLength: 100,
|
|
3309
|
+
minLength: 0
|
|
3310
|
+
},
|
|
3311
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3312
|
+
}]
|
|
3313
|
+
};
|
|
3314
|
+
var passportInfo = [{
|
|
3315
|
+
id: 1,
|
|
3316
|
+
label: 'Passport issuing country',
|
|
3317
|
+
name: 'passport_issue_country',
|
|
3318
|
+
required: false,
|
|
3319
|
+
type: 'async_select',
|
|
3320
|
+
fullWidth: false,
|
|
3321
|
+
visibility: true,
|
|
3322
|
+
readOnly: false,
|
|
3323
|
+
placeholder: 'Select country',
|
|
3324
|
+
tabelName: 'country_name',
|
|
3325
|
+
loadOption: countryOptions,
|
|
3326
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3327
|
+
}, {
|
|
3328
|
+
id: 2,
|
|
3329
|
+
label: 'Passport number',
|
|
3330
|
+
name: 'passport_number',
|
|
3331
|
+
required: false,
|
|
3332
|
+
type: 'input',
|
|
3333
|
+
fullWidth: false,
|
|
3334
|
+
visibility: true,
|
|
3335
|
+
readOnly: false,
|
|
3336
|
+
placeholder: 'Enter passport number',
|
|
3337
|
+
validation: {
|
|
3338
|
+
regexOnChange: /^[A-Za-z0-9]*$/,
|
|
3339
|
+
regexOnBlur: null,
|
|
3340
|
+
maxLimit: '',
|
|
3341
|
+
minLimit: '',
|
|
3342
|
+
maxLength: 15,
|
|
3343
|
+
minLength: 7
|
|
3344
|
+
},
|
|
3345
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3346
|
+
}, {
|
|
3347
|
+
id: 3,
|
|
3348
|
+
label: 'Nationality',
|
|
3349
|
+
name: 'nationality',
|
|
3350
|
+
required: false,
|
|
3351
|
+
type: 'async_select',
|
|
3352
|
+
fullWidth: true,
|
|
3353
|
+
visibility: true,
|
|
3354
|
+
readOnly: false,
|
|
3355
|
+
placeholder: 'Select nationality',
|
|
3356
|
+
tabelName: 'nationality',
|
|
3357
|
+
loadOption: countryOptions,
|
|
3358
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3359
|
+
}, {
|
|
3360
|
+
id: 4,
|
|
3361
|
+
label: 'Date of issue',
|
|
3362
|
+
name: 'passport_issue_date',
|
|
3363
|
+
required: false,
|
|
3364
|
+
type: 'datepicker',
|
|
3365
|
+
hasIcon: false,
|
|
3366
|
+
fullWidth: false,
|
|
3367
|
+
visibility: true,
|
|
3368
|
+
readOnly: false,
|
|
3369
|
+
size: 'small',
|
|
3370
|
+
maxDate: passportStart.maxDate,
|
|
3371
|
+
minDate: passportStart.minDate,
|
|
3372
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3373
|
+
}, {
|
|
3374
|
+
id: 5,
|
|
3375
|
+
label: 'Date of expiry',
|
|
3376
|
+
name: 'passport_expiry_date',
|
|
3377
|
+
required: false,
|
|
3378
|
+
type: 'datepicker',
|
|
3379
|
+
hasIcon: false,
|
|
3380
|
+
fullWidth: false,
|
|
3381
|
+
visibility: true,
|
|
3382
|
+
readOnly: false,
|
|
3383
|
+
size: 'small',
|
|
3384
|
+
maxDate: passportEnd.maxDate,
|
|
3385
|
+
minDate: passportEnd.minDate,
|
|
3386
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3387
|
+
}, {
|
|
3388
|
+
id: 6,
|
|
3389
|
+
label: 'Photo of passport',
|
|
3390
|
+
description: '',
|
|
3391
|
+
name: 'passport_photo',
|
|
3392
|
+
required: false,
|
|
3393
|
+
type: 'file',
|
|
3394
|
+
multiple: true,
|
|
3395
|
+
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
3396
|
+
fileSize: 5,
|
|
3397
|
+
title: 'Select Photo',
|
|
3398
|
+
fullWidth: true,
|
|
3399
|
+
visibility: true,
|
|
3400
|
+
readOnly: false,
|
|
3401
|
+
maxNoFiles: 2,
|
|
3402
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3403
|
+
}, {
|
|
3404
|
+
id: 7,
|
|
3405
|
+
label: 'Travel documents',
|
|
3406
|
+
description: 'You can add upto 5 documents',
|
|
3407
|
+
name: 'travel_docs',
|
|
3408
|
+
required: false,
|
|
3409
|
+
multiple: true,
|
|
3410
|
+
fileType: 'application/pdf,image/png,image/jpeg,image/jpg',
|
|
3411
|
+
fileSize: 5,
|
|
3412
|
+
title: 'Select document',
|
|
3413
|
+
type: 'file',
|
|
3414
|
+
fullWidth: true,
|
|
3415
|
+
visibility: true,
|
|
3416
|
+
readOnly: false,
|
|
3417
|
+
maxNoFiles: 5,
|
|
3418
|
+
tooltip: 'This is for quick access of important travel documents during your trip like Visa, Identification, Vaccine certificates etc.',
|
|
3419
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3420
|
+
}];
|
|
3421
|
+
var travelPreference = [{
|
|
3422
|
+
id: 1,
|
|
3423
|
+
label: 'Flight seat preference',
|
|
3424
|
+
name: 'flight_seat_preference',
|
|
3425
|
+
required: false,
|
|
3426
|
+
type: 'select',
|
|
3427
|
+
fullWidth: false,
|
|
3428
|
+
visibility: true,
|
|
3429
|
+
readOnly: false,
|
|
3430
|
+
placeholder: 'Select seat preference',
|
|
3431
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3432
|
+
}, {
|
|
3433
|
+
id: 1,
|
|
3434
|
+
label: 'Meals preference',
|
|
3435
|
+
name: 'meal_preference',
|
|
3436
|
+
required: false,
|
|
3437
|
+
type: 'select',
|
|
3438
|
+
fullWidth: false,
|
|
3439
|
+
visibility: true,
|
|
3440
|
+
readOnly: false,
|
|
3441
|
+
placeholder: 'Select meals preference',
|
|
3442
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3443
|
+
}];
|
|
3444
|
+
var secureTravelInfo = [{
|
|
3445
|
+
id: 1,
|
|
3446
|
+
label: 'Known traveler number',
|
|
3447
|
+
placeholder: 'Enter known traveler number',
|
|
3448
|
+
name: 'trusted_traveller',
|
|
3449
|
+
required: false,
|
|
3450
|
+
type: 'input',
|
|
3451
|
+
hasIcon: true,
|
|
3452
|
+
fullWidth: false,
|
|
3453
|
+
visibility: true,
|
|
3454
|
+
readOnly: false,
|
|
3455
|
+
tooltip: /*#__PURE__*/React__default.createElement(React__default.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__default.createElement("a", {
|
|
3456
|
+
href: "https://www.tsa.gov/travel/frequently-asked-questions",
|
|
3457
|
+
target: "_blank",
|
|
3458
|
+
rel: "noreferrer"
|
|
3459
|
+
}, "visit TSA's PreCheck website")),
|
|
3460
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3461
|
+
}, {
|
|
3462
|
+
id: 1,
|
|
3463
|
+
label: 'Redress number',
|
|
3464
|
+
placeholder: 'Enter redress number',
|
|
3465
|
+
name: 'redress_number',
|
|
3466
|
+
required: false,
|
|
3467
|
+
type: 'input',
|
|
3468
|
+
hasIcon: true,
|
|
3469
|
+
fullWidth: false,
|
|
3470
|
+
visibility: true,
|
|
3471
|
+
readOnly: false,
|
|
3472
|
+
tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.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__default.createElement("a", {
|
|
3473
|
+
href: "https://www.tsa.gov/travel/passenger-support/travel-redress-program",
|
|
3474
|
+
target: "_blank",
|
|
3475
|
+
rel: "noreferrer"
|
|
3476
|
+
}, "visit TSA's Secure Flight website"))),
|
|
3477
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3478
|
+
}];
|
|
3479
|
+
var userAddPageFormLabels = {
|
|
3480
|
+
user_personal_info: {
|
|
3481
|
+
first_name: 'First and middle name',
|
|
3482
|
+
last_name: 'Last name',
|
|
3483
|
+
email: 'Email address',
|
|
3484
|
+
contact_number: 'Phone number',
|
|
3485
|
+
dob: 'Date of birth',
|
|
3486
|
+
gender: 'Gender',
|
|
3487
|
+
profile_pic: 'Profile photo'
|
|
3488
|
+
},
|
|
3489
|
+
employee_info: {
|
|
3490
|
+
emp_level: 'Employee level',
|
|
3491
|
+
employee_id: 'Employee ID',
|
|
3492
|
+
entity: 'Entity',
|
|
3493
|
+
business_unit: 'Business unit',
|
|
3494
|
+
department: 'Department',
|
|
3495
|
+
designation: 'Designation',
|
|
3496
|
+
base_location: 'Base location',
|
|
3497
|
+
currency: 'Default currency'
|
|
3498
|
+
},
|
|
3499
|
+
user_travel_info: {
|
|
3500
|
+
nationality: 'Nationality',
|
|
3501
|
+
passport_number: 'Passport number',
|
|
3502
|
+
passport_expiry_date: 'Date of expiry',
|
|
3503
|
+
passport_issue_country: 'Passport issuing country',
|
|
3504
|
+
passport_issue_date: 'Date of issue',
|
|
3505
|
+
passport_photo: 'Photo of passport',
|
|
3506
|
+
travel_docs: 'Travel documents',
|
|
3507
|
+
flight_seat_preference: 'Flight seat preference',
|
|
3508
|
+
meal_preference: 'Meals preference',
|
|
3509
|
+
trusted_traveller: 'Known traveler number',
|
|
3510
|
+
redress_number: 'Redress number'
|
|
3511
|
+
},
|
|
3512
|
+
products: {
|
|
3513
|
+
travel: 'Travel',
|
|
3514
|
+
expense: 'Expense'
|
|
3515
|
+
},
|
|
3516
|
+
travel_fyi_approver: 'FYI approver'
|
|
3440
3517
|
};
|
|
3441
3518
|
|
|
3442
3519
|
var initialState = {
|
|
@@ -5880,7 +5957,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5880
5957
|
userTagType: userTagType
|
|
5881
5958
|
};
|
|
5882
5959
|
|
|
5883
|
-
if (verifyUserId) {
|
|
5960
|
+
if (verifyUserId && isILadmin) {
|
|
5884
5961
|
payload.verifyUserId = verifyUserId;
|
|
5885
5962
|
}
|
|
5886
5963
|
|
|
@@ -6200,10 +6277,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6200
6277
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6201
6278
|
}
|
|
6202
6279
|
}
|
|
6203
|
-
} else if (verifyUserId) {
|
|
6280
|
+
} else if (verifyUserId && isILadmin) {
|
|
6204
6281
|
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
6205
6282
|
|
|
6206
|
-
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$signu = _config$routes4.signupRequest) === null || _config$routes4$signu === void 0 ? void 0 : (_config$routes4$signu2 = _config$routes4$signu.list) === null || _config$routes4$signu2 === void 0 ? void 0 : _config$routes4$signu2.path) &&
|
|
6283
|
+
(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);
|
|
6207
6284
|
} else {
|
|
6208
6285
|
var _config$routes5, _config$routes5$users, _config$routes5$users2;
|
|
6209
6286
|
|
|
@@ -6228,7 +6305,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6228
6305
|
};
|
|
6229
6306
|
|
|
6230
6307
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
6231
|
-
if (verifyUserId) {
|
|
6308
|
+
if (verifyUserId && isILadmin) {
|
|
6232
6309
|
dispatch(showLoader());
|
|
6233
6310
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6234
6311
|
setPersonalInfoInput(function (prevState) {
|
|
@@ -6330,6 +6407,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6330
6407
|
}
|
|
6331
6408
|
};
|
|
6332
6409
|
|
|
6410
|
+
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
6411
|
+
if (verifyUserId && isILadmin) {
|
|
6412
|
+
dispatch(showLoader());
|
|
6413
|
+
dispatch(rejectUserVerification(verifyUserId)).then(function (res) {
|
|
6414
|
+
setTimeout(function () {
|
|
6415
|
+
window.location.assign(config.routes.signupRequest.list.path);
|
|
6416
|
+
}, 1500);
|
|
6417
|
+
})["finally"](function () {
|
|
6418
|
+
dispatch(stopLoader());
|
|
6419
|
+
});
|
|
6420
|
+
}
|
|
6421
|
+
};
|
|
6422
|
+
|
|
6333
6423
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6334
6424
|
component: "div",
|
|
6335
6425
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6346,7 +6436,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6346
6436
|
className: styles.breadcrumb
|
|
6347
6437
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBreadCrumb, {
|
|
6348
6438
|
breadCrumbs: [{
|
|
6349
|
-
href: verifyUserId ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6439
|
+
href: verifyUserId && isILadmin ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6350
6440
|
label: 'Users',
|
|
6351
6441
|
hasLink: true
|
|
6352
6442
|
}]
|
|
@@ -6381,7 +6471,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6381
6471
|
type: "contained",
|
|
6382
6472
|
onClick: formSubmitHandler,
|
|
6383
6473
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
6384
|
-
}))
|
|
6474
|
+
})), verifyUserId && isILadmin ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6475
|
+
component: "div",
|
|
6476
|
+
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
6477
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
6478
|
+
buttonText: "Reject",
|
|
6479
|
+
type: "outlined",
|
|
6480
|
+
onClick: handleSignUpRequestRejection
|
|
6481
|
+
})) : null))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6385
6482
|
component: "div",
|
|
6386
6483
|
marginTop: "8rem",
|
|
6387
6484
|
flexDirection: "column"
|
|
@@ -9223,7 +9320,7 @@ function MoveUserDialog(_ref) {
|
|
|
9223
9320
|
name: name,
|
|
9224
9321
|
isMove: isMove,
|
|
9225
9322
|
customSelectHandler: customSelectHandler,
|
|
9226
|
-
loadOption:
|
|
9323
|
+
loadOption: commonLoadOptionsUM,
|
|
9227
9324
|
isError: isError,
|
|
9228
9325
|
errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
|
|
9229
9326
|
placeHolderCheck: name !== undefined && name === ''
|
|
@@ -9536,9 +9633,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9536
9633
|
var handleEditPanel = function handleEditPanel(data) {
|
|
9537
9634
|
if (dataList) {
|
|
9538
9635
|
var payload = {
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9636
|
+
rows: [{
|
|
9637
|
+
id: dialogData.data.id,
|
|
9638
|
+
name: dataList
|
|
9639
|
+
}]
|
|
9542
9640
|
};
|
|
9543
9641
|
var message = title + " updated successfully.";
|
|
9544
9642
|
handleApiCall(editRecord, payload, message, 'edit');
|