@itilite/iui-user-management 0.4.319 → 0.4.501
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.css +195 -1
- package/dist/index.js +1745 -661
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1748 -664
- package/dist/index.modern.js.map +1 -1
- package/package.json +7 -5
- package/dist/VectorinfoIcon~bdIVCeRl.jpg +0 -0
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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';
|
|
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, IUISearch, IUIDropdownButton, IUITabs } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -9,9 +9,14 @@ import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
|
9
9
|
import thunk from 'redux-thunk';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
12
|
-
import { useHistory } from 'react-router-dom';
|
|
13
|
-
import { withStyles } from '@material-ui/core/styles';
|
|
12
|
+
import { useHistory, useLocation } from 'react-router-dom';
|
|
13
|
+
import { withStyles, makeStyles } from '@material-ui/core/styles';
|
|
14
|
+
import Tooltip from '@material-ui/core/Tooltip';
|
|
14
15
|
import Switch from '@material-ui/core/Switch';
|
|
16
|
+
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
17
|
+
import Button from '@material-ui/core/Button';
|
|
18
|
+
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography, Box } from '@material-ui/core';
|
|
19
|
+
import { useScrollPosition } from '@n8tb1t/use-scroll-position';
|
|
15
20
|
|
|
16
21
|
function _extends() {
|
|
17
22
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -64,7 +69,6 @@ var _Pact = /*#__PURE__*/function () {
|
|
|
64
69
|
};
|
|
65
70
|
return _Pact;
|
|
66
71
|
}();
|
|
67
|
-
|
|
68
72
|
function _settle(pact, state, value) {
|
|
69
73
|
if (!pact.s) {
|
|
70
74
|
if (value instanceof _Pact) {
|
|
@@ -93,7 +97,6 @@ function _settle(pact, state, value) {
|
|
|
93
97
|
function _isSettledPact(thenable) {
|
|
94
98
|
return thenable instanceof _Pact && thenable.s & 1;
|
|
95
99
|
}
|
|
96
|
-
|
|
97
100
|
function _forTo(array, body, check) {
|
|
98
101
|
var i = -1,
|
|
99
102
|
pact,
|
|
@@ -125,7 +128,6 @@ function _forTo(array, body, check) {
|
|
|
125
128
|
}
|
|
126
129
|
var _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
127
130
|
var _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
128
|
-
|
|
129
131
|
function _catch(body, recover) {
|
|
130
132
|
try {
|
|
131
133
|
var result = body();
|
|
@@ -144,17 +146,11 @@ function r(e) {
|
|
|
144
146
|
var t,
|
|
145
147
|
f,
|
|
146
148
|
n = "";
|
|
147
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
148
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
149
|
-
} else for (t in e) {
|
|
150
|
-
e[t] && (n && (n += " "), n += t);
|
|
151
|
-
}
|
|
149
|
+
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
152
150
|
return n;
|
|
153
151
|
}
|
|
154
152
|
function clsx() {
|
|
155
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
156
|
-
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
157
|
-
}
|
|
153
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
158
154
|
return n;
|
|
159
155
|
}
|
|
160
156
|
|
|
@@ -358,12 +354,24 @@ var userAddEditUrl = {
|
|
|
358
354
|
approversSearch: function approversSearch() {
|
|
359
355
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
360
356
|
},
|
|
357
|
+
transferAppover: function transferAppover() {
|
|
358
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
+
},
|
|
361
360
|
preSignedUrl: function preSignedUrl() {
|
|
362
361
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
363
362
|
},
|
|
364
363
|
editUser: function editUser(userId) {
|
|
365
364
|
return "api/v1/user-management/users/" + userId;
|
|
366
365
|
},
|
|
366
|
+
primaryAdmin: function primaryAdmin(userId) {
|
|
367
|
+
return "api/v1/user-management/mark-primary/" + userId;
|
|
368
|
+
},
|
|
369
|
+
resetPasswordForUserApi: function resetPasswordForUserApi() {
|
|
370
|
+
return "account/auth/password-reset/";
|
|
371
|
+
},
|
|
372
|
+
resendInviteForUserApi: function resendInviteForUserApi() {
|
|
373
|
+
return "api/v1/user-management/resend-welcome-email";
|
|
374
|
+
},
|
|
367
375
|
deletePaymentCard: function deletePaymentCard(pmId, vendorId) {
|
|
368
376
|
return env.getPaymentUrl() + "/api/v1/card/delete/" + pmId + "/" + vendorId + "/1";
|
|
369
377
|
},
|
|
@@ -378,16 +386,23 @@ var userAddEditUrl = {
|
|
|
378
386
|
},
|
|
379
387
|
rejectUserVerification: function rejectUserVerification(userId) {
|
|
380
388
|
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
389
|
+
},
|
|
390
|
+
undoRejectUserVerification: function undoRejectUserVerification(userId) {
|
|
391
|
+
return "api/v1/onboarding/user-signup-reject/" + userId + "?action=undo";
|
|
381
392
|
}
|
|
382
393
|
};
|
|
383
394
|
var userListUrl = {
|
|
384
395
|
getUser: "api/v1/user-management/users",
|
|
396
|
+
signupRequests: 'api/v1/onboarding/user-sign-up-list/',
|
|
385
397
|
updateActiveStatus: 'api/v1/user-management/users/activate?',
|
|
386
398
|
bulkDeactivate: function bulkDeactivate() {
|
|
387
399
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/bulk-users/activate-or-deactivate?action=deactivate";
|
|
388
400
|
},
|
|
389
401
|
exportUsers: function exportUsers() {
|
|
390
402
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/bulk-users/download/users";
|
|
403
|
+
},
|
|
404
|
+
rejectUser: function rejectUser(userId) {
|
|
405
|
+
return "api/v2/users/signup-users/" + userId + "/reject";
|
|
391
406
|
}
|
|
392
407
|
};
|
|
393
408
|
var userBulkImport = {
|
|
@@ -429,10 +444,10 @@ var userPanelUrl = {
|
|
|
429
444
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
430
445
|
},
|
|
431
446
|
getUnit: function getUnit(tableName, length, sort) {
|
|
432
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&
|
|
447
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&ordering=" + sort;
|
|
433
448
|
},
|
|
434
449
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
435
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&
|
|
450
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&ordering=" + sort;
|
|
436
451
|
},
|
|
437
452
|
moveUnit: function moveUnit() {
|
|
438
453
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
@@ -447,7 +462,6 @@ var departmentUrl = {
|
|
|
447
462
|
}
|
|
448
463
|
};
|
|
449
464
|
|
|
450
|
-
var IUILocalStorageService$1 = services.IUILocalStorageService;
|
|
451
465
|
var api = configs.api;
|
|
452
466
|
var NAoptionConfig = {
|
|
453
467
|
option: {
|
|
@@ -456,7 +470,6 @@ var NAoptionConfig = {
|
|
|
456
470
|
},
|
|
457
471
|
applyFor: ['employee_level', 'department']
|
|
458
472
|
};
|
|
459
|
-
|
|
460
473
|
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
461
474
|
var page = _ref.page,
|
|
462
475
|
tabelName = _ref.tabelName,
|
|
@@ -589,31 +602,23 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
589
602
|
return Promise.reject(e);
|
|
590
603
|
}
|
|
591
604
|
};
|
|
592
|
-
var
|
|
605
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
593
606
|
var page = _ref4.page,
|
|
594
607
|
product = _ref4.product,
|
|
595
|
-
userId = _ref4.userId
|
|
596
|
-
placeholder = _ref4.placeholder;
|
|
608
|
+
userId = _ref4.userId;
|
|
597
609
|
try {
|
|
598
610
|
return Promise.resolve(_catch(function () {
|
|
599
|
-
return Promise.resolve(api.get(userAddEditUrl.
|
|
611
|
+
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
600
612
|
return res.data;
|
|
601
613
|
})).then(function (response) {
|
|
602
614
|
var mappedValue = response.results.map(function (item) {
|
|
603
615
|
return {
|
|
604
|
-
value: item.
|
|
605
|
-
label: item.
|
|
616
|
+
value: item.email,
|
|
617
|
+
label: item.email,
|
|
606
618
|
type: 'detailed',
|
|
607
|
-
data: item
|
|
619
|
+
data: item
|
|
608
620
|
};
|
|
609
621
|
});
|
|
610
|
-
if (page === 1) {
|
|
611
|
-
var placeholderLbl = {
|
|
612
|
-
value: '',
|
|
613
|
-
label: placeholder
|
|
614
|
-
};
|
|
615
|
-
mappedValue.unshift(placeholderLbl);
|
|
616
|
-
}
|
|
617
622
|
return {
|
|
618
623
|
options: mappedValue,
|
|
619
624
|
hasMore: !!response.next,
|
|
@@ -639,27 +644,38 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
639
644
|
return Promise.reject(e);
|
|
640
645
|
}
|
|
641
646
|
};
|
|
642
|
-
var
|
|
647
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
643
648
|
var page = _ref5.page,
|
|
644
|
-
|
|
649
|
+
product = _ref5.product,
|
|
650
|
+
userId = _ref5.userId,
|
|
651
|
+
placeholder = _ref5.placeholder;
|
|
645
652
|
try {
|
|
646
653
|
return Promise.resolve(_catch(function () {
|
|
647
|
-
return Promise.resolve(api.get(userAddEditUrl.
|
|
654
|
+
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
648
655
|
return res.data;
|
|
649
656
|
})).then(function (response) {
|
|
650
657
|
var mappedValue = response.results.map(function (item) {
|
|
651
658
|
return {
|
|
652
|
-
value: item
|
|
653
|
-
label: item
|
|
659
|
+
value: item.approver.email,
|
|
660
|
+
label: item.approver.email,
|
|
661
|
+
type: 'detailed',
|
|
662
|
+
data: item.approver
|
|
654
663
|
};
|
|
655
664
|
});
|
|
656
|
-
|
|
665
|
+
if (page === 1) {
|
|
666
|
+
var placeholderLbl = {
|
|
667
|
+
value: '',
|
|
668
|
+
label: placeholder
|
|
669
|
+
};
|
|
670
|
+
mappedValue.unshift(placeholderLbl);
|
|
671
|
+
}
|
|
657
672
|
return {
|
|
658
673
|
options: mappedValue,
|
|
659
674
|
hasMore: !!response.next,
|
|
660
675
|
additional: {
|
|
661
676
|
page: page + 1,
|
|
662
|
-
|
|
677
|
+
product: product,
|
|
678
|
+
userId: userId
|
|
663
679
|
}
|
|
664
680
|
};
|
|
665
681
|
});
|
|
@@ -669,7 +685,8 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
669
685
|
hasMore: false,
|
|
670
686
|
additional: {
|
|
671
687
|
page: 1,
|
|
672
|
-
|
|
688
|
+
product: product,
|
|
689
|
+
userId: userId
|
|
673
690
|
}
|
|
674
691
|
};
|
|
675
692
|
}));
|
|
@@ -677,30 +694,26 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
677
694
|
return Promise.reject(e);
|
|
678
695
|
}
|
|
679
696
|
};
|
|
680
|
-
var
|
|
697
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
681
698
|
var page = _ref6.page,
|
|
682
|
-
|
|
699
|
+
tabelName = _ref6.tabelName;
|
|
683
700
|
try {
|
|
684
701
|
return Promise.resolve(_catch(function () {
|
|
685
|
-
return Promise.resolve(api.get(
|
|
702
|
+
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
686
703
|
return res.data;
|
|
687
704
|
})).then(function (response) {
|
|
688
705
|
var mappedValue = response.results.map(function (item) {
|
|
689
706
|
return {
|
|
690
|
-
value: item
|
|
691
|
-
label: item
|
|
692
|
-
type: 'detailed',
|
|
693
|
-
data: item
|
|
707
|
+
value: item[tabelName],
|
|
708
|
+
label: item[tabelName]
|
|
694
709
|
};
|
|
695
710
|
});
|
|
696
|
-
|
|
697
|
-
console.log(response.next);
|
|
698
711
|
return {
|
|
699
712
|
options: mappedValue,
|
|
700
713
|
hasMore: !!response.next,
|
|
701
714
|
additional: {
|
|
702
715
|
page: page + 1,
|
|
703
|
-
|
|
716
|
+
tabelName: tabelName
|
|
704
717
|
}
|
|
705
718
|
};
|
|
706
719
|
});
|
|
@@ -710,7 +723,7 @@ var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions
|
|
|
710
723
|
hasMore: false,
|
|
711
724
|
additional: {
|
|
712
725
|
page: 1,
|
|
713
|
-
|
|
726
|
+
tabelName: tabelName
|
|
714
727
|
}
|
|
715
728
|
};
|
|
716
729
|
}));
|
|
@@ -718,48 +731,39 @@ var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions
|
|
|
718
731
|
return Promise.reject(e);
|
|
719
732
|
}
|
|
720
733
|
};
|
|
721
|
-
var
|
|
734
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
722
735
|
var page = _ref7.page,
|
|
723
|
-
|
|
736
|
+
departmentId = _ref7.departmentId;
|
|
724
737
|
try {
|
|
725
738
|
return Promise.resolve(_catch(function () {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
return Promise.resolve(axios.get(url, {
|
|
729
|
-
headers: {
|
|
730
|
-
Authorization: 'Bearer ' + token
|
|
731
|
-
}
|
|
739
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
740
|
+
return res.data;
|
|
732
741
|
})).then(function (response) {
|
|
733
|
-
var mappedValue = response.
|
|
742
|
+
var mappedValue = response.results.map(function (item) {
|
|
734
743
|
return {
|
|
735
744
|
value: item.id,
|
|
736
|
-
label: item.
|
|
745
|
+
label: item.first_name + ' ' + item.last_name,
|
|
746
|
+
type: 'detailed',
|
|
747
|
+
data: item
|
|
737
748
|
};
|
|
738
749
|
});
|
|
739
|
-
|
|
740
|
-
var placeholderLbl = {
|
|
741
|
-
value: '',
|
|
742
|
-
label: placeholder
|
|
743
|
-
};
|
|
744
|
-
mappedValue.unshift(placeholderLbl);
|
|
745
|
-
}
|
|
750
|
+
console.log(response.next);
|
|
746
751
|
return {
|
|
747
752
|
options: mappedValue,
|
|
748
|
-
hasMore: !!response.
|
|
753
|
+
hasMore: !!response.next,
|
|
749
754
|
additional: {
|
|
750
755
|
page: page + 1,
|
|
751
|
-
|
|
756
|
+
departmentId: departmentId
|
|
752
757
|
}
|
|
753
758
|
};
|
|
754
759
|
});
|
|
755
|
-
}, function (
|
|
756
|
-
console.log(error);
|
|
760
|
+
}, function () {
|
|
757
761
|
return {
|
|
758
762
|
options: [],
|
|
759
763
|
hasMore: false,
|
|
760
764
|
additional: {
|
|
761
765
|
page: 1,
|
|
762
|
-
|
|
766
|
+
departmentId: departmentId
|
|
763
767
|
}
|
|
764
768
|
};
|
|
765
769
|
}));
|
|
@@ -798,11 +802,11 @@ var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
|
798
802
|
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
799
803
|
|
|
800
804
|
var env$1 = configs.env;
|
|
801
|
-
var IUILocalStorageService$
|
|
805
|
+
var IUILocalStorageService$1 = services.IUILocalStorageService;
|
|
802
806
|
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
803
807
|
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
804
808
|
var res = {
|
|
805
|
-
company_id: +IUILocalStorageService$
|
|
809
|
+
company_id: +IUILocalStorageService$1.getCompanyId(),
|
|
806
810
|
first_name: payload.personalInfoInput.first_name,
|
|
807
811
|
last_name: payload.personalInfoInput.last_name,
|
|
808
812
|
email: payload.personalInfoInput.email,
|
|
@@ -845,7 +849,6 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
845
849
|
if (userTags.length) {
|
|
846
850
|
res.user_tags = userTags;
|
|
847
851
|
}
|
|
848
|
-
|
|
849
852
|
if (payload.productAccess.travel) {
|
|
850
853
|
var _payload$passportInfo, _payload$passportInfo2, _payload$passportInfo3, _payload$passportInfo4, _payload$membershipIn, _payload$uploadedFile;
|
|
851
854
|
res.approvers.travel = [];
|
|
@@ -857,14 +860,12 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
857
860
|
});
|
|
858
861
|
}
|
|
859
862
|
}
|
|
860
|
-
|
|
861
863
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
862
864
|
res.approvers.travel.push({
|
|
863
865
|
email: payload.travelFYI.value,
|
|
864
866
|
sequence: 'fyi'
|
|
865
867
|
});
|
|
866
868
|
}
|
|
867
|
-
|
|
868
869
|
res.user_travel_info = {
|
|
869
870
|
passport_issue_country: payload !== null && payload !== void 0 && (_payload$passportInfo = payload.passportInfoInput) !== null && _payload$passportInfo !== void 0 && (_payload$passportInfo2 = _payload$passportInfo.passport_issue_country) !== null && _payload$passportInfo2 !== void 0 && _payload$passportInfo2.value ? payload.passportInfoInput.passport_issue_country.value : null,
|
|
870
871
|
nationality: payload !== null && payload !== void 0 && (_payload$passportInfo3 = payload.passportInfoInput) !== null && _payload$passportInfo3 !== void 0 && (_payload$passportInfo4 = _payload$passportInfo3.nationality) !== null && _payload$passportInfo4 !== void 0 && _payload$passportInfo4.value ? payload.passportInfoInput.nationality.value : null,
|
|
@@ -903,7 +904,6 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
903
904
|
res.files = [];
|
|
904
905
|
}
|
|
905
906
|
}
|
|
906
|
-
|
|
907
907
|
if (payload.productAccess.expense) {
|
|
908
908
|
res.approvers.expense = [];
|
|
909
909
|
for (var _key2 in payload.expenseApproversInput) {
|
|
@@ -914,7 +914,6 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
|
-
|
|
918
917
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
919
918
|
res.approvers.expense.push({
|
|
920
919
|
email: payload.expenseFYI.value,
|
|
@@ -1022,7 +1021,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1022
1021
|
});
|
|
1023
1022
|
}
|
|
1024
1023
|
}
|
|
1025
|
-
|
|
1026
1024
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
1027
1025
|
res.fields.approvers.travel.push({
|
|
1028
1026
|
email: payload.travelFYI.value,
|
|
@@ -1045,6 +1043,9 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1045
1043
|
if (payload.filesForDelete.length > 0) {
|
|
1046
1044
|
res.fields.filesToDelete = payload.filesForDelete;
|
|
1047
1045
|
}
|
|
1046
|
+
if (payload.profilePicDelete.length > 0) {
|
|
1047
|
+
res.fields.profilePicDelete = payload.profilePicDelete;
|
|
1048
|
+
}
|
|
1048
1049
|
if (payload.membershipInfoInput && payload.membershipInfoInput.length > 0) {
|
|
1049
1050
|
res.fields.membership_info = payload.membershipInfoInput.filter(function (membership) {
|
|
1050
1051
|
return !!membership.isEditMode;
|
|
@@ -1096,7 +1097,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1096
1097
|
res.fields.user_travel_info.redress_number = payload.secureTravelInputInfo.redress_number || null;
|
|
1097
1098
|
}
|
|
1098
1099
|
}
|
|
1099
|
-
|
|
1100
1100
|
if (payload.productAccess.expense) {
|
|
1101
1101
|
if (!env$1.isProfilePage()) {
|
|
1102
1102
|
res.fields.approvers.expense = [];
|
|
@@ -1108,7 +1108,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
|
|
1112
1111
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
1113
1112
|
res.fields.approvers.expense.push({
|
|
1114
1113
|
email: payload.expenseFYI.value,
|
|
@@ -1120,9 +1119,160 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1120
1119
|
return res;
|
|
1121
1120
|
};
|
|
1122
1121
|
|
|
1122
|
+
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
1123
|
+
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
1124
|
+
var SET_USER_LIST_FIELDS = 'SET_USER_LIST_FIELDS';
|
|
1125
|
+
var SET_ACTIVE_STATUS = 'SET_ACTIVE_STATUS';
|
|
1126
|
+
var SET_BULK_DEACTIVATED_USERS = 'SET_BULK_DEACTIVATED_USERS';
|
|
1127
|
+
var SET_SIGNUP_REQUEST_LIST = 'SET_SIGNUP_REQUEST_LIST';
|
|
1128
|
+
var SET_TAB_VALUE = 'SET_TAB_VALUE';
|
|
1129
|
+
|
|
1123
1130
|
var api$1 = configs.api;
|
|
1124
|
-
var IUIToastMessageService = services.IUIToastMessageService
|
|
1125
|
-
|
|
1131
|
+
var IUIToastMessageService = services.IUIToastMessageService;
|
|
1132
|
+
var setUserListFields = function setUserListFields(payload) {
|
|
1133
|
+
return {
|
|
1134
|
+
type: SET_USER_LIST_FIELDS,
|
|
1135
|
+
payload: payload
|
|
1136
|
+
};
|
|
1137
|
+
};
|
|
1138
|
+
var setSignUpRequestList = function setSignUpRequestList(payload) {
|
|
1139
|
+
return {
|
|
1140
|
+
type: SET_SIGNUP_REQUEST_LIST,
|
|
1141
|
+
payload: payload
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
1145
|
+
return {
|
|
1146
|
+
type: SET_ACTIVE_STATUS,
|
|
1147
|
+
payload: payload
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1151
|
+
return {
|
|
1152
|
+
type: SET_BULK_DEACTIVATED_USERS,
|
|
1153
|
+
payload: payload
|
|
1154
|
+
};
|
|
1155
|
+
};
|
|
1156
|
+
var showDataFetchingStatus = function showDataFetchingStatus(payload) {
|
|
1157
|
+
return {
|
|
1158
|
+
type: SHOW_LOADER$1,
|
|
1159
|
+
payload: payload
|
|
1160
|
+
};
|
|
1161
|
+
};
|
|
1162
|
+
var stopDataFetchingStatus = function stopDataFetchingStatus(payload) {
|
|
1163
|
+
return {
|
|
1164
|
+
type: STOP_LOADER$1,
|
|
1165
|
+
payload: payload
|
|
1166
|
+
};
|
|
1167
|
+
};
|
|
1168
|
+
var fetchUsersList = function fetchUsersList(url) {
|
|
1169
|
+
return function (dispatch, getState) {
|
|
1170
|
+
return new Promise(function (resolve, reject) {
|
|
1171
|
+
api$1.get(url + ("&company_id=" + getState().common.company)).then(function (res) {
|
|
1172
|
+
dispatch(setUserListFields(res.data));
|
|
1173
|
+
dispatch(stopDataFetchingStatus());
|
|
1174
|
+
resolve();
|
|
1175
|
+
})["catch"](function (err) {
|
|
1176
|
+
reject(err);
|
|
1177
|
+
dispatch(stopDataFetchingStatus());
|
|
1178
|
+
})["finally"](function () {
|
|
1179
|
+
dispatch(stopDataFetchingStatus());
|
|
1180
|
+
});
|
|
1181
|
+
});
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
var fetchUserSignupRequests = function fetchUserSignupRequests(params) {
|
|
1185
|
+
if (params === void 0) {
|
|
1186
|
+
params = {};
|
|
1187
|
+
}
|
|
1188
|
+
return function (dispatch, getState) {
|
|
1189
|
+
return new Promise(function (resolve, reject) {
|
|
1190
|
+
api$1.get(userListUrl.signupRequests, {
|
|
1191
|
+
params: params
|
|
1192
|
+
}).then(function (res) {
|
|
1193
|
+
dispatch(setSignUpRequestList(res.data));
|
|
1194
|
+
dispatch(stopDataFetchingStatus());
|
|
1195
|
+
resolve();
|
|
1196
|
+
})["catch"](function (err) {
|
|
1197
|
+
reject(err);
|
|
1198
|
+
dispatch(stopDataFetchingStatus());
|
|
1199
|
+
})["finally"](function () {
|
|
1200
|
+
dispatch(stopDataFetchingStatus());
|
|
1201
|
+
});
|
|
1202
|
+
});
|
|
1203
|
+
};
|
|
1204
|
+
};
|
|
1205
|
+
var exportUsers = function exportUsers(payload) {
|
|
1206
|
+
return function (dispatch) {
|
|
1207
|
+
return new Promise(function (resolve, reject) {
|
|
1208
|
+
api$1.get("" + userListUrl.exportUsers()).then(function (res) {
|
|
1209
|
+
resolve(res);
|
|
1210
|
+
})["catch"](function (err) {
|
|
1211
|
+
reject(err);
|
|
1212
|
+
});
|
|
1213
|
+
});
|
|
1214
|
+
};
|
|
1215
|
+
};
|
|
1216
|
+
var deActivateUsers = function deActivateUsers(ids) {
|
|
1217
|
+
return function (dispatch) {
|
|
1218
|
+
return new Promise(function (resolve, reject) {
|
|
1219
|
+
api$1.post("" + userListUrl.bulkDeactivate(), {
|
|
1220
|
+
user_ids: ids
|
|
1221
|
+
}).then(function (res) {
|
|
1222
|
+
dispatch(setBulkDeactivatedUsers(ids));
|
|
1223
|
+
IUIToastMessageService.sNotify(ids.length + ' Users deactivated successfully');
|
|
1224
|
+
resolve();
|
|
1225
|
+
})["catch"](function (err) {
|
|
1226
|
+
if (!err.response.data.status) {
|
|
1227
|
+
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1228
|
+
reject(err);
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
reject(err);
|
|
1232
|
+
});
|
|
1233
|
+
});
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1236
|
+
var updateTabValue = function updateTabValue(tabId) {
|
|
1237
|
+
return {
|
|
1238
|
+
type: SET_TAB_VALUE,
|
|
1239
|
+
payload: tabId
|
|
1240
|
+
};
|
|
1241
|
+
};
|
|
1242
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1243
|
+
if (roleTransfer === void 0) {
|
|
1244
|
+
roleTransfer = false;
|
|
1245
|
+
}
|
|
1246
|
+
var _payload = {
|
|
1247
|
+
role_transfer: roleTransfer
|
|
1248
|
+
};
|
|
1249
|
+
if (roleTransfer) {
|
|
1250
|
+
_payload.new_approver_user_id = newApproverUserId;
|
|
1251
|
+
}
|
|
1252
|
+
return function (dispatch) {
|
|
1253
|
+
return new Promise(function (resolve, reject) {
|
|
1254
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1255
|
+
dispatch(setUserActiveStatus({
|
|
1256
|
+
is_active: activateVal !== 0,
|
|
1257
|
+
id: id
|
|
1258
|
+
}));
|
|
1259
|
+
IUIToastMessageService.sNotify(res.data.message);
|
|
1260
|
+
resolve(res);
|
|
1261
|
+
})["catch"](function (err) {
|
|
1262
|
+
if (!err.response.data.status) {
|
|
1263
|
+
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1264
|
+
reject(err);
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
reject(err);
|
|
1268
|
+
});
|
|
1269
|
+
});
|
|
1270
|
+
};
|
|
1271
|
+
};
|
|
1272
|
+
|
|
1273
|
+
var api$2 = configs.api;
|
|
1274
|
+
var IUIToastMessageService$1 = services.IUIToastMessageService,
|
|
1275
|
+
IUILocalStorageService$2 = services.IUILocalStorageService;
|
|
1126
1276
|
var showLoader = function showLoader() {
|
|
1127
1277
|
return {
|
|
1128
1278
|
type: SHOW_LOADER
|
|
@@ -1190,15 +1340,14 @@ var setPaymentDetails = function setPaymentDetails(payload) {
|
|
|
1190
1340
|
var fetchRenderFileds = function fetchRenderFileds() {
|
|
1191
1341
|
return function (dispatch) {
|
|
1192
1342
|
return new Promise(function (resolve, reject) {
|
|
1193
|
-
api$
|
|
1343
|
+
api$2.get(userAddEditUrl.renderFields()).then(function (res) {
|
|
1194
1344
|
if (res.data.status === true) {
|
|
1195
1345
|
dispatch(setRenderFields(res.data));
|
|
1196
1346
|
resolve();
|
|
1197
1347
|
} else {
|
|
1198
1348
|
var _res$data;
|
|
1199
|
-
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Opps, Something went wrong.');
|
|
1349
|
+
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Opps, Something went wrong.');
|
|
1200
1350
|
dispatch(stopLoader());
|
|
1201
|
-
reject();
|
|
1202
1351
|
}
|
|
1203
1352
|
})["catch"](function (err) {
|
|
1204
1353
|
reject(err);
|
|
@@ -1209,7 +1358,7 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1209
1358
|
var fetchCountryCodes = function fetchCountryCodes() {
|
|
1210
1359
|
return function (dispatch) {
|
|
1211
1360
|
return new Promise(function (resolve, reject) {
|
|
1212
|
-
api$
|
|
1361
|
+
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1213
1362
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1214
1363
|
resolve('success');
|
|
1215
1364
|
})["catch"](function (err) {
|
|
@@ -1221,12 +1370,12 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1221
1370
|
var addCustomFieldLabel = function addCustomFieldLabel(payload) {
|
|
1222
1371
|
return function (dispatch) {
|
|
1223
1372
|
return new Promise(function (resolve, reject) {
|
|
1224
|
-
api$
|
|
1373
|
+
api$2.post(customFieldsUrls.customFields(), payload).then(function (res) {
|
|
1225
1374
|
dispatch(setCustomField(res.data.result));
|
|
1226
1375
|
resolve();
|
|
1227
1376
|
})["catch"](function (err) {
|
|
1228
1377
|
var _err$response, _err$response$data;
|
|
1229
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || 'Opps, Something went wrong.');
|
|
1378
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.message) || 'Opps, Something went wrong.');
|
|
1230
1379
|
reject(err);
|
|
1231
1380
|
});
|
|
1232
1381
|
});
|
|
@@ -1244,7 +1393,7 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1244
1393
|
label = "Travel approver " + sNo;
|
|
1245
1394
|
}
|
|
1246
1395
|
});
|
|
1247
|
-
api$
|
|
1396
|
+
api$2.post(userAddEditUrl.approverField(), {
|
|
1248
1397
|
product: 'Travel',
|
|
1249
1398
|
label: label
|
|
1250
1399
|
}).then(function (res) {
|
|
@@ -1265,7 +1414,36 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1265
1414
|
})["catch"](function (err) {
|
|
1266
1415
|
var _err$response2, _err$response2$data;
|
|
1267
1416
|
if (err !== null && err !== void 0 && (_err$response2 = err.response) !== null && _err$response2 !== void 0 && (_err$response2$data = _err$response2.data) !== null && _err$response2$data !== void 0 && _err$response2$data.message) {
|
|
1268
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1417
|
+
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1418
|
+
}
|
|
1419
|
+
reject(err);
|
|
1420
|
+
});
|
|
1421
|
+
});
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
var addManagerApproverField = function addManagerApproverField() {
|
|
1425
|
+
return function (dispatch, getState) {
|
|
1426
|
+
return new Promise(function (resolve, reject) {
|
|
1427
|
+
api$2.post(userAddEditUrl.approverField(), {
|
|
1428
|
+
label: 'Manager'
|
|
1429
|
+
}).then(function (res) {
|
|
1430
|
+
dispatch(setTravelApproverField({
|
|
1431
|
+
id: 7,
|
|
1432
|
+
label: 'Manager',
|
|
1433
|
+
name: 'manager',
|
|
1434
|
+
required: false,
|
|
1435
|
+
type: 'async_select',
|
|
1436
|
+
fullWidth: false,
|
|
1437
|
+
visibility: true,
|
|
1438
|
+
sequence: res.data.sequence,
|
|
1439
|
+
placeholder: 'Select manager',
|
|
1440
|
+
loadOption: approversOptions
|
|
1441
|
+
}));
|
|
1442
|
+
resolve();
|
|
1443
|
+
})["catch"](function (err) {
|
|
1444
|
+
var _err$response3, _err$response3$data;
|
|
1445
|
+
if (err !== null && err !== void 0 && (_err$response3 = err.response) !== null && _err$response3 !== void 0 && (_err$response3$data = _err$response3.data) !== null && _err$response3$data !== void 0 && _err$response3$data.message) {
|
|
1446
|
+
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1269
1447
|
}
|
|
1270
1448
|
reject(err);
|
|
1271
1449
|
});
|
|
@@ -1284,7 +1462,7 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1284
1462
|
label = "Expense approver " + sNo;
|
|
1285
1463
|
}
|
|
1286
1464
|
});
|
|
1287
|
-
api$
|
|
1465
|
+
api$2.post(userAddEditUrl.approverField(), {
|
|
1288
1466
|
product: 'Expense',
|
|
1289
1467
|
label: label
|
|
1290
1468
|
}).then(function (res) {
|
|
@@ -1303,9 +1481,9 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1303
1481
|
}));
|
|
1304
1482
|
resolve();
|
|
1305
1483
|
})["catch"](function (err) {
|
|
1306
|
-
var _err$
|
|
1307
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1308
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1484
|
+
var _err$response4, _err$response4$data;
|
|
1485
|
+
if (err !== null && err !== void 0 && (_err$response4 = err.response) !== null && _err$response4 !== void 0 && (_err$response4$data = _err$response4.data) !== null && _err$response4$data !== void 0 && _err$response4$data.message) {
|
|
1486
|
+
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1309
1487
|
}
|
|
1310
1488
|
reject(err);
|
|
1311
1489
|
});
|
|
@@ -1318,13 +1496,13 @@ var editApproverLabel = function editApproverLabel(payload) {
|
|
|
1318
1496
|
});
|
|
1319
1497
|
return function (dispatch) {
|
|
1320
1498
|
return new Promise(function (resolve, reject) {
|
|
1321
|
-
api$
|
|
1499
|
+
api$2.put(userAddEditUrl.approverField(), payload).then(function (res) {
|
|
1322
1500
|
dispatch(payload.product === 'travel' ? setEditedTravelApproverField(payload) : setEditedExpenseApproverField(payload));
|
|
1323
1501
|
resolve();
|
|
1324
1502
|
})["catch"](function (err) {
|
|
1325
|
-
var _err$
|
|
1326
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1327
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1503
|
+
var _err$response5, _err$response5$data;
|
|
1504
|
+
if (err !== null && err !== void 0 && (_err$response5 = err.response) !== null && _err$response5 !== void 0 && (_err$response5$data = _err$response5.data) !== null && _err$response5$data !== void 0 && _err$response5$data.message) {
|
|
1505
|
+
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1328
1506
|
}
|
|
1329
1507
|
reject(err);
|
|
1330
1508
|
});
|
|
@@ -1334,23 +1512,21 @@ var editApproverLabel = function editApproverLabel(payload) {
|
|
|
1334
1512
|
var createUser = function createUser(payload) {
|
|
1335
1513
|
return function (dispatch) {
|
|
1336
1514
|
return new Promise(function (resolve, reject) {
|
|
1337
|
-
api$
|
|
1515
|
+
api$2.post(userAddEditUrl.createUser(), formatCreateUserPayload(payload)).then(function (res) {
|
|
1338
1516
|
if (res.data.status === true) {
|
|
1339
|
-
IUIToastMessageService.sNotify(res.data.message);
|
|
1517
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1340
1518
|
resolve(res.data);
|
|
1341
1519
|
} else {
|
|
1342
1520
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1343
1521
|
reject(res.data.errors);
|
|
1344
|
-
return;
|
|
1345
1522
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1346
|
-
IUIToastMessageService.warningNotify(res.data.message);
|
|
1523
|
+
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1347
1524
|
}
|
|
1348
|
-
reject();
|
|
1349
1525
|
}
|
|
1350
1526
|
})["catch"](function (err) {
|
|
1351
|
-
var _err$
|
|
1527
|
+
var _err$response6;
|
|
1352
1528
|
var error = 'Opps, Something went error.';
|
|
1353
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1529
|
+
if (err !== null && err !== void 0 && (_err$response6 = err.response) !== null && _err$response6 !== void 0 && _err$response6.data) {
|
|
1354
1530
|
if (err.response.data.errors && typeof err.response.data.errors === 'object' && Object.keys(err.response.data.errors).length) {
|
|
1355
1531
|
reject(err.response.data.errors);
|
|
1356
1532
|
return;
|
|
@@ -1372,7 +1548,7 @@ var uploadSingleDocumnet = function uploadSingleDocumnet(payload) {
|
|
|
1372
1548
|
profile_pic: 'profile_pic'
|
|
1373
1549
|
};
|
|
1374
1550
|
return new Promise(function (resolve, reject) {
|
|
1375
|
-
api$
|
|
1551
|
+
api$2.get(userAddEditUrl.preSignedUrl() + "?action=upload&item_type=" + payload.itemType + "&file_name=" + encodeURIComponent(payload.fileName)).then(function (res) {
|
|
1376
1552
|
var resolveResponse = {
|
|
1377
1553
|
file_type: itemTypes[payload.itemType],
|
|
1378
1554
|
file_path: res.data.presigned_url.fields.key,
|
|
@@ -1391,17 +1567,13 @@ var uploadSingleDocumnet = function uploadSingleDocumnet(payload) {
|
|
|
1391
1567
|
});
|
|
1392
1568
|
};
|
|
1393
1569
|
};
|
|
1394
|
-
|
|
1395
1570
|
var uploadFileToS3 = function uploadFileToS3(presignedPostData, file) {
|
|
1396
1571
|
return new Promise(function (resolve, reject) {
|
|
1397
1572
|
var formData = new FormData();
|
|
1398
|
-
|
|
1399
1573
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
1400
1574
|
formData.append(key, presignedPostData.fields[key]);
|
|
1401
1575
|
});
|
|
1402
|
-
|
|
1403
1576
|
formData.append('file', file);
|
|
1404
|
-
|
|
1405
1577
|
axios.post(presignedPostData.url, formData, {
|
|
1406
1578
|
headers: {
|
|
1407
1579
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1416,7 +1588,7 @@ var uploadFileToS3 = function uploadFileToS3(presignedPostData, file) {
|
|
|
1416
1588
|
var fetchUserDetails = function fetchUserDetails(payload) {
|
|
1417
1589
|
return function (dispatch) {
|
|
1418
1590
|
return new Promise(function (resolve, reject) {
|
|
1419
|
-
api$
|
|
1591
|
+
api$2.get(userAddEditUrl.editUser(payload.userId)).then(function (res) {
|
|
1420
1592
|
if (res.data.status) {
|
|
1421
1593
|
resolve(res.data.result);
|
|
1422
1594
|
} else {
|
|
@@ -1428,23 +1600,102 @@ var fetchUserDetails = function fetchUserDetails(payload) {
|
|
|
1428
1600
|
});
|
|
1429
1601
|
};
|
|
1430
1602
|
};
|
|
1431
|
-
var
|
|
1603
|
+
var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
1432
1604
|
return function (dispatch) {
|
|
1433
1605
|
return new Promise(function (resolve, reject) {
|
|
1434
|
-
api$
|
|
1435
|
-
if (res
|
|
1436
|
-
IUIToastMessageService.sNotify(res.data.message);
|
|
1437
|
-
resolve(
|
|
1606
|
+
api$2.put(userAddEditUrl.primaryAdmin(payload.userId)).then(function (res) {
|
|
1607
|
+
if (res) {
|
|
1608
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1609
|
+
resolve();
|
|
1610
|
+
} else {
|
|
1611
|
+
reject(res);
|
|
1612
|
+
}
|
|
1613
|
+
})["catch"](function (err) {
|
|
1614
|
+
var _err$response7, _err$response7$data;
|
|
1615
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1616
|
+
reject(err);
|
|
1617
|
+
});
|
|
1618
|
+
});
|
|
1619
|
+
};
|
|
1620
|
+
};
|
|
1621
|
+
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1622
|
+
return function (dispatch) {
|
|
1623
|
+
return new Promise(function (resolve, reject) {
|
|
1624
|
+
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1625
|
+
dispatch(fetchUserSignupRequests({
|
|
1626
|
+
ordering: 'asc',
|
|
1627
|
+
length: 5,
|
|
1628
|
+
page: 1,
|
|
1629
|
+
search: ''
|
|
1630
|
+
}));
|
|
1631
|
+
resolve();
|
|
1632
|
+
})["catch"](function (err) {
|
|
1633
|
+
var _err$response8, _err$response8$data;
|
|
1634
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : _err$response8$data.message) || 'Opps, Something went wrong.');
|
|
1635
|
+
reject(err);
|
|
1636
|
+
});
|
|
1637
|
+
});
|
|
1638
|
+
};
|
|
1639
|
+
};
|
|
1640
|
+
var resetPasswordForUser = function resetPasswordForUser(data) {
|
|
1641
|
+
return function (dispatch) {
|
|
1642
|
+
return new Promise(function (resolve, reject) {
|
|
1643
|
+
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1644
|
+
email: data.email
|
|
1645
|
+
}).then(function (res) {
|
|
1646
|
+
IUIToastMessageService$1.sNotify("The link to reset the password has been sent to the user's email address. Check your \"junk mail\" or \"spam\" folders in case it's not received.");
|
|
1647
|
+
resolve();
|
|
1648
|
+
})["catch"](function (err) {
|
|
1649
|
+
var _err$response9, _err$response9$data;
|
|
1650
|
+
if (!(err !== null && err !== void 0 && (_err$response9 = err.response) !== null && _err$response9 !== void 0 && (_err$response9$data = _err$response9.data) !== null && _err$response9$data !== void 0 && _err$response9$data.status)) {
|
|
1651
|
+
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1652
|
+
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : (_err$response10$data$ = _err$response10$data.message) === null || _err$response10$data$ === void 0 ? void 0 : _err$response10$data$.email[0]);
|
|
1653
|
+
reject(err);
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
reject(err);
|
|
1657
|
+
});
|
|
1658
|
+
});
|
|
1659
|
+
};
|
|
1660
|
+
};
|
|
1661
|
+
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1662
|
+
return function (dispatch) {
|
|
1663
|
+
return new Promise(function (resolve, reject) {
|
|
1664
|
+
api$2.post(userAddEditUrl.resendInviteForUserApi(), {
|
|
1665
|
+
user_ids: data
|
|
1666
|
+
}).then(function (res) {
|
|
1667
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1668
|
+
resolve();
|
|
1669
|
+
})["catch"](function (err) {
|
|
1670
|
+
var _err$response11, _err$response11$data;
|
|
1671
|
+
if (!(err !== null && err !== void 0 && (_err$response11 = err.response) !== null && _err$response11 !== void 0 && (_err$response11$data = _err$response11.data) !== null && _err$response11$data !== void 0 && _err$response11$data.status)) {
|
|
1672
|
+
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1673
|
+
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : (_err$response12$data$ = _err$response12$data.message) === null || _err$response12$data$ === void 0 ? void 0 : _err$response12$data$.email[0]);
|
|
1674
|
+
reject(err);
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
reject(err);
|
|
1678
|
+
});
|
|
1679
|
+
});
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1682
|
+
var updateUser = function updateUser(payload, userId, inputChangeLog) {
|
|
1683
|
+
return function (dispatch) {
|
|
1684
|
+
return new Promise(function (resolve, reject) {
|
|
1685
|
+
api$2.put(userAddEditUrl.editUser(userId), formatUpdateUserPayload(payload, inputChangeLog)).then(function (res) {
|
|
1686
|
+
if (res.data.status === true) {
|
|
1687
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1688
|
+
resolve(res.data);
|
|
1438
1689
|
} else {
|
|
1439
1690
|
if (!Object.keys(res.data.errors).length) {
|
|
1440
|
-
IUIToastMessageService.warningNotify(res.data.message);
|
|
1691
|
+
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1441
1692
|
}
|
|
1442
1693
|
reject(res.data.errors);
|
|
1443
1694
|
}
|
|
1444
1695
|
})["catch"](function (err) {
|
|
1445
|
-
var _err$
|
|
1696
|
+
var _err$response13;
|
|
1446
1697
|
var error = 'Opps, Something went error.';
|
|
1447
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1698
|
+
if (err !== null && err !== void 0 && (_err$response13 = err.response) !== null && _err$response13 !== void 0 && _err$response13.data) {
|
|
1448
1699
|
if (err.response.data.errors && typeof err.response.data.errors === 'object' && Object.keys(err.response.data.errors).length) {
|
|
1449
1700
|
reject(err.response.data.errors);
|
|
1450
1701
|
return;
|
|
@@ -1461,7 +1712,7 @@ var updateUser = function updateUser(payload, userId, inputChangeLog) {
|
|
|
1461
1712
|
var downloadSingleDocumnet = function downloadSingleDocumnet(payload) {
|
|
1462
1713
|
return function (dispatch) {
|
|
1463
1714
|
return new Promise(function (resolve, reject) {
|
|
1464
|
-
api$
|
|
1715
|
+
api$2.get(userAddEditUrl.preSignedUrl() + "?action=download&traveler_type=staff&item_type=" + payload.itemType + "&file_name=" + payload.fileName + "&user_id=" + payload.userId).then(function (res) {
|
|
1465
1716
|
resolve(res);
|
|
1466
1717
|
})["catch"](function (err) {
|
|
1467
1718
|
reject(err);
|
|
@@ -1475,7 +1726,7 @@ var deletePaymentCard = function deletePaymentCard(payload) {
|
|
|
1475
1726
|
dispatch(showLoader());
|
|
1476
1727
|
axios["delete"](userAddEditUrl.deletePaymentCard(payload.pmId, payload.vendorId), {
|
|
1477
1728
|
headers: {
|
|
1478
|
-
Authorization: 'Bearer ' + IUILocalStorageService$
|
|
1729
|
+
Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
|
|
1479
1730
|
}
|
|
1480
1731
|
}).then(function (res) {
|
|
1481
1732
|
if (res.data.status) {
|
|
@@ -1487,12 +1738,12 @@ var deletePaymentCard = function deletePaymentCard(payload) {
|
|
|
1487
1738
|
dispatch(setPaymentDetails(_paymentDetails));
|
|
1488
1739
|
} else {
|
|
1489
1740
|
var _res$data2;
|
|
1490
|
-
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.message) || 'Opps, Something went wrong.');
|
|
1741
|
+
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.message) || 'Opps, Something went wrong.');
|
|
1491
1742
|
reject(res);
|
|
1492
1743
|
}
|
|
1493
1744
|
})["catch"](function (err) {
|
|
1494
|
-
var _err$
|
|
1495
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1745
|
+
var _err$response14, _err$response14$data;
|
|
1746
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response14 = err.response) === null || _err$response14 === void 0 ? void 0 : (_err$response14$data = _err$response14.data) === null || _err$response14$data === void 0 ? void 0 : _err$response14$data.message) || 'Opps, Something went wrong.');
|
|
1496
1747
|
reject(err);
|
|
1497
1748
|
})["finally"](function () {
|
|
1498
1749
|
dispatch(stopLoader());
|
|
@@ -1506,7 +1757,7 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1506
1757
|
dispatch(showLoader());
|
|
1507
1758
|
axios.put(userAddEditUrl.setDefaultCard(), payload, {
|
|
1508
1759
|
headers: {
|
|
1509
|
-
Authorization: 'Bearer ' + IUILocalStorageService$
|
|
1760
|
+
Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
|
|
1510
1761
|
}
|
|
1511
1762
|
}).then(function (res) {
|
|
1512
1763
|
if (res.data.status) {
|
|
@@ -1523,12 +1774,12 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1523
1774
|
dispatch(setPaymentDetails(_paymentDetails));
|
|
1524
1775
|
} else {
|
|
1525
1776
|
var _res$data3;
|
|
1526
|
-
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.message) || 'Opps, Something went wrong.');
|
|
1777
|
+
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.message) || 'Opps, Something went wrong.');
|
|
1527
1778
|
reject(res);
|
|
1528
1779
|
}
|
|
1529
1780
|
})["catch"](function (err) {
|
|
1530
|
-
var _err$
|
|
1531
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1781
|
+
var _err$response15, _err$response15$data;
|
|
1782
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response15 = err.response) === null || _err$response15 === void 0 ? void 0 : (_err$response15$data = _err$response15.data) === null || _err$response15$data === void 0 ? void 0 : _err$response15$data.message) || 'Opps, Something went wrong.');
|
|
1532
1783
|
reject(err);
|
|
1533
1784
|
})["finally"](function () {
|
|
1534
1785
|
dispatch(stopLoader());
|
|
@@ -1539,20 +1790,20 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1539
1790
|
var verifyUserInfo = function verifyUserInfo(userId) {
|
|
1540
1791
|
return function (dispatch) {
|
|
1541
1792
|
return new Promise(function (resolve, reject) {
|
|
1542
|
-
api$
|
|
1793
|
+
api$2.get(userAddEditUrl.verifyUserInfo(userId)).then(function (res) {
|
|
1543
1794
|
if (res.data.status === 200) {
|
|
1544
1795
|
resolve(res.data.result);
|
|
1545
1796
|
} else {
|
|
1546
1797
|
var _res$data4;
|
|
1547
|
-
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.message) || 'Opps, Unable to fetch user info.');
|
|
1798
|
+
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.message) || 'Opps, Unable to fetch user info.');
|
|
1548
1799
|
setTimeout(function () {
|
|
1549
1800
|
window.history.back();
|
|
1550
1801
|
}, 1000);
|
|
1551
1802
|
reject(res);
|
|
1552
1803
|
}
|
|
1553
1804
|
})["catch"](function (err) {
|
|
1554
|
-
var _err$
|
|
1555
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1805
|
+
var _err$response16, _err$response16$data;
|
|
1806
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response16 = err.response) === null || _err$response16 === void 0 ? void 0 : (_err$response16$data = _err$response16.data) === null || _err$response16$data === void 0 ? void 0 : _err$response16$data.message) || 'Opps, Unable to fetch user info.');
|
|
1556
1807
|
setTimeout(function () {
|
|
1557
1808
|
window.history.back();
|
|
1558
1809
|
}, 1000);
|
|
@@ -1564,11 +1815,11 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1564
1815
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1565
1816
|
return function (dispatch) {
|
|
1566
1817
|
return new Promise(function (resolve, reject) {
|
|
1567
|
-
api$
|
|
1818
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1568
1819
|
resolve(res);
|
|
1569
1820
|
})["catch"](function (err) {
|
|
1570
|
-
var _err$
|
|
1571
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1821
|
+
var _err$response17, _err$response17$data;
|
|
1822
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response17 = err.response) === null || _err$response17 === void 0 ? void 0 : (_err$response17$data = _err$response17.data) === null || _err$response17$data === void 0 ? void 0 : _err$response17$data.message) || 'Opps, Something went wrong.');
|
|
1572
1823
|
dispatch(stopLoader());
|
|
1573
1824
|
});
|
|
1574
1825
|
});
|
|
@@ -1577,101 +1828,17 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
|
1577
1828
|
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
1578
1829
|
return function (dispatch) {
|
|
1579
1830
|
return new Promise(function (resolve, reject) {
|
|
1580
|
-
api$
|
|
1581
|
-
console.log(res);
|
|
1831
|
+
api$2.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
1582
1832
|
if (res.data.status === true) {
|
|
1583
|
-
var _res$data5;
|
|
1584
|
-
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.');
|
|
1585
1833
|
resolve(res.data);
|
|
1586
1834
|
} else {
|
|
1587
|
-
var _res$
|
|
1588
|
-
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$
|
|
1835
|
+
var _res$data5;
|
|
1836
|
+
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.message) || 'Opps, Unable to reject user.');
|
|
1589
1837
|
reject(res);
|
|
1590
1838
|
}
|
|
1591
1839
|
})["catch"](function (err) {
|
|
1592
|
-
var _err$
|
|
1593
|
-
|
|
1594
|
-
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.');
|
|
1595
|
-
reject(err);
|
|
1596
|
-
});
|
|
1597
|
-
});
|
|
1598
|
-
};
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
|
-
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
1602
|
-
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
1603
|
-
var SET_USER_LIST_FIELDS = 'SET_USER_LIST_FIELDS';
|
|
1604
|
-
var SET_ACTIVE_STATUS = 'SET_ACTIVE_STATUS';
|
|
1605
|
-
var SET_BULK_DEACTIVATED_USERS = 'SET_BULK_DEACTIVATED_USERS';
|
|
1606
|
-
|
|
1607
|
-
var api$2 = configs.api;
|
|
1608
|
-
var IUIToastMessageService$1 = services.IUIToastMessageService;
|
|
1609
|
-
var setUserListFields = function setUserListFields(payload) {
|
|
1610
|
-
return {
|
|
1611
|
-
type: SET_USER_LIST_FIELDS,
|
|
1612
|
-
payload: payload
|
|
1613
|
-
};
|
|
1614
|
-
};
|
|
1615
|
-
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1616
|
-
return {
|
|
1617
|
-
type: SET_BULK_DEACTIVATED_USERS,
|
|
1618
|
-
payload: payload
|
|
1619
|
-
};
|
|
1620
|
-
};
|
|
1621
|
-
var showDataFetchingStatus = function showDataFetchingStatus(payload) {
|
|
1622
|
-
return {
|
|
1623
|
-
type: SHOW_LOADER$1,
|
|
1624
|
-
payload: payload
|
|
1625
|
-
};
|
|
1626
|
-
};
|
|
1627
|
-
var stopDataFetchingStatus = function stopDataFetchingStatus(payload) {
|
|
1628
|
-
return {
|
|
1629
|
-
type: STOP_LOADER$1,
|
|
1630
|
-
payload: payload
|
|
1631
|
-
};
|
|
1632
|
-
};
|
|
1633
|
-
var fetchUsersList = function fetchUsersList(url) {
|
|
1634
|
-
return function (dispatch, getState) {
|
|
1635
|
-
return new Promise(function (resolve, reject) {
|
|
1636
|
-
api$2.get(url + ("&company_id=" + getState().common.company)).then(function (res) {
|
|
1637
|
-
dispatch(setUserListFields(res.data));
|
|
1638
|
-
dispatch(stopDataFetchingStatus());
|
|
1639
|
-
resolve();
|
|
1640
|
-
})["catch"](function (err) {
|
|
1641
|
-
reject(err);
|
|
1642
|
-
dispatch(stopDataFetchingStatus());
|
|
1643
|
-
})["finally"](function () {
|
|
1644
|
-
dispatch(stopDataFetchingStatus());
|
|
1645
|
-
});
|
|
1646
|
-
});
|
|
1647
|
-
};
|
|
1648
|
-
};
|
|
1649
|
-
var exportUsers = function exportUsers(payload) {
|
|
1650
|
-
return function (dispatch) {
|
|
1651
|
-
return new Promise(function (resolve, reject) {
|
|
1652
|
-
api$2.get("" + userListUrl.exportUsers()).then(function (res) {
|
|
1653
|
-
resolve(res);
|
|
1654
|
-
})["catch"](function (err) {
|
|
1655
|
-
reject(err);
|
|
1656
|
-
});
|
|
1657
|
-
});
|
|
1658
|
-
};
|
|
1659
|
-
};
|
|
1660
|
-
var deActivateUsers = function deActivateUsers(ids) {
|
|
1661
|
-
return function (dispatch) {
|
|
1662
|
-
return new Promise(function (resolve, reject) {
|
|
1663
|
-
api$2.post("" + userListUrl.bulkDeactivate(), {
|
|
1664
|
-
user_ids: ids
|
|
1665
|
-
}).then(function (res) {
|
|
1666
|
-
dispatch(setBulkDeactivatedUsers(ids));
|
|
1667
|
-
IUIToastMessageService$1.sNotify(ids.length + ' Users deactivated successfully');
|
|
1668
|
-
resolve();
|
|
1669
|
-
})["catch"](function (err) {
|
|
1670
|
-
if (!err.response.data.status) {
|
|
1671
|
-
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1672
|
-
reject(err);
|
|
1673
|
-
return;
|
|
1674
|
-
}
|
|
1840
|
+
var _err$response18, _err$response18$data;
|
|
1841
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response18 = err.response) === null || _err$response18 === void 0 ? void 0 : (_err$response18$data = _err$response18.data) === null || _err$response18$data === void 0 ? void 0 : _err$response18$data.message) || 'Opps, Unable to reject user.');
|
|
1675
1842
|
reject(err);
|
|
1676
1843
|
});
|
|
1677
1844
|
});
|
|
@@ -1731,7 +1898,6 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1731
1898
|
});
|
|
1732
1899
|
};
|
|
1733
1900
|
};
|
|
1734
|
-
|
|
1735
1901
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1736
1902
|
return function (dispatch) {
|
|
1737
1903
|
return new Promise(function (resolve, reject) {
|
|
@@ -1811,7 +1977,7 @@ var SET_VERIFICATION_ERROR = 'SET_VERIFICATION_ERROR';
|
|
|
1811
1977
|
var api$4 = configs.api,
|
|
1812
1978
|
env$2 = configs.env;
|
|
1813
1979
|
var common = utilUrls.common;
|
|
1814
|
-
var IUILocalStorageService$
|
|
1980
|
+
var IUILocalStorageService$3 = services.IUILocalStorageService;
|
|
1815
1981
|
var setTokenResponse = function setTokenResponse(payload) {
|
|
1816
1982
|
return {
|
|
1817
1983
|
type: VERIFY_ACCESS_TOKEN,
|
|
@@ -1832,7 +1998,7 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1832
1998
|
return new Promise(function (resolve, reject) {
|
|
1833
1999
|
dispatch(setVerificationError(false));
|
|
1834
2000
|
api$4.post(common.verifyToken(), {
|
|
1835
|
-
client_id: +IUILocalStorageService$
|
|
2001
|
+
client_id: +IUILocalStorageService$3.getClientId() || null,
|
|
1836
2002
|
product: env$2.isExpense() ? 'expense' : 'travel'
|
|
1837
2003
|
}).then(function (res) {
|
|
1838
2004
|
if (res.data.status === true) {
|
|
@@ -1842,21 +2008,21 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1842
2008
|
return;
|
|
1843
2009
|
}
|
|
1844
2010
|
if (env$2.isProfilePage()) {
|
|
1845
|
-
IUILocalStorageService$
|
|
2011
|
+
IUILocalStorageService$3.setCompanyId(res.data.company);
|
|
1846
2012
|
dispatch(setTokenResponse(res.data));
|
|
1847
2013
|
dispatch(setVerificationError(false));
|
|
1848
2014
|
if (env$2.isExpense()) {
|
|
1849
|
-
IUILocalStorageService$
|
|
2015
|
+
IUILocalStorageService$3.setRole('submitter');
|
|
1850
2016
|
} else {
|
|
1851
|
-
IUILocalStorageService$
|
|
2017
|
+
IUILocalStorageService$3.setRole('traveler');
|
|
1852
2018
|
}
|
|
1853
2019
|
resolve();
|
|
1854
2020
|
return;
|
|
1855
2021
|
} else {
|
|
1856
2022
|
for (var index = 0; index < res.data.applicable_role.length; index++) {
|
|
1857
2023
|
if (roleCanAccess.includes(res.data.applicable_role[index])) {
|
|
1858
|
-
IUILocalStorageService$
|
|
1859
|
-
IUILocalStorageService$
|
|
2024
|
+
IUILocalStorageService$3.setCompanyId(res.data.company);
|
|
2025
|
+
IUILocalStorageService$3.setRole(res.data.applicable_role[index]);
|
|
1860
2026
|
dispatch(setTokenResponse(res.data));
|
|
1861
2027
|
dispatch(setVerificationError(false));
|
|
1862
2028
|
resolve();
|
|
@@ -2007,7 +2173,7 @@ var editCustomFieldLabel = function editCustomFieldLabel(payload) {
|
|
|
2007
2173
|
};
|
|
2008
2174
|
};
|
|
2009
2175
|
|
|
2010
|
-
var IUILocalStorageService$
|
|
2176
|
+
var IUILocalStorageService$4 = services.IUILocalStorageService;
|
|
2011
2177
|
var env$3 = configs.env;
|
|
2012
2178
|
var CreditCard = function CreditCard(_ref) {
|
|
2013
2179
|
var cardId = _ref.cardId,
|
|
@@ -2069,7 +2235,7 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2069
2235
|
};
|
|
2070
2236
|
var AddCard = function AddCard(_ref2) {
|
|
2071
2237
|
var pg = _ref2.pg;
|
|
2072
|
-
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$
|
|
2238
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2073
2239
|
var handleAddCard = function handleAddCard() {
|
|
2074
2240
|
window.location.assign(_url);
|
|
2075
2241
|
};
|
|
@@ -2287,7 +2453,6 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2287
2453
|
setOpenEditAproverModalFlag(false);
|
|
2288
2454
|
});
|
|
2289
2455
|
};
|
|
2290
|
-
|
|
2291
2456
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2292
2457
|
container: true,
|
|
2293
2458
|
className: (styles.headingPadding)
|
|
@@ -2435,8 +2600,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2435
2600
|
headerText: "Edit approver field",
|
|
2436
2601
|
cancelLabel: "Cancel",
|
|
2437
2602
|
submitLabel: "Save",
|
|
2438
|
-
submitHandler: handleEditAproverLabel
|
|
2439
|
-
,
|
|
2603
|
+
submitHandler: handleEditAproverLabel,
|
|
2440
2604
|
width: "420px",
|
|
2441
2605
|
modalBodyStyle: {
|
|
2442
2606
|
maxHeight: '600px',
|
|
@@ -2992,7 +3156,7 @@ var workInfo = [{
|
|
|
2992
3156
|
},
|
|
2993
3157
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2994
3158
|
}, {
|
|
2995
|
-
id:
|
|
3159
|
+
id: 9,
|
|
2996
3160
|
label: 'Base location',
|
|
2997
3161
|
name: 'base_location',
|
|
2998
3162
|
required: false,
|
|
@@ -3017,7 +3181,7 @@ var workInfo = [{
|
|
|
3017
3181
|
},
|
|
3018
3182
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3019
3183
|
}, {
|
|
3020
|
-
id:
|
|
3184
|
+
id: 10,
|
|
3021
3185
|
label: 'Default currency',
|
|
3022
3186
|
name: 'currency',
|
|
3023
3187
|
required: false,
|
|
@@ -3031,7 +3195,7 @@ var workInfo = [{
|
|
|
3031
3195
|
tooltip: 'This only changes the currency for this user',
|
|
3032
3196
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3033
3197
|
}, {
|
|
3034
|
-
id:
|
|
3198
|
+
id: 11,
|
|
3035
3199
|
empty: true
|
|
3036
3200
|
}];
|
|
3037
3201
|
var products = [{
|
|
@@ -3401,6 +3565,7 @@ var userAddPageFormLabels = {
|
|
|
3401
3565
|
business_unit: 'Business unit',
|
|
3402
3566
|
department: 'Department',
|
|
3403
3567
|
designation: 'Designation',
|
|
3568
|
+
manager: 'Manager',
|
|
3404
3569
|
base_location: 'Base location',
|
|
3405
3570
|
currency: 'Default currency'
|
|
3406
3571
|
},
|
|
@@ -3772,7 +3937,14 @@ var initialState$1 = {
|
|
|
3772
3937
|
previous: null,
|
|
3773
3938
|
results: []
|
|
3774
3939
|
},
|
|
3775
|
-
|
|
3940
|
+
signupRequestListInfo: {
|
|
3941
|
+
count: 0,
|
|
3942
|
+
next: null,
|
|
3943
|
+
previous: null,
|
|
3944
|
+
results: []
|
|
3945
|
+
},
|
|
3946
|
+
deactivatedUsers: [],
|
|
3947
|
+
tabValue: 0
|
|
3776
3948
|
};
|
|
3777
3949
|
var reducer$1 = function reducer(state, action) {
|
|
3778
3950
|
if (state === void 0) {
|
|
@@ -3804,6 +3976,12 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3804
3976
|
deactivatedUsers: deactivatedUsers
|
|
3805
3977
|
});
|
|
3806
3978
|
}
|
|
3979
|
+
case SET_SIGNUP_REQUEST_LIST:
|
|
3980
|
+
{
|
|
3981
|
+
return _extends({}, state, {
|
|
3982
|
+
signupRequestListInfo: action.payload
|
|
3983
|
+
});
|
|
3984
|
+
}
|
|
3807
3985
|
case SET_ACTIVE_STATUS:
|
|
3808
3986
|
{
|
|
3809
3987
|
var _userListInfo = _extends({}, state.userListInfo);
|
|
@@ -3812,7 +3990,6 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3812
3990
|
_userListInfo.results[i].is_active = action.payload.is_active;
|
|
3813
3991
|
}
|
|
3814
3992
|
});
|
|
3815
|
-
|
|
3816
3993
|
var _deactivatedUsers = _userListInfo.results.length > 0 ? _userListInfo.results.filter(function (val) {
|
|
3817
3994
|
return !val.is_active;
|
|
3818
3995
|
}).map(function (obj) {
|
|
@@ -3835,7 +4012,6 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3835
4012
|
}
|
|
3836
4013
|
});
|
|
3837
4014
|
});
|
|
3838
|
-
|
|
3839
4015
|
var _deactivatedUsers2 = _userListInfo2.results.length > 0 ? _userListInfo2.results.filter(function (val) {
|
|
3840
4016
|
return !val.is_active;
|
|
3841
4017
|
}).map(function (obj) {
|
|
@@ -3848,6 +4024,12 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3848
4024
|
deactivatedUsers: _deactivatedUsers2
|
|
3849
4025
|
});
|
|
3850
4026
|
}
|
|
4027
|
+
case SET_TAB_VALUE:
|
|
4028
|
+
{
|
|
4029
|
+
return _extends({}, state, {
|
|
4030
|
+
tabValue: action.payload
|
|
4031
|
+
});
|
|
4032
|
+
}
|
|
3851
4033
|
default:
|
|
3852
4034
|
return state;
|
|
3853
4035
|
}
|
|
@@ -4145,8 +4327,7 @@ var rootReducer = combineReducers({
|
|
|
4145
4327
|
customFields: reducer$5
|
|
4146
4328
|
});
|
|
4147
4329
|
|
|
4148
|
-
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4149
|
-
));
|
|
4330
|
+
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)));
|
|
4150
4331
|
|
|
4151
4332
|
function withStore(Component) {
|
|
4152
4333
|
function WrappedComponent(props) {
|
|
@@ -4245,25 +4426,19 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4245
4426
|
var val = _ref2.val,
|
|
4246
4427
|
index = _ref2.index;
|
|
4247
4428
|
if (val.membership_type === 'flight') {
|
|
4248
|
-
return
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
}
|
|
4260
|
-
|
|
4261
|
-
var _value = _ref3._value;
|
|
4262
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4263
|
-
},
|
|
4264
|
-
loadOption: airlineOptionsfn,
|
|
4265
|
-
placeHolderCheck: !val.name
|
|
4266
|
-
});
|
|
4429
|
+
return (
|
|
4430
|
+
/*#__PURE__*/
|
|
4431
|
+
React.createElement(IUIInput, {
|
|
4432
|
+
label: "Airline name",
|
|
4433
|
+
placeholder: "Enter airline name",
|
|
4434
|
+
fullwidth: false,
|
|
4435
|
+
defaultValue: val.name,
|
|
4436
|
+
onValueChange: function onValueChange(_ref3) {
|
|
4437
|
+
var _value = _ref3._value;
|
|
4438
|
+
return onMemInfoInputChange(index, 'name', _value);
|
|
4439
|
+
}
|
|
4440
|
+
})
|
|
4441
|
+
);
|
|
4267
4442
|
}
|
|
4268
4443
|
if (val.membership_type === 'hotel') {
|
|
4269
4444
|
return /*#__PURE__*/React.createElement(IUIInput, {
|
|
@@ -4695,8 +4870,7 @@ function AddPanelDialog(_ref) {
|
|
|
4695
4870
|
flexDirection: "column",
|
|
4696
4871
|
padding: "8px 20px"
|
|
4697
4872
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4698
|
-
label: name + " name"
|
|
4699
|
-
,
|
|
4873
|
+
label: name + " name",
|
|
4700
4874
|
name: "name",
|
|
4701
4875
|
defaultValue: "",
|
|
4702
4876
|
onValueChange: onValueChange,
|
|
@@ -4745,6 +4919,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4745
4919
|
isILadmin = _useSelector2.isILadmin,
|
|
4746
4920
|
companyName = _useSelector2.companyName;
|
|
4747
4921
|
var history = useHistory();
|
|
4922
|
+
var location = useLocation();
|
|
4748
4923
|
var _useState = useState({
|
|
4749
4924
|
travel: false,
|
|
4750
4925
|
expense: false
|
|
@@ -4780,7 +4955,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4780
4955
|
}
|
|
4781
4956
|
setProductAccess(_productAccess);
|
|
4782
4957
|
};
|
|
4783
|
-
|
|
4784
4958
|
var _useState2 = useState({
|
|
4785
4959
|
first_name: '',
|
|
4786
4960
|
last_name: '',
|
|
@@ -4889,31 +5063,34 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4889
5063
|
var _useState16 = useState([]),
|
|
4890
5064
|
filesForDelete = _useState16[0],
|
|
4891
5065
|
setFilesForDelete = _useState16[1];
|
|
4892
|
-
var _useState17 = useState(
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
var _useState18 = useState('
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
var _useState19 = useState(
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
var _useState20 = useState({
|
|
5066
|
+
var _useState17 = useState([]),
|
|
5067
|
+
profilePicDelete = _useState17[0],
|
|
5068
|
+
setProfilePicDelete = _useState17[1];
|
|
5069
|
+
var _useState18 = useState(config.env.isTravelProduct && isProfile ? 'open' : ''),
|
|
5070
|
+
isAdditionalInfoExpanded = _useState18[0],
|
|
5071
|
+
setAdditionalInfoFlag = _useState18[1];
|
|
5072
|
+
var _useState19 = useState('submitter'),
|
|
5073
|
+
expenseRole = _useState19[0],
|
|
5074
|
+
setExpenseRole = _useState19[1];
|
|
5075
|
+
var _useState20 = useState({}),
|
|
5076
|
+
expenseApproversInput = _useState20[0],
|
|
5077
|
+
setExpenseApproversInput = _useState20[1];
|
|
5078
|
+
var _useState21 = useState({
|
|
4902
5079
|
value: '',
|
|
4903
5080
|
label: 'Select approver'
|
|
4904
5081
|
}),
|
|
4905
|
-
expenseFYI =
|
|
4906
|
-
setExpenseFYI =
|
|
5082
|
+
expenseFYI = _useState21[0],
|
|
5083
|
+
setExpenseFYI = _useState21[1];
|
|
4907
5084
|
var asyncSelectRefs = useRef({
|
|
4908
5085
|
emp_level: useRef(null),
|
|
4909
5086
|
entity: useRef(null),
|
|
4910
5087
|
business_unit: useRef(null),
|
|
4911
5088
|
department: useRef(null)
|
|
4912
5089
|
});
|
|
4913
|
-
var
|
|
4914
|
-
errorArray =
|
|
4915
|
-
setErrorArray =
|
|
4916
|
-
var
|
|
5090
|
+
var _useState22 = useState([]),
|
|
5091
|
+
errorArray = _useState22[0],
|
|
5092
|
+
setErrorArray = _useState22[1];
|
|
5093
|
+
var _useState23 = useState({
|
|
4917
5094
|
first_name: '',
|
|
4918
5095
|
last_name: '',
|
|
4919
5096
|
email: '',
|
|
@@ -4943,9 +5120,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4943
5120
|
userTagType: '',
|
|
4944
5121
|
profile_pic: ''
|
|
4945
5122
|
}),
|
|
4946
|
-
errorMsgs =
|
|
4947
|
-
setErrorMsgs =
|
|
4948
|
-
var
|
|
5123
|
+
errorMsgs = _useState23[0],
|
|
5124
|
+
setErrorMsgs = _useState23[1];
|
|
5125
|
+
var _useState24 = useState({
|
|
4949
5126
|
first_name: false,
|
|
4950
5127
|
last_name: false,
|
|
4951
5128
|
email: false,
|
|
@@ -4972,11 +5149,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4972
5149
|
userTagType: false,
|
|
4973
5150
|
profile_pic: false
|
|
4974
5151
|
}),
|
|
4975
|
-
inputChangeLog =
|
|
4976
|
-
updateInputChangeLog =
|
|
4977
|
-
var
|
|
4978
|
-
uploadedFiles =
|
|
4979
|
-
setUploadedFiles =
|
|
5152
|
+
inputChangeLog = _useState24[0],
|
|
5153
|
+
updateInputChangeLog = _useState24[1];
|
|
5154
|
+
var _useState25 = useState([]),
|
|
5155
|
+
uploadedFiles = _useState25[0],
|
|
5156
|
+
setUploadedFiles = _useState25[1];
|
|
4980
5157
|
var defaultAddModalData = {
|
|
4981
5158
|
isOpen: false,
|
|
4982
5159
|
isError: false,
|
|
@@ -4992,14 +5169,25 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4992
5169
|
maxLength: 70,
|
|
4993
5170
|
minLength: 0
|
|
4994
5171
|
};
|
|
4995
|
-
var
|
|
4996
|
-
addModalData =
|
|
4997
|
-
setAddModalData =
|
|
5172
|
+
var _useState26 = useState(defaultAddModalData),
|
|
5173
|
+
addModalData = _useState26[0],
|
|
5174
|
+
setAddModalData = _useState26[1];
|
|
4998
5175
|
var onAddModalClose = function onAddModalClose() {
|
|
4999
5176
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5000
5177
|
};
|
|
5178
|
+
useEffect(function () {
|
|
5179
|
+
var _location$state, _location$state2;
|
|
5180
|
+
if (location !== null && location !== void 0 && (_location$state = location.state) !== null && _location$state !== void 0 && _location$state.id && location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.name) {
|
|
5181
|
+
var _location$state3, _location$state4;
|
|
5182
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5183
|
+
department: {
|
|
5184
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5185
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5186
|
+
}
|
|
5187
|
+
}));
|
|
5188
|
+
}
|
|
5189
|
+
}, []);
|
|
5001
5190
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5002
|
-
console.log('onModalOpen', e, id);
|
|
5003
5191
|
var title = '';
|
|
5004
5192
|
if (id === 'entity') {
|
|
5005
5193
|
title = 'Entity';
|
|
@@ -5024,23 +5212,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5024
5212
|
}));
|
|
5025
5213
|
} else {
|
|
5026
5214
|
dispatch(showLoader());
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5215
|
+
var dataObj;
|
|
5216
|
+
if (addModalData.id === 'department') {
|
|
5217
|
+
dataObj = {
|
|
5218
|
+
name: validatedValue,
|
|
5219
|
+
department_head_id: null
|
|
5220
|
+
};
|
|
5221
|
+
} else {
|
|
5222
|
+
dataObj = {
|
|
5223
|
+
names: [validatedValue]
|
|
5224
|
+
};
|
|
5225
|
+
}
|
|
5226
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5227
|
+
var _extends4;
|
|
5031
5228
|
setAddModalData(_extends({}, addModalData, {
|
|
5032
5229
|
isOpen: false
|
|
5033
5230
|
}));
|
|
5034
5231
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5035
5232
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5233
|
+
if (addModalData.id === 'department') {
|
|
5234
|
+
var _extends2;
|
|
5235
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5236
|
+
value: res.data.result.id,
|
|
5237
|
+
label: res.data.result.name
|
|
5238
|
+
}, _extends2)));
|
|
5239
|
+
} else {
|
|
5240
|
+
var _extends3;
|
|
5241
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5242
|
+
value: res.data.value,
|
|
5243
|
+
label: res.data.label
|
|
5244
|
+
}, _extends3)));
|
|
5245
|
+
}
|
|
5246
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5040
5247
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5041
5248
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5042
|
-
var
|
|
5043
|
-
return _extends({}, prevState, (
|
|
5249
|
+
var _extends5;
|
|
5250
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5044
5251
|
});
|
|
5045
5252
|
dispatch(stopLoader());
|
|
5046
5253
|
});
|
|
@@ -5057,10 +5264,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5057
5264
|
};
|
|
5058
5265
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5059
5266
|
try {
|
|
5060
|
-
var
|
|
5267
|
+
var _temp5 = function _temp5() {
|
|
5061
5268
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5062
|
-
var
|
|
5063
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5269
|
+
var _extends6;
|
|
5270
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5064
5271
|
}
|
|
5065
5272
|
};
|
|
5066
5273
|
var _name = args._name,
|
|
@@ -5071,7 +5278,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5071
5278
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5072
5279
|
_args$_obj = args._obj,
|
|
5073
5280
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5074
|
-
var
|
|
5281
|
+
var _temp4 = function () {
|
|
5075
5282
|
if (_name === 'contact_number') {
|
|
5076
5283
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5077
5284
|
contact_number: _value.trim(),
|
|
@@ -5082,14 +5289,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5082
5289
|
updateError('country_code', _isError, _errorMsg);
|
|
5083
5290
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5084
5291
|
} else {
|
|
5085
|
-
var
|
|
5086
|
-
var
|
|
5087
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5292
|
+
var _temp3 = function _temp3() {
|
|
5293
|
+
var _extends7;
|
|
5294
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5088
5295
|
updateError(_name, _isError, _errorMsg);
|
|
5089
5296
|
};
|
|
5090
|
-
var
|
|
5297
|
+
var _temp2 = function () {
|
|
5091
5298
|
if (_name === 'profile_pic') {
|
|
5092
|
-
var
|
|
5299
|
+
var _temp = function () {
|
|
5093
5300
|
if (_obj.isUpload) {
|
|
5094
5301
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5095
5302
|
_value = _value.map(function (_val) {
|
|
@@ -5117,31 +5324,35 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5117
5324
|
return result;
|
|
5118
5325
|
});
|
|
5119
5326
|
setUploadedFiles(_uploadedFiles);
|
|
5120
|
-
|
|
5327
|
+
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5121
5328
|
}
|
|
5122
5329
|
}();
|
|
5123
|
-
if (
|
|
5330
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
5124
5331
|
}
|
|
5125
5332
|
}();
|
|
5126
|
-
return
|
|
5333
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
5127
5334
|
}
|
|
5128
5335
|
}();
|
|
5129
|
-
return Promise.resolve(
|
|
5336
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
|
5130
5337
|
} catch (e) {
|
|
5131
5338
|
return Promise.reject(e);
|
|
5132
5339
|
}
|
|
5133
5340
|
};
|
|
5134
5341
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5135
|
-
var
|
|
5342
|
+
var _extends8;
|
|
5136
5343
|
var _name = args._name,
|
|
5137
5344
|
_value = args._value,
|
|
5138
5345
|
_isError = args._isError,
|
|
5139
5346
|
_errorMsg = args._errorMsg;
|
|
5140
|
-
|
|
5347
|
+
console.log({
|
|
5348
|
+
_name: _name,
|
|
5349
|
+
_value: _value
|
|
5350
|
+
});
|
|
5351
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5141
5352
|
updateError(_name, _isError, _errorMsg);
|
|
5142
5353
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5143
|
-
var
|
|
5144
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5354
|
+
var _extends9;
|
|
5355
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5145
5356
|
}
|
|
5146
5357
|
};
|
|
5147
5358
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5151,9 +5362,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5151
5362
|
return tag.id;
|
|
5152
5363
|
};
|
|
5153
5364
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5154
|
-
var
|
|
5365
|
+
var _extends10;
|
|
5155
5366
|
var e = args._event;
|
|
5156
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5367
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5157
5368
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5158
5369
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5159
5370
|
userTagType: true
|
|
@@ -5161,30 +5372,27 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5161
5372
|
}
|
|
5162
5373
|
};
|
|
5163
5374
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5164
|
-
var
|
|
5375
|
+
var _extends11;
|
|
5165
5376
|
var _name = _ref2._name,
|
|
5166
5377
|
_value = _ref2._value;
|
|
5167
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5378
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5168
5379
|
};
|
|
5169
5380
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5170
|
-
var
|
|
5381
|
+
var _extends12;
|
|
5171
5382
|
var _name = _ref3._name,
|
|
5172
5383
|
_value = _ref3._value;
|
|
5173
|
-
|
|
5384
|
+
console.log(_name, _value, 'travel');
|
|
5385
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5174
5386
|
};
|
|
5175
5387
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5176
|
-
var
|
|
5388
|
+
var _extends13;
|
|
5177
5389
|
var _name = _ref4._name,
|
|
5178
5390
|
_value = _ref4._value;
|
|
5179
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5391
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5180
5392
|
};
|
|
5181
5393
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5182
5394
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
5183
|
-
|
|
5184
|
-
_membershipInfoInput[index][key] = val.label;
|
|
5185
|
-
} else {
|
|
5186
|
-
_membershipInfoInput[index][key] = val;
|
|
5187
|
-
}
|
|
5395
|
+
_membershipInfoInput[index][key] = val;
|
|
5188
5396
|
_membershipInfoInput[index].isEditMode = isEditMode;
|
|
5189
5397
|
setMembershipInfoInput(_membershipInfoInput);
|
|
5190
5398
|
};
|
|
@@ -5214,39 +5422,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5214
5422
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5215
5423
|
};
|
|
5216
5424
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5217
|
-
var
|
|
5425
|
+
var _extends14;
|
|
5218
5426
|
var _name = args._name,
|
|
5219
5427
|
_value = args._value,
|
|
5220
5428
|
_isError = args._isError,
|
|
5221
5429
|
_errorMsg = args._errorMsg;
|
|
5222
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5430
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5223
5431
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5224
|
-
var
|
|
5225
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5432
|
+
var _extends15;
|
|
5433
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5226
5434
|
}
|
|
5227
5435
|
updateError(_name, _isError, _errorMsg);
|
|
5228
5436
|
};
|
|
5229
5437
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5230
|
-
var
|
|
5438
|
+
var _extends16;
|
|
5231
5439
|
var _name = args._name,
|
|
5232
5440
|
_value = args._value,
|
|
5233
5441
|
_isError = args._isError,
|
|
5234
5442
|
_errorMsg = args._errorMsg;
|
|
5235
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5443
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5236
5444
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5237
|
-
var
|
|
5238
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5445
|
+
var _extends17;
|
|
5446
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5239
5447
|
}
|
|
5240
5448
|
updateError(_name, _isError, _errorMsg);
|
|
5241
5449
|
};
|
|
5242
5450
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5243
5451
|
try {
|
|
5244
|
-
var
|
|
5245
|
-
var
|
|
5246
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5452
|
+
var _temp8 = function _temp8() {
|
|
5453
|
+
var _extends18;
|
|
5454
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5247
5455
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5248
|
-
var
|
|
5249
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5456
|
+
var _extends19;
|
|
5457
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5250
5458
|
}
|
|
5251
5459
|
updateError(_name, _isError, _errorMsg);
|
|
5252
5460
|
};
|
|
@@ -5284,9 +5492,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5284
5492
|
}
|
|
5285
5493
|
return Promise.resolve();
|
|
5286
5494
|
}
|
|
5287
|
-
var
|
|
5495
|
+
var _temp7 = function () {
|
|
5288
5496
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5289
|
-
var
|
|
5497
|
+
var _temp6 = function () {
|
|
5290
5498
|
if (_obj.isUpload) {
|
|
5291
5499
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5292
5500
|
if (_name === 'passport_photo') {
|
|
@@ -5330,10 +5538,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5330
5538
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5331
5539
|
}
|
|
5332
5540
|
}();
|
|
5333
|
-
if (
|
|
5541
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
5334
5542
|
}
|
|
5335
5543
|
}();
|
|
5336
|
-
return Promise.resolve(
|
|
5544
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
|
|
5337
5545
|
} catch (e) {
|
|
5338
5546
|
return Promise.reject(e);
|
|
5339
5547
|
}
|
|
@@ -5352,8 +5560,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5352
5560
|
return _errorArray;
|
|
5353
5561
|
});
|
|
5354
5562
|
setErrorMsgs(function (prevState) {
|
|
5355
|
-
var
|
|
5356
|
-
return _extends({}, prevState, (
|
|
5563
|
+
var _extends20;
|
|
5564
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5357
5565
|
});
|
|
5358
5566
|
};
|
|
5359
5567
|
var dispatch = useDispatch();
|
|
@@ -5612,7 +5820,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5612
5820
|
required: true
|
|
5613
5821
|
}
|
|
5614
5822
|
}));
|
|
5615
|
-
|
|
5616
5823
|
var _productAccess = _extends({}, productAccess);
|
|
5617
5824
|
renderFields.products.forEach(function (product) {
|
|
5618
5825
|
_productAccess[product.name] = true;
|
|
@@ -5660,7 +5867,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5660
5867
|
}, [renderFields.expenseApprovers]);
|
|
5661
5868
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5662
5869
|
try {
|
|
5663
|
-
var
|
|
5870
|
+
var _temp10 = function _temp10() {
|
|
5664
5871
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5665
5872
|
dispatch(stopLoader());
|
|
5666
5873
|
return data;
|
|
@@ -5676,12 +5883,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5676
5883
|
userID: editUserId
|
|
5677
5884
|
});
|
|
5678
5885
|
});
|
|
5679
|
-
var
|
|
5886
|
+
var _temp9 = _forTo(docs, function (i) {
|
|
5680
5887
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5681
5888
|
data.push(res);
|
|
5682
5889
|
});
|
|
5683
5890
|
});
|
|
5684
|
-
return Promise.resolve(
|
|
5891
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9));
|
|
5685
5892
|
} catch (e) {
|
|
5686
5893
|
return Promise.reject(e);
|
|
5687
5894
|
}
|
|
@@ -5710,9 +5917,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5710
5917
|
expenseFYI: expenseFYI,
|
|
5711
5918
|
uploadedFiles: uploadedFiles,
|
|
5712
5919
|
filesForDelete: filesForDelete,
|
|
5920
|
+
profilePicDelete: profilePicDelete,
|
|
5713
5921
|
userTagType: userTagType
|
|
5714
5922
|
};
|
|
5715
|
-
if (verifyUserId
|
|
5923
|
+
if (verifyUserId) {
|
|
5716
5924
|
payload.verifyUserId = verifyUserId;
|
|
5717
5925
|
}
|
|
5718
5926
|
var _errorArray = [].concat(errorArray);
|
|
@@ -5808,8 +6016,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5808
6016
|
}
|
|
5809
6017
|
_errorMsgs.passport_issue_date = '';
|
|
5810
6018
|
}
|
|
5811
|
-
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false &&
|
|
5812
|
-
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
6019
|
+
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false && fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
5813
6020
|
_isError = true;
|
|
5814
6021
|
if (_errorArray.indexOf('passport_photo') === -1) {
|
|
5815
6022
|
_errorArray.push('passport_photo');
|
|
@@ -5821,8 +6028,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5821
6028
|
}
|
|
5822
6029
|
_errorMsgs.passport_photo = '';
|
|
5823
6030
|
}
|
|
5824
|
-
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false &&
|
|
5825
|
-
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
6031
|
+
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false && fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
5826
6032
|
_isError = true;
|
|
5827
6033
|
if (_errorArray.indexOf('travel_docs') === -1) {
|
|
5828
6034
|
_errorArray.push('travel_docs');
|
|
@@ -5838,27 +6044,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5838
6044
|
if (_isError) {
|
|
5839
6045
|
setErrorArray(_errorArray);
|
|
5840
6046
|
setErrorMsgs(_errorMsgs);
|
|
5841
|
-
|
|
6047
|
+
var _loop = function _loop() {
|
|
5842
6048
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
5843
6049
|
if (_errorMsgs[_key3]) {
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
}
|
|
5858
|
-
}();
|
|
5859
|
-
if (_ret === "break") break;
|
|
6050
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
6051
|
+
setAdditionalInfoFlag('open');
|
|
6052
|
+
}
|
|
6053
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
6054
|
+
if (el) {
|
|
6055
|
+
setTimeout(function () {
|
|
6056
|
+
el.scrollIntoView({
|
|
6057
|
+
behavior: 'smooth',
|
|
6058
|
+
block: 'center'
|
|
6059
|
+
});
|
|
6060
|
+
}, 500);
|
|
6061
|
+
return "break";
|
|
6062
|
+
}
|
|
5860
6063
|
}
|
|
5861
6064
|
}
|
|
6065
|
+
};
|
|
6066
|
+
for (var _key3 in _errorMsgs) {
|
|
6067
|
+
var _ret = _loop();
|
|
6068
|
+
if (_ret === "break") break;
|
|
5862
6069
|
}
|
|
5863
6070
|
return Promise.resolve();
|
|
5864
6071
|
}
|
|
@@ -5872,6 +6079,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5872
6079
|
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5873
6080
|
(config === null || config === void 0 ? void 0 : (_config$routes2 = config.routes) === null || _config$routes2 === void 0 ? void 0 : (_config$routes2$users = _config$routes2.users) === null || _config$routes2$users === void 0 ? void 0 : (_config$routes2$users2 = _config$routes2$users.list) === null || _config$routes2$users2 === void 0 ? void 0 : _config$routes2$users2.path) && history.push(config.routes.users.list.path);
|
|
5874
6081
|
}
|
|
6082
|
+
setFilesForDelete([]);
|
|
6083
|
+
setProfilePicDelete([]);
|
|
5875
6084
|
})["catch"](function (err) {
|
|
5876
6085
|
if (typeof err === 'object') {
|
|
5877
6086
|
if (err.country_code) {
|
|
@@ -5886,27 +6095,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5886
6095
|
}
|
|
5887
6096
|
setErrorArray(Object.keys(err));
|
|
5888
6097
|
setErrorMsgs(err);
|
|
5889
|
-
|
|
6098
|
+
var _loop2 = function _loop2() {
|
|
5890
6099
|
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5891
6100
|
if (err[_key4]) {
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
}
|
|
5906
|
-
}();
|
|
5907
|
-
if (_ret2 === "break") break;
|
|
6101
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6102
|
+
setAdditionalInfoFlag('open');
|
|
6103
|
+
}
|
|
6104
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6105
|
+
if (el) {
|
|
6106
|
+
setTimeout(function () {
|
|
6107
|
+
el.scrollIntoView({
|
|
6108
|
+
behavior: 'smooth',
|
|
6109
|
+
block: 'center'
|
|
6110
|
+
});
|
|
6111
|
+
}, 500);
|
|
6112
|
+
return "break";
|
|
6113
|
+
}
|
|
5908
6114
|
}
|
|
5909
6115
|
}
|
|
6116
|
+
};
|
|
6117
|
+
for (var _key4 in err) {
|
|
6118
|
+
var _ret2 = _loop2();
|
|
6119
|
+
if (_ret2 === "break") break;
|
|
5910
6120
|
}
|
|
5911
6121
|
} else if (typeof err === 'string') {
|
|
5912
6122
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -5935,27 +6145,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5935
6145
|
}
|
|
5936
6146
|
setErrorArray(Object.keys(err));
|
|
5937
6147
|
setErrorMsgs(err);
|
|
5938
|
-
|
|
6148
|
+
var _loop3 = function _loop3() {
|
|
5939
6149
|
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
5940
6150
|
if (err[_key5]) {
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
}
|
|
5955
|
-
}();
|
|
5956
|
-
if (_ret3 === "break") break;
|
|
6151
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6152
|
+
setAdditionalInfoFlag('open');
|
|
6153
|
+
}
|
|
6154
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6155
|
+
if (el) {
|
|
6156
|
+
setTimeout(function () {
|
|
6157
|
+
el.scrollIntoView({
|
|
6158
|
+
behavior: 'smooth',
|
|
6159
|
+
block: 'center'
|
|
6160
|
+
});
|
|
6161
|
+
}, 500);
|
|
6162
|
+
return "break";
|
|
6163
|
+
}
|
|
5957
6164
|
}
|
|
5958
6165
|
}
|
|
6166
|
+
};
|
|
6167
|
+
for (var _key5 in err) {
|
|
6168
|
+
var _ret3 = _loop3();
|
|
6169
|
+
if (_ret3 === "break") break;
|
|
5959
6170
|
}
|
|
5960
6171
|
} else if (typeof err === 'string') {
|
|
5961
6172
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -5980,12 +6191,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5980
6191
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
5981
6192
|
}
|
|
5982
6193
|
}
|
|
5983
|
-
} else if (verifyUserId && isILadmin) {
|
|
5984
|
-
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
5985
|
-
(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);
|
|
5986
6194
|
} else {
|
|
5987
|
-
var _config$
|
|
5988
|
-
(config === null || config === void 0 ? void 0 : (_config$
|
|
6195
|
+
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
6196
|
+
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$users = _config$routes4.users) === null || _config$routes4$users === void 0 ? void 0 : (_config$routes4$users2 = _config$routes4$users.list) === null || _config$routes4$users2 === void 0 ? void 0 : _config$routes4$users2.path) && history.push(config.routes.users.list.path);
|
|
5989
6197
|
}
|
|
5990
6198
|
};
|
|
5991
6199
|
var handleCustomFieldsNavigation = function handleCustomFieldsNavigation() {
|
|
@@ -6002,7 +6210,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6002
6210
|
return false;
|
|
6003
6211
|
};
|
|
6004
6212
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
6005
|
-
if (verifyUserId
|
|
6213
|
+
if (verifyUserId) {
|
|
6006
6214
|
dispatch(showLoader());
|
|
6007
6215
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6008
6216
|
setPersonalInfoInput(function (prevState) {
|
|
@@ -6016,7 +6224,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6016
6224
|
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6017
6225
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6018
6226
|
}(),
|
|
6019
|
-
|
|
6020
6227
|
gender: function () {
|
|
6021
6228
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6022
6229
|
}()
|
|
@@ -6061,7 +6268,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6061
6268
|
}()
|
|
6062
6269
|
});
|
|
6063
6270
|
});
|
|
6064
|
-
|
|
6065
6271
|
if (res.client_admin) {
|
|
6066
6272
|
setTravelApproversInput(function (prevState) {
|
|
6067
6273
|
var nextState = _extends({}, prevState);
|
|
@@ -6095,18 +6301,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6095
6301
|
});
|
|
6096
6302
|
}
|
|
6097
6303
|
};
|
|
6098
|
-
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
6099
|
-
if (verifyUserId && isILadmin) {
|
|
6100
|
-
dispatch(showLoader());
|
|
6101
|
-
dispatch(rejectUserVerification(verifyUserId)).then(function (res) {
|
|
6102
|
-
setTimeout(function () {
|
|
6103
|
-
window.location.assign(config.routes.signupRequest.list.path);
|
|
6104
|
-
}, 1500);
|
|
6105
|
-
})["finally"](function () {
|
|
6106
|
-
dispatch(stopLoader());
|
|
6107
|
-
});
|
|
6108
|
-
}
|
|
6109
|
-
};
|
|
6110
6304
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
6111
6305
|
component: "div",
|
|
6112
6306
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6123,7 +6317,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6123
6317
|
className: styles.breadcrumb
|
|
6124
6318
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
6125
6319
|
breadCrumbs: [{
|
|
6126
|
-
href:
|
|
6320
|
+
href: config.routes.users.list.path,
|
|
6127
6321
|
label: 'Users',
|
|
6128
6322
|
hasLink: true
|
|
6129
6323
|
}]
|
|
@@ -6158,14 +6352,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6158
6352
|
type: "contained",
|
|
6159
6353
|
onClick: formSubmitHandler,
|
|
6160
6354
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
6161
|
-
})),
|
|
6162
|
-
component: "div",
|
|
6163
|
-
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
6164
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
6165
|
-
buttonText: "Reject",
|
|
6166
|
-
type: "outlined",
|
|
6167
|
-
onClick: handleSignUpRequestRejection
|
|
6168
|
-
})) : null))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
6355
|
+
}))))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
6169
6356
|
component: "div",
|
|
6170
6357
|
marginTop: "8rem",
|
|
6171
6358
|
flexDirection: "column"
|
|
@@ -6199,6 +6386,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6199
6386
|
if (!p.visibility) {
|
|
6200
6387
|
return null;
|
|
6201
6388
|
}
|
|
6389
|
+
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6390
|
+
return null;
|
|
6391
|
+
}
|
|
6202
6392
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6203
6393
|
item: true,
|
|
6204
6394
|
sm: 12,
|
|
@@ -6351,6 +6541,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6351
6541
|
addFields: function addFields() {
|
|
6352
6542
|
return dispatch(addTravelApproverField());
|
|
6353
6543
|
},
|
|
6544
|
+
addManager: function addManager() {
|
|
6545
|
+
return dispatch(addManagerApproverField);
|
|
6546
|
+
},
|
|
6354
6547
|
onRoleChange: function onRoleChange(_ref5) {
|
|
6355
6548
|
var _value = _ref5._value;
|
|
6356
6549
|
return setTravelRole(_value);
|
|
@@ -6392,6 +6585,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6392
6585
|
addFields: function addFields() {
|
|
6393
6586
|
return dispatch(addExpenseApproverField());
|
|
6394
6587
|
},
|
|
6588
|
+
addManager: function addManager() {
|
|
6589
|
+
return dispatch(addManagerApproverField);
|
|
6590
|
+
},
|
|
6395
6591
|
onRoleChange: function onRoleChange(_ref6) {
|
|
6396
6592
|
var _value = _ref6._value;
|
|
6397
6593
|
return setExpenseRole(_value);
|
|
@@ -6571,17 +6767,13 @@ var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
|
6571
6767
|
});
|
|
6572
6768
|
};
|
|
6573
6769
|
};
|
|
6574
|
-
|
|
6575
6770
|
var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
6576
6771
|
return new Promise(function (resolve, reject) {
|
|
6577
6772
|
var formData = new FormData();
|
|
6578
|
-
|
|
6579
6773
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
6580
6774
|
formData.append(key, presignedPostData.fields[key]);
|
|
6581
6775
|
});
|
|
6582
|
-
|
|
6583
6776
|
formData.append('file', file);
|
|
6584
|
-
|
|
6585
6777
|
axios.post(presignedPostData.url, formData, {
|
|
6586
6778
|
headers: {
|
|
6587
6779
|
'Content-Type': 'multipart/form-data'
|
|
@@ -6698,7 +6890,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6698
6890
|
};
|
|
6699
6891
|
};
|
|
6700
6892
|
|
|
6701
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4"};
|
|
6893
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltipTextDiv":"_1l4V-","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","warningSvg":"_2H6Bq","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn","deactivateSubmitBtn":"_1qxY-","deactivateCustomButtonClass":"_2YBWE"};
|
|
6702
6894
|
|
|
6703
6895
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6704
6896
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -6767,7 +6959,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6767
6959
|
file: doc
|
|
6768
6960
|
});
|
|
6769
6961
|
});
|
|
6770
|
-
var
|
|
6962
|
+
var _temp = _forTo(docs, function (i) {
|
|
6771
6963
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6772
6964
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6773
6965
|
if (validatedRes.data.status) {
|
|
@@ -6807,7 +6999,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6807
6999
|
})).then(function () {});
|
|
6808
7000
|
});
|
|
6809
7001
|
});
|
|
6810
|
-
return Promise.resolve(
|
|
7002
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
6811
7003
|
} catch (e) {
|
|
6812
7004
|
return Promise.reject(e);
|
|
6813
7005
|
}
|
|
@@ -6982,7 +7174,6 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
6982
7174
|
setOpenImportUsersModal(false);
|
|
6983
7175
|
handleImportPagenavigation(jobId);
|
|
6984
7176
|
};
|
|
6985
|
-
|
|
6986
7177
|
var handleDownloadRecords = function handleDownloadRecords(type) {
|
|
6987
7178
|
try {
|
|
6988
7179
|
setDownlStatus(true);
|
|
@@ -7958,6 +8149,120 @@ var BulkDownloadIcon = function BulkDownloadIcon(props) {
|
|
|
7958
8149
|
}));
|
|
7959
8150
|
};
|
|
7960
8151
|
|
|
8152
|
+
var classes = {"containedBtn":"_2A4_u","customMiniBox":"_QGIKG","muiBtn":"_3iFbO","outlinedBtn":"_3lQYD","menuList":"_1C8bJ","menuListContainer":"_1N83W","menuItemContainer":"_3VtcE","menuItemtext":"_2xqnU","subTxt":"_3CVzX"};
|
|
8153
|
+
|
|
8154
|
+
var DropdownBtn = function DropdownBtn(props) {
|
|
8155
|
+
var _clsx;
|
|
8156
|
+
var _props$buttonText = props.buttonText,
|
|
8157
|
+
buttonText = _props$buttonText === void 0 ? '' : _props$buttonText,
|
|
8158
|
+
_props$disableRipple = props.disableRipple,
|
|
8159
|
+
disableRipple = _props$disableRipple === void 0 ? true : _props$disableRipple,
|
|
8160
|
+
_props$onClickHandler = props.onClickHandler,
|
|
8161
|
+
onClickHandler = _props$onClickHandler === void 0 ? function () {} : _props$onClickHandler,
|
|
8162
|
+
_props$menuListInfo = props.menuListInfo,
|
|
8163
|
+
menuListInfo = _props$menuListInfo === void 0 ? [] : _props$menuListInfo,
|
|
8164
|
+
_props$endIcon = props.endIcon,
|
|
8165
|
+
endIcon = _props$endIcon === void 0 ? /*#__PURE__*/React.createElement(ExpandMoreIcon, {
|
|
8166
|
+
width: "10",
|
|
8167
|
+
height: "10"
|
|
8168
|
+
}) : _props$endIcon,
|
|
8169
|
+
_props$outlinedBtn = props.outlinedBtn,
|
|
8170
|
+
outlinedBtn = _props$outlinedBtn === void 0 ? true : _props$outlinedBtn,
|
|
8171
|
+
_props$placement = props.placement,
|
|
8172
|
+
placement = _props$placement === void 0 ? 'auto-center' : _props$placement,
|
|
8173
|
+
className = props.className,
|
|
8174
|
+
menuListClass = props.menuListClass;
|
|
8175
|
+
var _React$useState = React.useState(false),
|
|
8176
|
+
open = _React$useState[0],
|
|
8177
|
+
setOpen = _React$useState[1];
|
|
8178
|
+
var anchorRef = React.useRef(null);
|
|
8179
|
+
var handleToggle = function handleToggle() {
|
|
8180
|
+
setOpen(function (prevOpen) {
|
|
8181
|
+
return !prevOpen;
|
|
8182
|
+
});
|
|
8183
|
+
};
|
|
8184
|
+
var handleClose = function handleClose(event) {
|
|
8185
|
+
if (anchorRef.current && anchorRef.current.contains(event.target)) {
|
|
8186
|
+
return;
|
|
8187
|
+
}
|
|
8188
|
+
setOpen(false);
|
|
8189
|
+
onClickHandler(event);
|
|
8190
|
+
};
|
|
8191
|
+
var handleListKeyDown = function handleListKeyDown(event) {
|
|
8192
|
+
if (event.key === 'Tab') {
|
|
8193
|
+
event.preventDefault();
|
|
8194
|
+
setOpen(false);
|
|
8195
|
+
}
|
|
8196
|
+
};
|
|
8197
|
+
var handleMenuClick = function handleMenuClick(val) {
|
|
8198
|
+
setOpen(false);
|
|
8199
|
+
if (val.disable) return false;
|
|
8200
|
+
if (val.handler && typeof val.handler === 'function') val.handler();
|
|
8201
|
+
};
|
|
8202
|
+
var prevOpen = React.useRef(open);
|
|
8203
|
+
React.useEffect(function () {
|
|
8204
|
+
if (prevOpen.current === true && open === false) {
|
|
8205
|
+
anchorRef.current.focus();
|
|
8206
|
+
}
|
|
8207
|
+
prevOpen.current = open;
|
|
8208
|
+
}, [open]);
|
|
8209
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
8210
|
+
endIcon: endIcon,
|
|
8211
|
+
className: clsx(classes.muiBtn, className, (_clsx = {}, _clsx[classes.outlinedBtn] = outlinedBtn, _clsx)),
|
|
8212
|
+
disableRipple: disableRipple,
|
|
8213
|
+
variant: "outlined",
|
|
8214
|
+
ref: anchorRef,
|
|
8215
|
+
"aria-controls": open ? 'menu-list-grow' : undefined,
|
|
8216
|
+
"aria-haspopup": "true",
|
|
8217
|
+
onClick: handleToggle
|
|
8218
|
+
}, buttonText), /*#__PURE__*/React.createElement(Popper, {
|
|
8219
|
+
open: open,
|
|
8220
|
+
anchorEl: anchorRef.current,
|
|
8221
|
+
role: undefined,
|
|
8222
|
+
transition: true,
|
|
8223
|
+
disablePortal: true,
|
|
8224
|
+
style: {
|
|
8225
|
+
zIndex: '9'
|
|
8226
|
+
},
|
|
8227
|
+
placement: placement
|
|
8228
|
+
}, function (_ref) {
|
|
8229
|
+
var _clsx2;
|
|
8230
|
+
var TransitionProps = _ref.TransitionProps,
|
|
8231
|
+
placement = _ref.placement;
|
|
8232
|
+
return /*#__PURE__*/React.createElement(Grow, _extends({}, TransitionProps, {
|
|
8233
|
+
style: {
|
|
8234
|
+
transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
|
|
8235
|
+
}
|
|
8236
|
+
}), /*#__PURE__*/React.createElement(Paper, {
|
|
8237
|
+
className: classes.menuListContainer,
|
|
8238
|
+
elevation: 0
|
|
8239
|
+
}, /*#__PURE__*/React.createElement(ClickAwayListener, {
|
|
8240
|
+
onClickAway: handleClose
|
|
8241
|
+
}, /*#__PURE__*/React.createElement(MenuList, {
|
|
8242
|
+
autoFocusItem: open,
|
|
8243
|
+
className: clsx(classes.menuList, (_clsx2 = {}, _clsx2[classes.outlinedBtn] = outlinedBtn, _clsx2), menuListClass),
|
|
8244
|
+
id: "menu-list-grow",
|
|
8245
|
+
onKeyDown: function onKeyDown(e) {
|
|
8246
|
+
return handleListKeyDown(e);
|
|
8247
|
+
}
|
|
8248
|
+
}, menuListInfo.map(function (val, _i) {
|
|
8249
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
8250
|
+
onClick: function onClick() {
|
|
8251
|
+
return handleMenuClick(val);
|
|
8252
|
+
},
|
|
8253
|
+
key: _i,
|
|
8254
|
+
className: clsx(classes.menuItemContainer, val.disable && 'iui__cursor-not-allowed'),
|
|
8255
|
+
disableRipple: true
|
|
8256
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
8257
|
+
className: clsx(classes.menuItemtext, val && val.disable && 'iui__opacity--60')
|
|
8258
|
+
}, val.label), val.subText && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8259
|
+
variant: "subtitle2",
|
|
8260
|
+
className: clsx(classes.menuItemtext, classes.subTxt)
|
|
8261
|
+
}, val.subText));
|
|
8262
|
+
})))));
|
|
8263
|
+
}));
|
|
8264
|
+
};
|
|
8265
|
+
|
|
7961
8266
|
var AntSwitch = withStyles(function (theme) {
|
|
7962
8267
|
return {
|
|
7963
8268
|
root: {
|
|
@@ -8008,6 +8313,10 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8008
8313
|
selected = props.selected,
|
|
8009
8314
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8010
8315
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8316
|
+
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8317
|
+
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8318
|
+
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8319
|
+
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8011
8320
|
orderBy = props.orderBy,
|
|
8012
8321
|
order = props.order,
|
|
8013
8322
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8016,11 +8325,30 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8016
8325
|
onSearchHandler = _props$onSearchHandle === void 0 ? function () {} : _props$onSearchHandle,
|
|
8017
8326
|
_props$onEditHandler = props.onEditHandler,
|
|
8018
8327
|
onEditHandler = _props$onEditHandler === void 0 ? function () {} : _props$onEditHandler,
|
|
8328
|
+
_props$onPrimaryAdmin = props.onPrimaryAdminHandler,
|
|
8329
|
+
onPrimaryAdminHandler = _props$onPrimaryAdmin === void 0 ? function () {} : _props$onPrimaryAdmin,
|
|
8019
8330
|
_props$isDataFetching = props.isDataFetching,
|
|
8020
8331
|
isDataFetching = _props$isDataFetching === void 0 ? false : _props$isDataFetching,
|
|
8021
8332
|
_props$disableRowChec = props.disableRowCheckbox,
|
|
8022
8333
|
disableRowCheckbox = _props$disableRowChec === void 0 ? false : _props$disableRowChec,
|
|
8023
|
-
searchValue = props.searchValue
|
|
8334
|
+
searchValue = props.searchValue,
|
|
8335
|
+
_props$isILadmin = props.isILadmin,
|
|
8336
|
+
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8337
|
+
var useStyles = makeStyles(function (theme) {
|
|
8338
|
+
return {
|
|
8339
|
+
tooltip: {
|
|
8340
|
+
background: '#1F2937',
|
|
8341
|
+
fontSize: '14px',
|
|
8342
|
+
color: '#ffffff',
|
|
8343
|
+
padding: '12px 16px',
|
|
8344
|
+
borderRadius: '6px'
|
|
8345
|
+
},
|
|
8346
|
+
arrow: {
|
|
8347
|
+
color: '#1F2937'
|
|
8348
|
+
}
|
|
8349
|
+
};
|
|
8350
|
+
});
|
|
8351
|
+
var classes = useStyles();
|
|
8024
8352
|
var columns = [{
|
|
8025
8353
|
id: 'first_name',
|
|
8026
8354
|
label: 'Name',
|
|
@@ -8031,8 +8359,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8031
8359
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
8032
8360
|
firstName: row.first_name,
|
|
8033
8361
|
lastName: row.last_name,
|
|
8034
|
-
isLetterAvatar:
|
|
8035
|
-
row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8362
|
+
isLetterAvatar: !(row.profile_pic && row.profile_pic.presigned_url),
|
|
8036
8363
|
primaryText: row.first_name + ' ' + row.last_name,
|
|
8037
8364
|
secondaryText: row.email,
|
|
8038
8365
|
letterAvatarTextColor: "black",
|
|
@@ -8041,10 +8368,31 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8041
8368
|
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic = row.profile_pic) === null || _row$profile_pic === void 0 ? void 0 : _row$profile_pic.presigned_url
|
|
8042
8369
|
}));
|
|
8043
8370
|
}
|
|
8371
|
+
}, {
|
|
8372
|
+
id: 'first_name',
|
|
8373
|
+
label: '',
|
|
8374
|
+
minWidth: 60,
|
|
8375
|
+
sortable: false,
|
|
8376
|
+
cell: function cell(row) {
|
|
8377
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8378
|
+
component: "div",
|
|
8379
|
+
width: 80
|
|
8380
|
+
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8381
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8382
|
+
arrow: true,
|
|
8383
|
+
classes: {
|
|
8384
|
+
arrow: classes.arrow,
|
|
8385
|
+
tooltip: classes.tooltip
|
|
8386
|
+
},
|
|
8387
|
+
placement: "top-start"
|
|
8388
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8389
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8390
|
+
}, "Invited")) : null);
|
|
8391
|
+
}
|
|
8044
8392
|
}, {
|
|
8045
8393
|
id: 'emp_info__department__name',
|
|
8046
8394
|
label: 'Department',
|
|
8047
|
-
minWidth:
|
|
8395
|
+
minWidth: 80,
|
|
8048
8396
|
sortable: true,
|
|
8049
8397
|
cell: function cell(row) {
|
|
8050
8398
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -8057,7 +8405,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8057
8405
|
}, {
|
|
8058
8406
|
id: 'productusermapping__role',
|
|
8059
8407
|
label: 'Product roles',
|
|
8060
|
-
minWidth:
|
|
8408
|
+
minWidth: 125,
|
|
8061
8409
|
sortable: true,
|
|
8062
8410
|
cell: function cell(row) {
|
|
8063
8411
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -8093,7 +8441,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8093
8441
|
}, {
|
|
8094
8442
|
id: 'status',
|
|
8095
8443
|
label: 'Status',
|
|
8096
|
-
minWidth:
|
|
8444
|
+
minWidth: 160,
|
|
8097
8445
|
cell: function cell(row) {
|
|
8098
8446
|
return /*#__PURE__*/React.createElement(IUIFormGroup, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8099
8447
|
component: "div",
|
|
@@ -8119,15 +8467,55 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8119
8467
|
}, {
|
|
8120
8468
|
id: 'actions',
|
|
8121
8469
|
label: 'Actions',
|
|
8122
|
-
minWidth:
|
|
8470
|
+
minWidth: 70,
|
|
8123
8471
|
align: 'left',
|
|
8124
8472
|
cell: function cell(row) {
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8473
|
+
var options = [{
|
|
8474
|
+
label: 'Edit details',
|
|
8475
|
+
handler: function handler() {
|
|
8128
8476
|
return onEditHandler(row.id);
|
|
8129
8477
|
}
|
|
8130
|
-
}
|
|
8478
|
+
}];
|
|
8479
|
+
if (row && row.has_visited && row.is_active) {
|
|
8480
|
+
options.push({
|
|
8481
|
+
label: 'Reset password',
|
|
8482
|
+
handler: function handler() {
|
|
8483
|
+
return onResetPasswordHandler(row.email);
|
|
8484
|
+
}
|
|
8485
|
+
});
|
|
8486
|
+
} else if (row && row.is_active) {
|
|
8487
|
+
options.push({
|
|
8488
|
+
label: 'Resend invite',
|
|
8489
|
+
handler: function handler() {
|
|
8490
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8491
|
+
}
|
|
8492
|
+
});
|
|
8493
|
+
}
|
|
8494
|
+
if (isILadmin) {
|
|
8495
|
+
options.push({
|
|
8496
|
+
label: 'Make primary admin',
|
|
8497
|
+
handler: function handler() {
|
|
8498
|
+
return onPrimaryAdminHandler(row.id);
|
|
8499
|
+
}
|
|
8500
|
+
});
|
|
8501
|
+
}
|
|
8502
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8503
|
+
style: {
|
|
8504
|
+
marginLeft: '50px'
|
|
8505
|
+
}
|
|
8506
|
+
}, /*#__PURE__*/React.createElement(DropdownBtn, {
|
|
8507
|
+
buttonText: /*#__PURE__*/React.createElement(MoreHorizIcon, {
|
|
8508
|
+
fontSize: "medium",
|
|
8509
|
+
color: "#6B7280"
|
|
8510
|
+
}),
|
|
8511
|
+
disableRipple: false,
|
|
8512
|
+
menuListInfo: options,
|
|
8513
|
+
menuListClass: "menuClass",
|
|
8514
|
+
endIcon: null,
|
|
8515
|
+
outlinedBtn: false,
|
|
8516
|
+
className: "threedotMenuBtn",
|
|
8517
|
+
placement: "bottom-end"
|
|
8518
|
+
}));
|
|
8131
8519
|
},
|
|
8132
8520
|
style: {
|
|
8133
8521
|
paddingLeft: '40px'
|
|
@@ -8155,6 +8543,118 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8155
8543
|
isDataFetching: isDataFetching,
|
|
8156
8544
|
disableRowCheckbox: disableRowCheckbox,
|
|
8157
8545
|
searchBoxWidth: "400px",
|
|
8546
|
+
searchValue: searchValue,
|
|
8547
|
+
hideTopPagination: false
|
|
8548
|
+
});
|
|
8549
|
+
};
|
|
8550
|
+
var SingupRequests = function SingupRequests(props) {
|
|
8551
|
+
var data = props.data,
|
|
8552
|
+
_props$handleChangeRo2 = props.handleChangeRowsPerPage,
|
|
8553
|
+
handleChangeRowsPerPage = _props$handleChangeRo2 === void 0 ? function () {} : _props$handleChangeRo2,
|
|
8554
|
+
handleChangePage = props.handleChangePage,
|
|
8555
|
+
page = props.page,
|
|
8556
|
+
rowsPerPage = props.rowsPerPage,
|
|
8557
|
+
_props$handleSelectAl2 = props.handleSelectAllClick,
|
|
8558
|
+
handleSelectAllClick = _props$handleSelectAl2 === void 0 ? function () {} : _props$handleSelectAl2,
|
|
8559
|
+
selected = props.selected,
|
|
8560
|
+
orderBy = props.orderBy,
|
|
8561
|
+
order = props.order,
|
|
8562
|
+
_props$onRequestSort2 = props.onRequestSort,
|
|
8563
|
+
onRequestSort = _props$onRequestSort2 === void 0 ? function () {} : _props$onRequestSort2,
|
|
8564
|
+
_props$onSearchHandle2 = props.onSearchHandler,
|
|
8565
|
+
onSearchHandler = _props$onSearchHandle2 === void 0 ? function () {} : _props$onSearchHandle2,
|
|
8566
|
+
_props$onVerifyHandle = props.onVerifyHandler,
|
|
8567
|
+
onVerifyHandler = _props$onVerifyHandle === void 0 ? function () {} : _props$onVerifyHandle,
|
|
8568
|
+
_props$onRejectHandle = props.onRejectHandler,
|
|
8569
|
+
onRejectHandler = _props$onRejectHandle === void 0 ? function () {} : _props$onRejectHandle,
|
|
8570
|
+
_props$isDataFetching2 = props.isDataFetching,
|
|
8571
|
+
isDataFetching = _props$isDataFetching2 === void 0 ? false : _props$isDataFetching2,
|
|
8572
|
+
searchValue = props.searchValue;
|
|
8573
|
+
var formatDate = function formatDate(date) {
|
|
8574
|
+
var dt = new Date(date);
|
|
8575
|
+
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
8576
|
+
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8577
|
+
};
|
|
8578
|
+
var columns = [{
|
|
8579
|
+
id: 'fname',
|
|
8580
|
+
label: 'Name',
|
|
8581
|
+
minWidth: 250,
|
|
8582
|
+
sortable: true,
|
|
8583
|
+
cell: function cell(row) {
|
|
8584
|
+
var _row$profile_pic2;
|
|
8585
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
8586
|
+
firstName: row.fname,
|
|
8587
|
+
lastName: row.lname,
|
|
8588
|
+
isLetterAvatar: row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8589
|
+
primaryText: row.fname + ' ' + row.lname,
|
|
8590
|
+
secondaryText: row.email,
|
|
8591
|
+
letterAvatarTextColor: "black",
|
|
8592
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
8593
|
+
avatarClassName: styles$5.avatarClassName,
|
|
8594
|
+
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic2 = row.profile_pic) === null || _row$profile_pic2 === void 0 ? void 0 : _row$profile_pic2.presigned_url
|
|
8595
|
+
}));
|
|
8596
|
+
}
|
|
8597
|
+
}, {
|
|
8598
|
+
id: 'created',
|
|
8599
|
+
label: 'Requested on',
|
|
8600
|
+
minWidth: 100,
|
|
8601
|
+
sortable: true,
|
|
8602
|
+
cell: function cell(row) {
|
|
8603
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8604
|
+
component: "div",
|
|
8605
|
+
width: 100
|
|
8606
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8607
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8608
|
+
}, formatDate(row.created)));
|
|
8609
|
+
}
|
|
8610
|
+
}, {
|
|
8611
|
+
id: 'actions',
|
|
8612
|
+
label: 'Actions',
|
|
8613
|
+
minWidth: 170,
|
|
8614
|
+
align: 'left',
|
|
8615
|
+
cell: function cell(row) {
|
|
8616
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8617
|
+
buttonText: "Verify",
|
|
8618
|
+
onClick: function onClick() {
|
|
8619
|
+
return onVerifyHandler(row.id);
|
|
8620
|
+
},
|
|
8621
|
+
style: {
|
|
8622
|
+
display: 'inline'
|
|
8623
|
+
}
|
|
8624
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8625
|
+
buttonText: "Reject",
|
|
8626
|
+
onClick: function onClick() {
|
|
8627
|
+
return onRejectHandler(row.id);
|
|
8628
|
+
},
|
|
8629
|
+
style: {
|
|
8630
|
+
display: 'inline'
|
|
8631
|
+
}
|
|
8632
|
+
}));
|
|
8633
|
+
},
|
|
8634
|
+
style: {
|
|
8635
|
+
paddingLeft: '40px'
|
|
8636
|
+
}
|
|
8637
|
+
}];
|
|
8638
|
+
return /*#__PURE__*/React.createElement(IUITable, {
|
|
8639
|
+
searchPlaceholder: "Search by name or email",
|
|
8640
|
+
isCheckboxTable: false,
|
|
8641
|
+
columns: columns,
|
|
8642
|
+
rows: data.results,
|
|
8643
|
+
count: data.count,
|
|
8644
|
+
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
8645
|
+
handleChangePage: handleChangePage,
|
|
8646
|
+
page: page,
|
|
8647
|
+
rowsPerPage: rowsPerPage,
|
|
8648
|
+
handleSelectAllClick: handleSelectAllClick,
|
|
8649
|
+
selected: selected,
|
|
8650
|
+
orderBy: orderBy,
|
|
8651
|
+
order: order,
|
|
8652
|
+
searchHide: false,
|
|
8653
|
+
hasFilter: true,
|
|
8654
|
+
onRequestSort: onRequestSort,
|
|
8655
|
+
onSearchHandler: onSearchHandler,
|
|
8656
|
+
isDataFetching: isDataFetching,
|
|
8657
|
+
searchBoxWidth: "400px",
|
|
8158
8658
|
searchValue: searchValue
|
|
8159
8659
|
});
|
|
8160
8660
|
};
|
|
@@ -8178,11 +8678,70 @@ function InfoYellowIcon(props) {
|
|
|
8178
8678
|
}));
|
|
8179
8679
|
}
|
|
8180
8680
|
|
|
8681
|
+
function RedWarningIcon(props) {
|
|
8682
|
+
var _props$color = props.color,
|
|
8683
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8684
|
+
_props$size = props.size,
|
|
8685
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8686
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8687
|
+
width: size,
|
|
8688
|
+
height: size,
|
|
8689
|
+
viewBox: "0 0 14 14",
|
|
8690
|
+
fill: color,
|
|
8691
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8692
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8693
|
+
d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM6 4C6 3.44772 6.44772 3 7 3C7.55229 3 8 3.44772 8 4V6C8 6.55229 7.55229 7 7 7C6.44772 7 6 6.55229 6 6V4ZM6 10C6 9.44771 6.44772 9 7 9C7.55229 9 8 9.44771 8 10C8 10.5523 7.55229 11 7 11C6.44772 11 6 10.5523 6 10Z",
|
|
8694
|
+
fill: color
|
|
8695
|
+
}));
|
|
8696
|
+
}
|
|
8697
|
+
|
|
8698
|
+
function InviteInfoIcon() {
|
|
8699
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8700
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8701
|
+
width: "20",
|
|
8702
|
+
height: "20",
|
|
8703
|
+
fill: "none",
|
|
8704
|
+
viewBox: "0 0 20 20"
|
|
8705
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8706
|
+
fill: "#CA8A04",
|
|
8707
|
+
d: "M11 5a1 1 0 11-2 0 1 1 0 012 0zM8 8a1 1 0 000 2h1v3H8a1 1 0 100 2h4a1 1 0 100-2h-1V9a1 1 0 00-1-1H8z"
|
|
8708
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8709
|
+
fill: "#CA8A04",
|
|
8710
|
+
d: "M0 10c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10S0 4.477 0 10zm10-8a8 8 0 110 16 8 8 0 010-16z"
|
|
8711
|
+
}));
|
|
8712
|
+
}
|
|
8713
|
+
|
|
8181
8714
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8182
|
-
var env$7 = configs.env
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8715
|
+
var env$7 = configs.env,
|
|
8716
|
+
api$7 = configs.api;
|
|
8717
|
+
var UndoButton = function UndoButton(_ref) {
|
|
8718
|
+
var onUndo = _ref.onUndo,
|
|
8719
|
+
msg = _ref.msg;
|
|
8720
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8721
|
+
style: {
|
|
8722
|
+
display: 'flex',
|
|
8723
|
+
flexDirection: 'row',
|
|
8724
|
+
width: '270px',
|
|
8725
|
+
justifyContent: 'space-between'
|
|
8726
|
+
}
|
|
8727
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
8728
|
+
style: {
|
|
8729
|
+
whiteSpace: 'nowrap',
|
|
8730
|
+
paddingTop: '8px'
|
|
8731
|
+
}
|
|
8732
|
+
}, msg), /*#__PURE__*/React.createElement("p", {
|
|
8733
|
+
onClick: onUndo,
|
|
8734
|
+
style: {
|
|
8735
|
+
whiteSpace: 'nowrap',
|
|
8736
|
+
fontWeight: '600',
|
|
8737
|
+
fontSize: '1rem',
|
|
8738
|
+
padding: '8px 20px 0'
|
|
8739
|
+
}
|
|
8740
|
+
}, "UNDO"));
|
|
8741
|
+
};
|
|
8742
|
+
var UserList = function UserList(_ref2) {
|
|
8743
|
+
var config = _ref2.config,
|
|
8744
|
+
isProfile = _ref2.isProfile;
|
|
8186
8745
|
env$7.init(config, isProfile);
|
|
8187
8746
|
var history = useHistory();
|
|
8188
8747
|
var _useSelector = useSelector(function (state) {
|
|
@@ -8190,31 +8749,51 @@ var UserList = function UserList(_ref) {
|
|
|
8190
8749
|
}),
|
|
8191
8750
|
userListInfo = _useSelector.userListInfo,
|
|
8192
8751
|
isDataFetching = _useSelector.isDataFetching,
|
|
8193
|
-
deactivatedUsers = _useSelector.deactivatedUsers
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
setOrderBy = _React$useState5[1];
|
|
8212
|
-
var _useState2 = useState(''),
|
|
8213
|
-
searchValue = _useState2[0],
|
|
8214
|
-
setSearchValue = _useState2[1];
|
|
8752
|
+
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8753
|
+
tabValue = _useSelector.tabValue;
|
|
8754
|
+
var newSelecteds = userListInfo.results;
|
|
8755
|
+
var _React$useState = React.useState(''),
|
|
8756
|
+
deactivateUser = _React$useState[0],
|
|
8757
|
+
setDeactivateUser = _React$useState[1];
|
|
8758
|
+
var _React$useState2 = React.useState(null),
|
|
8759
|
+
defaultId = _React$useState2[0],
|
|
8760
|
+
setDefaultId = _React$useState2[1];
|
|
8761
|
+
var _React$useState3 = React.useState(1),
|
|
8762
|
+
page = _React$useState3[0],
|
|
8763
|
+
setPage = _React$useState3[1];
|
|
8764
|
+
var _useState = useState([]),
|
|
8765
|
+
selectedUsersNotApprover = _useState[0],
|
|
8766
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8767
|
+
var _useState2 = useState([]),
|
|
8768
|
+
selectedUsersApprover = _useState2[0],
|
|
8769
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8215
8770
|
var _useState3 = useState(false),
|
|
8216
|
-
|
|
8217
|
-
|
|
8771
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8772
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8773
|
+
var _React$useState4 = React.useState(''),
|
|
8774
|
+
user = _React$useState4[0],
|
|
8775
|
+
setUser = _React$useState4[1];
|
|
8776
|
+
var _useState4 = useState(10),
|
|
8777
|
+
rowsPerPage = _useState4[0],
|
|
8778
|
+
setRowsPerPage = _useState4[1];
|
|
8779
|
+
var _React$useState5 = React.useState({}),
|
|
8780
|
+
selected = _React$useState5[0],
|
|
8781
|
+
setSelected = _React$useState5[1];
|
|
8782
|
+
var _React$useState6 = React.useState('asc'),
|
|
8783
|
+
order = _React$useState6[0],
|
|
8784
|
+
setOrder = _React$useState6[1];
|
|
8785
|
+
var _React$useState7 = React.useState(false),
|
|
8786
|
+
deactivateSingle = _React$useState7[0],
|
|
8787
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8788
|
+
var _React$useState8 = React.useState('first_name'),
|
|
8789
|
+
orderBy = _React$useState8[0],
|
|
8790
|
+
setOrderBy = _React$useState8[1];
|
|
8791
|
+
var _useState5 = useState(''),
|
|
8792
|
+
searchValue = _useState5[0],
|
|
8793
|
+
setSearchValue = _useState5[1];
|
|
8794
|
+
var _useState6 = useState(false),
|
|
8795
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8796
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8218
8797
|
var _useSelector2 = useSelector(function (state) {
|
|
8219
8798
|
return state.common;
|
|
8220
8799
|
}),
|
|
@@ -8222,43 +8801,125 @@ var UserList = function UserList(_ref) {
|
|
|
8222
8801
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8223
8802
|
isILadmin = _useSelector2.isILadmin,
|
|
8224
8803
|
companyName = _useSelector2.companyName;
|
|
8225
|
-
var _useState4 = useState(false),
|
|
8226
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8227
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8228
|
-
var _useState5 = useState(false),
|
|
8229
|
-
isFileDownloading = _useState5[0],
|
|
8230
|
-
setDownlStatus = _useState5[1];
|
|
8231
|
-
var _useState6 = useState(false),
|
|
8232
|
-
isSortingChange = _useState6[0],
|
|
8233
|
-
setSortingChange = _useState6[1];
|
|
8234
8804
|
var _useState7 = useState(false),
|
|
8235
|
-
|
|
8236
|
-
|
|
8805
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8806
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8237
8807
|
var _useState8 = useState(false),
|
|
8238
|
-
|
|
8239
|
-
|
|
8808
|
+
approveeStatus = _useState8[0],
|
|
8809
|
+
setApproveeStatus = _useState8[1];
|
|
8240
8810
|
var _useState9 = useState(false),
|
|
8241
|
-
|
|
8242
|
-
|
|
8811
|
+
isFileDownloading = _useState9[0],
|
|
8812
|
+
setDownlStatus = _useState9[1];
|
|
8243
8813
|
var _useState10 = useState(false),
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
var _useState11 = useState(
|
|
8814
|
+
isSortingChange = _useState10[0],
|
|
8815
|
+
setSortingChange = _useState10[1];
|
|
8816
|
+
var _useState11 = useState(false),
|
|
8817
|
+
isSearchingChange = _useState11[0],
|
|
8818
|
+
setSearchingChange = _useState11[1];
|
|
8819
|
+
var _useState12 = useState(false),
|
|
8820
|
+
isSortingChangeTemp = _useState12[0],
|
|
8821
|
+
setSortingChangeTemp = _useState12[1];
|
|
8822
|
+
var _useState13 = useState(false),
|
|
8823
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8824
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8825
|
+
var _useState14 = useState(false),
|
|
8826
|
+
isApiFetching = _useState14[0],
|
|
8827
|
+
setisApiFetching = _useState14[1];
|
|
8828
|
+
var _useState15 = useState({
|
|
8247
8829
|
value: '',
|
|
8248
8830
|
label: 'Select approver'
|
|
8249
8831
|
}),
|
|
8250
|
-
|
|
8251
|
-
|
|
8832
|
+
approverRole = _useState15[0],
|
|
8833
|
+
setApproverRole = _useState15[1];
|
|
8834
|
+
var _useState16 = useState(false),
|
|
8835
|
+
showInviteModal = _useState16[0],
|
|
8836
|
+
setToggleInviteModal = _useState16[1];
|
|
8837
|
+
var _useState17 = useState(''),
|
|
8838
|
+
userIds = _useState17[0],
|
|
8839
|
+
setUserIds = _useState17[1];
|
|
8840
|
+
var _React$useState9 = React.useState(false),
|
|
8841
|
+
overlayMenu = _React$useState9[0],
|
|
8842
|
+
setOverlayMenu = _React$useState9[1];
|
|
8843
|
+
var _useState18 = useState(''),
|
|
8844
|
+
userFirstName = _useState18[0],
|
|
8845
|
+
setUserFirstName = _useState18[1];
|
|
8846
|
+
var _useState19 = useState(''),
|
|
8847
|
+
userLastName = _useState19[0],
|
|
8848
|
+
setUserLastName = _useState19[1];
|
|
8849
|
+
var _useState20 = useState(true),
|
|
8850
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8851
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8852
|
+
useScrollPosition(function (_ref3) {
|
|
8853
|
+
var prevPos = _ref3.prevPos,
|
|
8854
|
+
currPos = _ref3.currPos;
|
|
8855
|
+
if (prevPos.y - currPos.y > 0) {
|
|
8856
|
+
if (currPos.y <= -275) {
|
|
8857
|
+
setOverlayMenu(true);
|
|
8858
|
+
}
|
|
8859
|
+
} else {
|
|
8860
|
+
if (currPos.y > -295) {
|
|
8861
|
+
setOverlayMenu(false);
|
|
8862
|
+
}
|
|
8863
|
+
}
|
|
8864
|
+
}, [overlayMenu]);
|
|
8865
|
+
var scrollTo = function scrollTo(id) {
|
|
8866
|
+
var el = document.getElementById(id);
|
|
8867
|
+
window.scrollTo({
|
|
8868
|
+
top: el.offsetTop,
|
|
8869
|
+
behavior: 'smooth'
|
|
8870
|
+
});
|
|
8871
|
+
};
|
|
8872
|
+
var _React$useState10 = React.useState(1),
|
|
8873
|
+
signup_page = _React$useState10[0],
|
|
8874
|
+
setSignUpPage = _React$useState10[1];
|
|
8875
|
+
var _useState21 = useState(5),
|
|
8876
|
+
signup_rowsPerPage = _useState21[0],
|
|
8877
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8878
|
+
var _React$useState11 = React.useState('asc'),
|
|
8879
|
+
signup_order = _React$useState11[0],
|
|
8880
|
+
setSignUpOrder = _React$useState11[1];
|
|
8881
|
+
var _React$useState12 = React.useState('fname'),
|
|
8882
|
+
signup_orderBy = _React$useState12[0],
|
|
8883
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8884
|
+
var _useState22 = useState(''),
|
|
8885
|
+
signup_searchValue = _useState22[0],
|
|
8886
|
+
set_signup_SearchValue = _useState22[1];
|
|
8887
|
+
var _useState23 = useState(false),
|
|
8888
|
+
isSignUpSortingChange = _useState23[0],
|
|
8889
|
+
setSignUpSortingChange = _useState23[1];
|
|
8890
|
+
var _useState24 = useState(false),
|
|
8891
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8892
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8893
|
+
var _useState25 = useState(false),
|
|
8894
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8895
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8896
|
+
var _useState26 = useState(false),
|
|
8897
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8898
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8899
|
+
var _useSelector3 = useSelector(function (state) {
|
|
8900
|
+
return state.userList;
|
|
8901
|
+
}),
|
|
8902
|
+
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8903
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8904
|
+
history.push(config.routes.notification.path);
|
|
8905
|
+
};
|
|
8252
8906
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8253
8907
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8254
8908
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8255
8909
|
return false;
|
|
8256
8910
|
}
|
|
8257
|
-
|
|
8911
|
+
if (selectedUsersApprover.length) {
|
|
8912
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8913
|
+
} else {
|
|
8914
|
+
setOpenDeActivateModalFlag(true);
|
|
8915
|
+
}
|
|
8258
8916
|
};
|
|
8259
8917
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8260
8918
|
setOpenDeActivateModalFlag(false);
|
|
8261
8919
|
};
|
|
8920
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8921
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8922
|
+
};
|
|
8262
8923
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8263
8924
|
history.push(config.routes.users.add.path);
|
|
8264
8925
|
};
|
|
@@ -8268,6 +8929,34 @@ var UserList = function UserList(_ref) {
|
|
|
8268
8929
|
var handleEditUserClick = function handleEditUserClick(userId) {
|
|
8269
8930
|
history.push(config.routes.users.edit.path.replace(":" + config.routes.users.edit.paramKeys.userId, userId));
|
|
8270
8931
|
};
|
|
8932
|
+
var handleVerifyUserClick = function handleVerifyUserClick(userId) {
|
|
8933
|
+
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
8934
|
+
};
|
|
8935
|
+
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8936
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8937
|
+
if (res.status === true) {
|
|
8938
|
+
var _res$data;
|
|
8939
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React.createElement(UndoButton, {
|
|
8940
|
+
onUndo: function onUndo() {
|
|
8941
|
+
return dispatch(undoneSignUpRejection(userId));
|
|
8942
|
+
},
|
|
8943
|
+
msg: (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Sign-up request rejected'
|
|
8944
|
+
}));
|
|
8945
|
+
dispatch(showDataFetchingStatus());
|
|
8946
|
+
dispatch(fetchUserSignupRequests({
|
|
8947
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8948
|
+
length: signup_rowsPerPage,
|
|
8949
|
+
page: signup_page,
|
|
8950
|
+
search: signup_searchValue.trim(),
|
|
8951
|
+
pagename: 'company'
|
|
8952
|
+
})).then(function () {
|
|
8953
|
+
return dispatch(stopDataFetchingStatus());
|
|
8954
|
+
});
|
|
8955
|
+
}
|
|
8956
|
+
})["catch"](function (err) {
|
|
8957
|
+
console.log(err);
|
|
8958
|
+
});
|
|
8959
|
+
};
|
|
8271
8960
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
8272
8961
|
history.push(config.routes.bulkUpload.bulkActionHistory.path);
|
|
8273
8962
|
};
|
|
@@ -8278,12 +8967,25 @@ var UserList = function UserList(_ref) {
|
|
|
8278
8967
|
};
|
|
8279
8968
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8280
8969
|
var _extends2;
|
|
8281
|
-
var
|
|
8970
|
+
var selectedId = [];
|
|
8971
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8972
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8973
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8282
8974
|
return n.is_active;
|
|
8283
|
-
}).map(function (obj) {
|
|
8284
|
-
return obj.id.toString();
|
|
8285
8975
|
});
|
|
8286
|
-
|
|
8976
|
+
_newSelecteds.map(function (obj) {
|
|
8977
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
8978
|
+
if (obj.roles.is_approver === true) {
|
|
8979
|
+
_selectedUsersApprover.push(obj);
|
|
8980
|
+
} else if (obj.roles.is_approver === false) {
|
|
8981
|
+
_selectedUsersNotApprover.push(obj);
|
|
8982
|
+
}
|
|
8983
|
+
}
|
|
8984
|
+
selectedId.push(obj.id.toString());
|
|
8985
|
+
});
|
|
8986
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
8987
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
8988
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8287
8989
|
};
|
|
8288
8990
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8289
8991
|
var _extends3;
|
|
@@ -8292,6 +8994,8 @@ var UserList = function UserList(_ref) {
|
|
|
8292
8994
|
return;
|
|
8293
8995
|
}
|
|
8294
8996
|
setSelected(_extends({}, selected, (_extends3 = {}, _extends3[page] = [], _extends3)));
|
|
8997
|
+
setSelectedUsersNotApprover([]);
|
|
8998
|
+
setSelectedUsersApprover([]);
|
|
8295
8999
|
};
|
|
8296
9000
|
var onRequestSort = function onRequestSort(event, property) {
|
|
8297
9001
|
var isAsc = orderBy === property && order === 'asc';
|
|
@@ -8305,40 +9009,152 @@ var UserList = function UserList(_ref) {
|
|
|
8305
9009
|
setSearchingChange(true);
|
|
8306
9010
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
8307
9011
|
};
|
|
8308
|
-
var
|
|
9012
|
+
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9013
|
+
set_signup_SearchValue(value);
|
|
9014
|
+
setSignUpSearchingChange(true);
|
|
9015
|
+
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
9016
|
+
};
|
|
9017
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8309
9018
|
var _extends4;
|
|
8310
9019
|
var selectedTemp = _extends({}, selected);
|
|
8311
9020
|
if (!(page in selectedTemp)) {
|
|
8312
9021
|
selectedTemp[page] = [];
|
|
8313
9022
|
}
|
|
8314
9023
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8315
|
-
var
|
|
9024
|
+
var _newSelected = [];
|
|
8316
9025
|
if (selectedIndex === -1) {
|
|
8317
|
-
|
|
9026
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8318
9027
|
} else if (selectedIndex === 0) {
|
|
8319
|
-
|
|
9028
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8320
9029
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8321
|
-
|
|
9030
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8322
9031
|
} else if (selectedIndex > 0) {
|
|
8323
|
-
|
|
9032
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9033
|
+
}
|
|
9034
|
+
if (selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length || selectedUsersApprover !== null && selectedUsersApprover !== void 0 && selectedUsersApprover.length) {
|
|
9035
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9036
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9037
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9038
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9039
|
+
return id !== item.id.toString();
|
|
9040
|
+
});
|
|
9041
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9042
|
+
return item.id.toString() !== id;
|
|
9043
|
+
});
|
|
9044
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9045
|
+
if (data.roles.is_approver === true) {
|
|
9046
|
+
_SelectedUsersApprover.push(data);
|
|
9047
|
+
} else if (data.roles.is_approver === false) {
|
|
9048
|
+
_SelectedUsersNotApprover.push(data);
|
|
9049
|
+
}
|
|
9050
|
+
}
|
|
9051
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9052
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8324
9053
|
}
|
|
8325
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] =
|
|
9054
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8326
9055
|
};
|
|
9056
|
+
useEffect(function () {
|
|
9057
|
+
setApproverRole({
|
|
9058
|
+
value: '',
|
|
9059
|
+
label: 'Select approver'
|
|
9060
|
+
});
|
|
9061
|
+
setDefaultId(null);
|
|
9062
|
+
setIsDisabledSubmitBtn(true);
|
|
9063
|
+
setApproveeStatus(false);
|
|
9064
|
+
if (deactivateSingle === true) {
|
|
9065
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9066
|
+
if (response.data["default"].id) {
|
|
9067
|
+
setDefaultId(response.data["default"].id);
|
|
9068
|
+
setApproverRole({
|
|
9069
|
+
value: '',
|
|
9070
|
+
label: response.data["default"].email
|
|
9071
|
+
});
|
|
9072
|
+
setIsDisabledSubmitBtn(false);
|
|
9073
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9074
|
+
}
|
|
9075
|
+
});
|
|
9076
|
+
}
|
|
9077
|
+
}, [deactivateSingle]);
|
|
8327
9078
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8328
9079
|
setRowsPerPage(+event.target.value);
|
|
8329
9080
|
setPage(1);
|
|
8330
9081
|
setSelected({});
|
|
9082
|
+
setSelectedUsersNotApprover([]);
|
|
9083
|
+
setSelectedUsersApprover([]);
|
|
8331
9084
|
setSortingChange(true);
|
|
8332
9085
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8333
9086
|
};
|
|
8334
9087
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8335
|
-
|
|
9088
|
+
var isActive = e.target.checked;
|
|
9089
|
+
var _isApprover;
|
|
9090
|
+
newSelecteds.map(function (item) {
|
|
9091
|
+
if (item.id === id) {
|
|
9092
|
+
_isApprover = item.roles.is_approver;
|
|
9093
|
+
if (_isApprover === true && isActive === false) {
|
|
9094
|
+
setDeactivateSingle(true);
|
|
9095
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9096
|
+
setUser(item);
|
|
9097
|
+
} else {
|
|
9098
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9099
|
+
if (!isActive) {
|
|
9100
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9101
|
+
var _extends5;
|
|
9102
|
+
var selectedTemp = _extends({}, selected);
|
|
9103
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9104
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9105
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9106
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9107
|
+
return item.id != id;
|
|
9108
|
+
});
|
|
9109
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9110
|
+
return item.id != id;
|
|
9111
|
+
});
|
|
9112
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9113
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9114
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9115
|
+
}
|
|
9116
|
+
}
|
|
9117
|
+
});
|
|
9118
|
+
}
|
|
9119
|
+
}
|
|
9120
|
+
});
|
|
9121
|
+
};
|
|
9122
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9123
|
+
var _value = _ref4._value;
|
|
9124
|
+
if (_value.data.approvee_status) {
|
|
9125
|
+
setApproveeStatus(true);
|
|
9126
|
+
} else {
|
|
9127
|
+
setApproveeStatus(false);
|
|
9128
|
+
}
|
|
9129
|
+
setDefaultId(_value.data.id);
|
|
9130
|
+
setApproverRole(_value);
|
|
9131
|
+
setIsDisabledSubmitBtn(false);
|
|
9132
|
+
};
|
|
9133
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9134
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9135
|
+
setOpenDeActivateModalFlag(false);
|
|
9136
|
+
setDeactivateSingle(false);
|
|
9137
|
+
setSelected({});
|
|
9138
|
+
setSelectedUsersNotApprover([]);
|
|
9139
|
+
setSelectedUsersApprover([]);
|
|
8336
9140
|
};
|
|
8337
|
-
|
|
8338
9141
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8339
9142
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8340
9143
|
setOpenDeActivateModalFlag(false);
|
|
8341
9144
|
setSelected({});
|
|
9145
|
+
setSelectedUsersNotApprover([]);
|
|
9146
|
+
setSelectedUsersApprover([]);
|
|
9147
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9148
|
+
};
|
|
9149
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9150
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9151
|
+
return item.id;
|
|
9152
|
+
});
|
|
9153
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9154
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9155
|
+
setSelected({});
|
|
9156
|
+
setSelectedUsersNotApprover([]);
|
|
9157
|
+
setSelectedUsersApprover([]);
|
|
8342
9158
|
};
|
|
8343
9159
|
var importUserHandler = function importUserHandler() {
|
|
8344
9160
|
setOpenImportUsersModal(true);
|
|
@@ -8350,6 +9166,43 @@ var UserList = function UserList(_ref) {
|
|
|
8350
9166
|
setOpenImportUsersModal(false);
|
|
8351
9167
|
handleImportPagenavigation(jobId);
|
|
8352
9168
|
};
|
|
9169
|
+
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9170
|
+
dispatch(resetPasswordForUser({
|
|
9171
|
+
email: email
|
|
9172
|
+
}));
|
|
9173
|
+
};
|
|
9174
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9175
|
+
if (type === undefined) {
|
|
9176
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9177
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9178
|
+
return false;
|
|
9179
|
+
}
|
|
9180
|
+
}
|
|
9181
|
+
setUserIds(ids);
|
|
9182
|
+
setUserFirstName(firstName);
|
|
9183
|
+
setUserLastName(lastName);
|
|
9184
|
+
setToggleInviteModal(!showInviteModal);
|
|
9185
|
+
};
|
|
9186
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9187
|
+
setToggleInviteModal(!showInviteModal);
|
|
9188
|
+
};
|
|
9189
|
+
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9190
|
+
var userIdArr = [];
|
|
9191
|
+
if (userIds && !isNaN(userIds)) {
|
|
9192
|
+
userIdArr = [userIds];
|
|
9193
|
+
} else if (Object.keys(selected).length) {
|
|
9194
|
+
Object.values(selected).map(function (val, i) {
|
|
9195
|
+
if (val.length) {
|
|
9196
|
+
val.map(function (idx, i) {
|
|
9197
|
+
userIdArr.push(idx);
|
|
9198
|
+
});
|
|
9199
|
+
}
|
|
9200
|
+
});
|
|
9201
|
+
}
|
|
9202
|
+
setUserIds('');
|
|
9203
|
+
dispatch(resendInviteForUser(userIdArr));
|
|
9204
|
+
setToggleInviteModal(!showInviteModal);
|
|
9205
|
+
};
|
|
8353
9206
|
var handleExportUsers = function handleExportUsers() {
|
|
8354
9207
|
try {
|
|
8355
9208
|
setDownlStatus(true);
|
|
@@ -8389,12 +9242,20 @@ var UserList = function UserList(_ref) {
|
|
|
8389
9242
|
}, {
|
|
8390
9243
|
label: 'Bulk action history',
|
|
8391
9244
|
handler: handleBulkActionHistoryClick
|
|
9245
|
+
}, {
|
|
9246
|
+
label: 'Resend invite',
|
|
9247
|
+
handler: toggleInviteModal
|
|
8392
9248
|
}];
|
|
8393
9249
|
useEffect(function () {
|
|
8394
9250
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
8395
9251
|
dispatch(showDataFetchingStatus());
|
|
8396
9252
|
dispatch(verifyAccessToken(roleCanAccess));
|
|
8397
9253
|
}, []);
|
|
9254
|
+
var onPrimaryAdminHandler = function onPrimaryAdminHandler(userId) {
|
|
9255
|
+
dispatch(makePrimaryAdmin({
|
|
9256
|
+
userId: userId
|
|
9257
|
+
}));
|
|
9258
|
+
};
|
|
8398
9259
|
var dispatch = useDispatch();
|
|
8399
9260
|
useEffect(function () {
|
|
8400
9261
|
if (isTokenVerified === true) {
|
|
@@ -8404,16 +9265,38 @@ var UserList = function UserList(_ref) {
|
|
|
8404
9265
|
var url = userListUrl.getUser + '?length=' + rowsPerPage + '&page=' + pageNum + searchParam + orderingParam;
|
|
8405
9266
|
if (isSearchingChange) {
|
|
8406
9267
|
var delayDebounceFn = setTimeout(function () {
|
|
9268
|
+
setisApiFetching(true);
|
|
8407
9269
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8408
|
-
|
|
9270
|
+
setSearchingChange(false);
|
|
9271
|
+
setisApiFetching(false);
|
|
9272
|
+
scrollTo('table-root');
|
|
8409
9273
|
});
|
|
8410
|
-
},
|
|
9274
|
+
}, 1000);
|
|
8411
9275
|
return function () {
|
|
8412
9276
|
return clearTimeout(delayDebounceFn);
|
|
8413
9277
|
};
|
|
8414
9278
|
}
|
|
9279
|
+
if (isSignUpSearchingChange) {
|
|
9280
|
+
var delayDebounceFn2 = setTimeout(function () {
|
|
9281
|
+
setisApiFetching(true);
|
|
9282
|
+
dispatch(fetchUserSignupRequests({
|
|
9283
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9284
|
+
length: signup_rowsPerPage,
|
|
9285
|
+
page: signup_page,
|
|
9286
|
+
search: signup_searchValue.trim(),
|
|
9287
|
+
pagename: 'company'
|
|
9288
|
+
})).then(function () {
|
|
9289
|
+
setSignUpSearchingChange(false);
|
|
9290
|
+
setisApiFetching(false);
|
|
9291
|
+
});
|
|
9292
|
+
}, 1000);
|
|
9293
|
+
return function () {
|
|
9294
|
+
return clearTimeout(delayDebounceFn2);
|
|
9295
|
+
};
|
|
9296
|
+
}
|
|
8415
9297
|
if (isSortingChange) {
|
|
8416
9298
|
setisApiFetching(true);
|
|
9299
|
+
scrollTo('table-root');
|
|
8417
9300
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8418
9301
|
setisApiFetching(false);
|
|
8419
9302
|
setSortingChange(false);
|
|
@@ -8422,23 +9305,121 @@ var UserList = function UserList(_ref) {
|
|
|
8422
9305
|
setSortingChange(false);
|
|
8423
9306
|
});
|
|
8424
9307
|
}
|
|
8425
|
-
if (
|
|
9308
|
+
if (isSignUpSortingChange) {
|
|
9309
|
+
setisApiFetching(true);
|
|
9310
|
+
dispatch(fetchUserSignupRequests({
|
|
9311
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9312
|
+
length: signup_rowsPerPage,
|
|
9313
|
+
page: signup_page,
|
|
9314
|
+
search: signup_searchValue.trim(),
|
|
9315
|
+
pagename: 'company'
|
|
9316
|
+
})).then(function () {
|
|
9317
|
+
setisApiFetching(false);
|
|
9318
|
+
setSignUpSortingChange(false);
|
|
9319
|
+
})["catch"](function () {
|
|
9320
|
+
setisApiFetching(false);
|
|
9321
|
+
setSignUpSortingChange(false);
|
|
9322
|
+
});
|
|
9323
|
+
}
|
|
9324
|
+
if (!isSearchingChange && !isSortingChange && !isSignUpSearchingChange && !isSignUpSortingChange) {
|
|
8426
9325
|
dispatch(showDataFetchingStatus());
|
|
8427
9326
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8428
|
-
|
|
9327
|
+
dispatch(fetchUserSignupRequests({
|
|
9328
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9329
|
+
length: signup_rowsPerPage,
|
|
9330
|
+
page: signup_page,
|
|
9331
|
+
search: signup_searchValue.trim(),
|
|
9332
|
+
pagename: 'company'
|
|
9333
|
+
})).then(function () {
|
|
9334
|
+
return dispatch(stopDataFetchingStatus());
|
|
9335
|
+
});
|
|
8429
9336
|
});
|
|
8430
9337
|
}
|
|
8431
9338
|
}
|
|
8432
|
-
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp]);
|
|
9339
|
+
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9340
|
+
var topRightButtons = function topRightButtons() {
|
|
9341
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9342
|
+
component: "div",
|
|
9343
|
+
className: styles$5.buttonWrapper,
|
|
9344
|
+
display: "flex",
|
|
9345
|
+
justifyContent: "space-between",
|
|
9346
|
+
alignItems: "center",
|
|
9347
|
+
alignSelf: "flex-start"
|
|
9348
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9349
|
+
component: "div",
|
|
9350
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9351
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9352
|
+
buttonText: "Export all users",
|
|
9353
|
+
type: "outlined",
|
|
9354
|
+
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9355
|
+
width: "22",
|
|
9356
|
+
height: "22"
|
|
9357
|
+
}),
|
|
9358
|
+
onClick: handleExportUsers
|
|
9359
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9360
|
+
component: "div",
|
|
9361
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9362
|
+
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9363
|
+
buttonText: "Bulk actions",
|
|
9364
|
+
type: "outlined",
|
|
9365
|
+
menuListInfo: BulkUploadInfo
|
|
9366
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9367
|
+
component: "div",
|
|
9368
|
+
className: "pageHeader--button-single button-right"
|
|
9369
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9370
|
+
buttonText: "Add user",
|
|
9371
|
+
type: "contained",
|
|
9372
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9373
|
+
width: "9",
|
|
9374
|
+
height: "9",
|
|
9375
|
+
color: "white"
|
|
9376
|
+
}),
|
|
9377
|
+
onClick: handleAddPageNavigation
|
|
9378
|
+
})));
|
|
9379
|
+
};
|
|
8433
9380
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8434
9381
|
component: "div",
|
|
8435
9382
|
className: styles$5.UUIUserManagementList
|
|
8436
|
-
},
|
|
9383
|
+
}, overlayMenu ? /*#__PURE__*/React.createElement(Box, {
|
|
9384
|
+
className: styles$5.scrollOverlayMenu
|
|
9385
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9386
|
+
component: "div",
|
|
9387
|
+
className: clsx(styles$5.pageHeader)
|
|
9388
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9389
|
+
component: "div",
|
|
9390
|
+
display: "flex",
|
|
9391
|
+
justifyContent: "space-between",
|
|
9392
|
+
alignItems: "center",
|
|
9393
|
+
flexWrap: "wrap",
|
|
9394
|
+
style: {
|
|
9395
|
+
gap: '1rem'
|
|
9396
|
+
}
|
|
9397
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9398
|
+
component: "div",
|
|
9399
|
+
display: "flex",
|
|
9400
|
+
flexDirection: "column",
|
|
9401
|
+
style: {
|
|
9402
|
+
gap: '0.5rem'
|
|
9403
|
+
}
|
|
9404
|
+
}, /*#__PURE__*/React.createElement(IUISearch, {
|
|
9405
|
+
placeholder: "Search by name, email & department",
|
|
9406
|
+
value: searchValue,
|
|
9407
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
9408
|
+
return onSearchHandler(e.target.value);
|
|
9409
|
+
},
|
|
9410
|
+
className: styles$5.overlaysearch
|
|
9411
|
+
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9412
|
+
component: "div",
|
|
9413
|
+
display: "flex",
|
|
9414
|
+
justifyContent: "space-between",
|
|
9415
|
+
alignItems: "center"
|
|
9416
|
+
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8437
9417
|
open: isFileDownloading || isApiFetching,
|
|
8438
9418
|
className: styles$5.backdrop
|
|
8439
9419
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
8440
9420
|
color: "inherit"
|
|
8441
9421
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9422
|
+
id: "table-root",
|
|
8442
9423
|
component: "div",
|
|
8443
9424
|
className: clsx(styles$5.pageHeader)
|
|
8444
9425
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -8463,73 +9444,104 @@ var UserList = function UserList(_ref) {
|
|
|
8463
9444
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8464
9445
|
variant: "h3",
|
|
8465
9446
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8466
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users')), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8467
|
-
component: "div",
|
|
8468
|
-
className: styles$5.headingWrapper
|
|
8469
|
-
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8470
|
-
variant: "body2",
|
|
8471
|
-
className: clsx(styles$5.description)
|
|
8472
|
-
}, "Create new users, customize user permissions and manage user accounts"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8473
|
-
component: "div",
|
|
8474
|
-
className: styles$5.buttonWrapper,
|
|
8475
|
-
display: "flex",
|
|
8476
|
-
justifyContent: "space-between",
|
|
8477
|
-
alignItems: "center",
|
|
8478
|
-
alignSelf: "flex-start"
|
|
8479
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8480
|
-
component: "div",
|
|
8481
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8482
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8483
|
-
buttonText: "Export all users",
|
|
8484
|
-
type: "outlined",
|
|
8485
|
-
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
8486
|
-
width: "22",
|
|
8487
|
-
height: "22"
|
|
8488
|
-
}),
|
|
8489
|
-
onClick: handleExportUsers
|
|
8490
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8491
|
-
component: "div",
|
|
8492
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8493
|
-
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
8494
|
-
buttonText: "Bulk actions",
|
|
8495
|
-
type: "outlined",
|
|
8496
|
-
menuListInfo: BulkUploadInfo
|
|
8497
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8498
|
-
component: "div",
|
|
8499
|
-
className: "pageHeader--button-single button-right"
|
|
8500
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8501
|
-
buttonText: "Add user",
|
|
8502
|
-
type: "contained",
|
|
8503
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
8504
|
-
width: "9",
|
|
8505
|
-
height: "9",
|
|
8506
|
-
color: "white"
|
|
8507
|
-
}),
|
|
8508
|
-
onClick: handleAddPageNavigation
|
|
8509
|
-
})))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9447
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8510
9448
|
component: "div",
|
|
8511
9449
|
display: "flex",
|
|
8512
9450
|
justifyContent: "space-between",
|
|
8513
9451
|
alignItems: "center"
|
|
8514
9452
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8515
9453
|
className: styles$5.tablewrapper
|
|
8516
|
-
}, /*#__PURE__*/React.createElement(
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
9454
|
+
}, /*#__PURE__*/React.createElement(IUITabs, {
|
|
9455
|
+
value: tabValue,
|
|
9456
|
+
customTabHandler: function customTabHandler(value) {
|
|
9457
|
+
return dispatch(updateTabValue(value));
|
|
9458
|
+
},
|
|
9459
|
+
className: styles$5.user_list_page_tabs,
|
|
9460
|
+
tabs: [{
|
|
9461
|
+
label: /*#__PURE__*/React.createElement(IUIBox, null, "Current users", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
9462
|
+
count: userListInfo.count
|
|
9463
|
+
}), ' '),
|
|
9464
|
+
content: /*#__PURE__*/React.createElement(IUIBox, {
|
|
9465
|
+
style: {
|
|
9466
|
+
marginLeft: '-17px'
|
|
9467
|
+
}
|
|
9468
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9469
|
+
component: "div",
|
|
9470
|
+
className: styles$5.headingWrapper
|
|
9471
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9472
|
+
variant: "body2",
|
|
9473
|
+
className: clsx(styles$5.description)
|
|
9474
|
+
}, "Create new users, customize user permissions and manage user accounts")), /*#__PURE__*/React.createElement(StickyHeadTable, {
|
|
9475
|
+
data: userListInfo,
|
|
9476
|
+
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
9477
|
+
handleChangePage: handleChangePage,
|
|
9478
|
+
page: page,
|
|
9479
|
+
rowsPerPage: rowsPerPage,
|
|
9480
|
+
handleActiveUser: handleActiveUser,
|
|
9481
|
+
handleSelectAllClick: handleSelectAllClick,
|
|
9482
|
+
selected: selected,
|
|
9483
|
+
handleSingleCheckBoxClick: handleSingleCheckBoxClick,
|
|
9484
|
+
orderBy: orderBy,
|
|
9485
|
+
order: order,
|
|
9486
|
+
onRequestSort: onRequestSort,
|
|
9487
|
+
onSearchHandler: onSearchHandler,
|
|
9488
|
+
onEditHandler: handleEditUserClick,
|
|
9489
|
+
disableRowCheckbox: deactivatedUsers,
|
|
9490
|
+
searchValue: searchValue,
|
|
9491
|
+
isILadmin: isILadmin,
|
|
9492
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler,
|
|
9493
|
+
onResetPasswordHandler: onResetPasswordHandler,
|
|
9494
|
+
toggleInviteModal: toggleInviteModal
|
|
9495
|
+
}))
|
|
9496
|
+
}, {
|
|
9497
|
+
label: /*#__PURE__*/React.createElement(IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
9498
|
+
count: signupRequestListInfo.count
|
|
9499
|
+
}), ' '),
|
|
9500
|
+
content: /*#__PURE__*/React.createElement(IUIBox, {
|
|
9501
|
+
style: {
|
|
9502
|
+
marginLeft: '-17px'
|
|
9503
|
+
}
|
|
9504
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9505
|
+
component: "div",
|
|
9506
|
+
className: styles$5.headingSignUpWrapper
|
|
9507
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9508
|
+
variant: "body2",
|
|
9509
|
+
className: clsx(styles$5.description)
|
|
9510
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement(IUITypography, {
|
|
9511
|
+
variant: "span",
|
|
9512
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9513
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9514
|
+
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9515
|
+
data: signupRequestListInfo,
|
|
9516
|
+
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9517
|
+
setSignUpRowsPerPage(+event.target.value);
|
|
9518
|
+
setSignUpPage(1);
|
|
9519
|
+
setSignUpSortingChange(true);
|
|
9520
|
+
setSignUpSortingChangeTemp(!isSignUpSortingChangeTemp);
|
|
9521
|
+
},
|
|
9522
|
+
handleChangePage: function handleChangePage(event, newPage) {
|
|
9523
|
+
setSignUpPage(newPage);
|
|
9524
|
+
setSignUpSortingChange(true);
|
|
9525
|
+
setSignUpSortingChangeTemp(!isSignUpSortingChangeTemp);
|
|
9526
|
+
},
|
|
9527
|
+
page: signup_page,
|
|
9528
|
+
rowsPerPage: signup_rowsPerPage,
|
|
9529
|
+
handleActiveUser: handleActiveUser,
|
|
9530
|
+
orderBy: signup_orderBy,
|
|
9531
|
+
order: signup_order,
|
|
9532
|
+
onRequestSort: function onRequestSort(event, property) {
|
|
9533
|
+
var isAsc = signup_orderBy === property && signup_order === 'asc';
|
|
9534
|
+
setSignUpOrder(isAsc ? 'desc' : 'asc');
|
|
9535
|
+
setSignUpOrderBy(property);
|
|
9536
|
+
setSignUpSortingChange(true);
|
|
9537
|
+
setSignUpSortingChangeTemp(!isSignUpSortingChangeTemp);
|
|
9538
|
+
},
|
|
9539
|
+
onSearchHandler: onSignUpReqeustSearchHandler,
|
|
9540
|
+
onVerifyHandler: handleVerifyUserClick,
|
|
9541
|
+
onRejectHandler: handleRejectUserClick,
|
|
9542
|
+
searchValue: signup_searchValue
|
|
9543
|
+
}))
|
|
9544
|
+
}]
|
|
8533
9545
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
8534
9546
|
isOpen: deactivateSingle,
|
|
8535
9547
|
closeHandler: function closeHandler() {
|
|
@@ -8537,79 +9549,40 @@ var UserList = function UserList(_ref) {
|
|
|
8537
9549
|
},
|
|
8538
9550
|
cancelLabel: "Cancel",
|
|
8539
9551
|
submitLabel: "Deactivate",
|
|
8540
|
-
submitHandler:
|
|
9552
|
+
submitHandler: handleDeactivateUser,
|
|
8541
9553
|
headerText: "Deactivate this user?",
|
|
8542
9554
|
width: "400px",
|
|
8543
9555
|
subHanderText: "",
|
|
8544
9556
|
submitBtnClass: styles$5.deactivateBtn,
|
|
8545
|
-
isDisabledSubmitBtn:
|
|
9557
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn
|
|
8546
9558
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8547
|
-
className: styles$5.deactivateSingle
|
|
9559
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
8548
9560
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8549
9561
|
className: styles$5.deactivateAlert
|
|
8550
9562
|
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
8551
9563
|
width: "9",
|
|
8552
9564
|
height: "9"
|
|
8553
|
-
}), /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("b", null,
|
|
8554
|
-
className: "
|
|
8555
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
8556
|
-
isMove: true,
|
|
8557
|
-
additional: {
|
|
8558
|
-
page: 1,
|
|
8559
|
-
product: 'travel',
|
|
8560
|
-
placeholder: 'Select a user'
|
|
8561
|
-
},
|
|
8562
|
-
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
8563
|
-
label: "Transfer admin role to",
|
|
8564
|
-
value: travelFYI,
|
|
8565
|
-
onValueChange: function onValueChange(_ref2) {
|
|
8566
|
-
var _value = _ref2._value;
|
|
8567
|
-
return setTravelFYI(_value);
|
|
8568
|
-
},
|
|
8569
|
-
loadOption: approversOptions
|
|
8570
|
-
,
|
|
8571
|
-
disableText: "Please get in touch with your administrator to change this value."
|
|
8572
|
-
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8573
|
-
className: clsx('iui__mb-5', styles$5.departmentHeadText)
|
|
8574
|
-
}, "Anvesh Dunna is the department head for: Product Design."), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8575
|
-
className: "iui__mb-15"
|
|
9565
|
+
}), /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9566
|
+
className: "iui__mt-15"
|
|
8576
9567
|
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
8577
9568
|
isMove: true,
|
|
8578
9569
|
additional: {
|
|
8579
9570
|
page: 1,
|
|
8580
9571
|
product: 'travel',
|
|
8581
|
-
|
|
8582
|
-
},
|
|
8583
|
-
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
8584
|
-
label: "Transfer department head role to",
|
|
8585
|
-
value: travelFYI,
|
|
8586
|
-
onValueChange: function onValueChange(_ref3) {
|
|
8587
|
-
var _value = _ref3._value;
|
|
8588
|
-
return setTravelFYI(_value);
|
|
9572
|
+
userId: user.id
|
|
8589
9573
|
},
|
|
8590
|
-
|
|
8591
|
-
,
|
|
8592
|
-
disableText: "Please get in touch with your administrator to change this value."
|
|
8593
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8594
|
-
className: "iui__mb-15"
|
|
8595
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
8596
|
-
isMove: true,
|
|
8597
|
-
additional: {
|
|
8598
|
-
page: 1,
|
|
8599
|
-
product: 'travel',
|
|
8600
|
-
placeholder: 'Select a user'
|
|
8601
|
-
},
|
|
8602
|
-
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9574
|
+
placeHolderCheck: approverRole !== undefined && approverRole.value === '',
|
|
8603
9575
|
label: "Transfer approver role to",
|
|
8604
|
-
value:
|
|
8605
|
-
onValueChange:
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
9576
|
+
value: approverRole,
|
|
9577
|
+
onValueChange: selectApprover,
|
|
9578
|
+
loadOption: transferRoleOptions,
|
|
9579
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9580
|
+
customLoadingText: "No results found"
|
|
9581
|
+
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9582
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9583
|
+
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9584
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9585
|
+
}, "The user You're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
8613
9586
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
8614
9587
|
closeHandler: closeDeActivateModal,
|
|
8615
9588
|
cancelLabel: "Cancel",
|
|
@@ -8635,7 +9608,115 @@ var UserList = function UserList(_ref) {
|
|
|
8635
9608
|
className: styles$5.headerText
|
|
8636
9609
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8637
9610
|
className: styles$5.description
|
|
8638
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(
|
|
9611
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9612
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9613
|
+
closeHandler: closeDeActiveModal,
|
|
9614
|
+
cancelLabel: "Cancel",
|
|
9615
|
+
submitLabel: "Deactivate safe users",
|
|
9616
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9617
|
+
customButtonLabel: "Deactivate all users",
|
|
9618
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9619
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9620
|
+
width: "640px",
|
|
9621
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9622
|
+
headerText: "Deactivate users?"
|
|
9623
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9624
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9625
|
+
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9626
|
+
color: "#9A6700",
|
|
9627
|
+
size: "14"
|
|
9628
|
+
}), /*#__PURE__*/React.createElement(IUITypography, null, "Some users are linked with multiple roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles.")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9629
|
+
className: "iui__my-15"
|
|
9630
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9631
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9632
|
+
}, "Users with multiple roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9633
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9634
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9635
|
+
var _item$data;
|
|
9636
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9637
|
+
key: index,
|
|
9638
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9639
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9640
|
+
firstName: item.first_name,
|
|
9641
|
+
lastName: item.last_name,
|
|
9642
|
+
isLetterAvatar: "true",
|
|
9643
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9644
|
+
secondaryText: item.email,
|
|
9645
|
+
letterAvatarTextColor: "black",
|
|
9646
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9647
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9648
|
+
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9649
|
+
color: "#9A6700",
|
|
9650
|
+
size: "14"
|
|
9651
|
+
}));
|
|
9652
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9653
|
+
style: {
|
|
9654
|
+
borderColor: '#E5E9ED'
|
|
9655
|
+
}
|
|
9656
|
+
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9657
|
+
className: "iui__my-15"
|
|
9658
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9659
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9660
|
+
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9661
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9662
|
+
}, "These users are not linked to any roles and can be deactivated safely."), (selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) && selectedUsersNotApprover.map(function (item, index) {
|
|
9663
|
+
var _item$data2;
|
|
9664
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9665
|
+
key: index,
|
|
9666
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9667
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9668
|
+
firstName: item.first_name,
|
|
9669
|
+
lastName: item.last_name,
|
|
9670
|
+
isLetterAvatar: "true",
|
|
9671
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9672
|
+
secondaryText: item.email,
|
|
9673
|
+
letterAvatarTextColor: "black",
|
|
9674
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9675
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9676
|
+
}));
|
|
9677
|
+
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9678
|
+
isOpen: showInviteModal,
|
|
9679
|
+
closeHandler: function closeHandler() {
|
|
9680
|
+
return toggleInviteModalClose();
|
|
9681
|
+
},
|
|
9682
|
+
cancelLabel: "Cancel",
|
|
9683
|
+
headerText: "Resend Invites?",
|
|
9684
|
+
submitLabel: "Send",
|
|
9685
|
+
submitHandler: function submitHandler() {
|
|
9686
|
+
return onResendInviteHandler();
|
|
9687
|
+
},
|
|
9688
|
+
width: "400px",
|
|
9689
|
+
modalBodyStyle: {
|
|
9690
|
+
padding: '0px'
|
|
9691
|
+
},
|
|
9692
|
+
footerStyle: {
|
|
9693
|
+
justifyContent: 'center'
|
|
9694
|
+
}
|
|
9695
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
9696
|
+
style: {
|
|
9697
|
+
display: 'flex',
|
|
9698
|
+
padding: '16px',
|
|
9699
|
+
margin: '8px 24px',
|
|
9700
|
+
border: '1px solid #FDE047',
|
|
9701
|
+
background: '#FEFCE8',
|
|
9702
|
+
borderRadius: '5px'
|
|
9703
|
+
}
|
|
9704
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
9705
|
+
style: {
|
|
9706
|
+
marginRight: '5px'
|
|
9707
|
+
}
|
|
9708
|
+
}, /*#__PURE__*/React.createElement(InviteInfoIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
9709
|
+
style: {
|
|
9710
|
+
fontSize: '14px',
|
|
9711
|
+
color: '#374151'
|
|
9712
|
+
}
|
|
9713
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9714
|
+
style: {
|
|
9715
|
+
fontSize: '14px',
|
|
9716
|
+
color: '#374151',
|
|
9717
|
+
fontWeight: 'bold'
|
|
9718
|
+
}
|
|
9719
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
8639
9720
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
8640
9721
|
closeImportUsersModal: closeImportUsersModal,
|
|
8641
9722
|
closeImportModal: closeImportModal
|
|
@@ -8644,6 +9725,12 @@ var UserList = function UserList(_ref) {
|
|
|
8644
9725
|
errMsg: hasVerificationError
|
|
8645
9726
|
}));
|
|
8646
9727
|
};
|
|
9728
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9729
|
+
var count = _ref5.count;
|
|
9730
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9731
|
+
className: styles$5.TabLabelCount
|
|
9732
|
+
}, " ", count, " ");
|
|
9733
|
+
};
|
|
8647
9734
|
var index$2 = withStore(UserList);
|
|
8648
9735
|
|
|
8649
9736
|
function Header(props) {
|
|
@@ -8737,7 +9824,6 @@ function Listview(_ref) {
|
|
|
8737
9824
|
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
8738
9825
|
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
8739
9826
|
}
|
|
8740
|
-
return 'Unassigned';
|
|
8741
9827
|
};
|
|
8742
9828
|
var columns = [{
|
|
8743
9829
|
id: 'name',
|
|
@@ -8812,8 +9898,8 @@ function Listview(_ref) {
|
|
|
8812
9898
|
}, {
|
|
8813
9899
|
id: 'no_of_users',
|
|
8814
9900
|
label: 'Number of users',
|
|
8815
|
-
width: '
|
|
8816
|
-
sortable:
|
|
9901
|
+
width: '45%',
|
|
9902
|
+
sortable: false,
|
|
8817
9903
|
cell: function cell(row) {
|
|
8818
9904
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8819
9905
|
component: "div"
|
|
@@ -8926,7 +10012,6 @@ function EditPanelDialog(_ref) {
|
|
|
8926
10012
|
dialogData = _useSelector.dialogData;
|
|
8927
10013
|
var deptHeadDetails = function deptHeadDetails(data) {
|
|
8928
10014
|
var _data$dept_head_detai;
|
|
8929
|
-
console.log(data);
|
|
8930
10015
|
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
8931
10016
|
setHead({
|
|
8932
10017
|
value: data.dept_head_details[0].id,
|
|
@@ -8945,7 +10030,11 @@ function EditPanelDialog(_ref) {
|
|
|
8945
10030
|
}, [rowData]);
|
|
8946
10031
|
var history = useHistory();
|
|
8947
10032
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8948
|
-
|
|
10033
|
+
console.log(rowData);
|
|
10034
|
+
history.push({
|
|
10035
|
+
pathname: config.routes.users.add.path,
|
|
10036
|
+
state: rowData
|
|
10037
|
+
});
|
|
8949
10038
|
};
|
|
8950
10039
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
8951
10040
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
@@ -9007,8 +10096,7 @@ function EditPanelDialog(_ref) {
|
|
|
9007
10096
|
onClick: handleAddPageNavigation,
|
|
9008
10097
|
className: styles$7.addUserButton
|
|
9009
10098
|
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9010
|
-
label: name + " name"
|
|
9011
|
-
,
|
|
10099
|
+
label: name + " name",
|
|
9012
10100
|
name: "name",
|
|
9013
10101
|
defaultValue: dialogData.data.name,
|
|
9014
10102
|
onValueChange: onValueChange,
|
|
@@ -9026,8 +10114,7 @@ function EditPanelDialog(_ref) {
|
|
|
9026
10114
|
width: '100%'
|
|
9027
10115
|
}
|
|
9028
10116
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9029
|
-
label: "Department head"
|
|
9030
|
-
,
|
|
10117
|
+
label: "Department head",
|
|
9031
10118
|
name: "name",
|
|
9032
10119
|
defaultValue: head.label,
|
|
9033
10120
|
placeholder: "",
|
|
@@ -9054,8 +10141,7 @@ function EditPanelDialog(_ref) {
|
|
|
9054
10141
|
var _value = _ref2._value;
|
|
9055
10142
|
return setHead(_value);
|
|
9056
10143
|
},
|
|
9057
|
-
loadOption: departmentHeadOptions
|
|
9058
|
-
,
|
|
10144
|
+
loadOption: departmentHeadOptions,
|
|
9059
10145
|
disableText: "Please get in touch with your administrator to change this value.",
|
|
9060
10146
|
customLoadingText: "No users found in this department",
|
|
9061
10147
|
customLoadingTextStyle: {
|
|
@@ -9260,7 +10346,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9260
10346
|
}),
|
|
9261
10347
|
isTokenVerified = _useSelector2.isTokenVerified,
|
|
9262
10348
|
hasVerificationError = _useSelector2.hasVerificationError;
|
|
9263
|
-
|
|
9264
10349
|
var onValueChange = function onValueChange(_ref2) {
|
|
9265
10350
|
var _value = _ref2._value;
|
|
9266
10351
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
@@ -9378,7 +10463,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9378
10463
|
var message = title + " deleted successfully.";
|
|
9379
10464
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9380
10465
|
};
|
|
9381
|
-
|
|
9382
10466
|
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
9383
10467
|
if (optionalParams === void 0) {
|
|
9384
10468
|
optionalParams = null;
|