@egovernments/digit-ui-module-core 1.4.0-beta1 → 1.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1626 -161
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1627 -162
- package/dist/index.modern.js.map +1 -1
- package/package.json +12 -12
package/dist/index.modern.js
CHANGED
|
@@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider } from 'react-query';
|
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, BrowserRouter } from 'react-router-dom';
|
|
5
5
|
import { useTranslation, getI18n } from 'react-i18next';
|
|
6
|
-
import { FormStep, OTPInput, CardText, CardLabelError, AppContainer,
|
|
6
|
+
import { BackButton, FormStep, OTPInput, CardText, CardLabelError, AppContainer, Toast, Loader, Dropdown, FormComposer, CardSubHeader, Card, CustomButton, SubmitBar, TopBar as TopBar$1, Hamburger, HomeIcon, LanguageIcon, LogoutIcon, EditPencilIcon, Phone, NavBar, GalleryIcon, RemoveIcon, BreadCrumb, CameraIcon, LabelFieldPair, CardLabel, TextInput, MobileNumber, ComplaintIcon, PTIcon, CaseIcon, OBPSIcon, Calender, DocumentIcon, StandaloneSearchBar, CardBasedOptions, WhatsNewCard, PageBasedInput, CardHeader, RadioButtons, SearchOnRadioButtons, Body } from '@egovernments/digit-ui-react-components';
|
|
7
7
|
import { compose, applyMiddleware, createStore, combineReducers } from 'redux';
|
|
8
8
|
import thunk from 'redux-thunk';
|
|
9
9
|
|
|
@@ -23,9 +23,11 @@ var CitizenHome = function CitizenHome(_ref) {
|
|
|
23
23
|
var showQuickPay = moduleArr.some(function (module) {
|
|
24
24
|
return module.code === "QuickPayLinks";
|
|
25
25
|
});
|
|
26
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BackButton, null), /*#__PURE__*/React.createElement("div", {
|
|
27
27
|
className: "citizenAllServiceGrid"
|
|
28
|
-
}, moduleArray.
|
|
28
|
+
}, moduleArray.filter(function (mod) {
|
|
29
|
+
return mod;
|
|
30
|
+
}).map(function (_ref4, index) {
|
|
29
31
|
var code = _ref4.code;
|
|
30
32
|
|
|
31
33
|
var Links = Digit.ComponentRegistryService.getComponent(code + "Links") || function () {
|
|
@@ -98,6 +100,22 @@ function _extends() {
|
|
|
98
100
|
return _extends.apply(this, arguments);
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
function _inheritsLoose(subClass, superClass) {
|
|
104
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
105
|
+
subClass.prototype.constructor = subClass;
|
|
106
|
+
|
|
107
|
+
_setPrototypeOf(subClass, superClass);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _setPrototypeOf(o, p) {
|
|
111
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
112
|
+
o.__proto__ = p;
|
|
113
|
+
return o;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return _setPrototypeOf(o, p);
|
|
117
|
+
}
|
|
118
|
+
|
|
101
119
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
102
120
|
if (source == null) return {};
|
|
103
121
|
var target = {};
|
|
@@ -301,7 +319,7 @@ var getFromLocation = function getFromLocation(state, searchParams) {
|
|
|
301
319
|
};
|
|
302
320
|
|
|
303
321
|
var Login = function Login(_ref) {
|
|
304
|
-
var _location$state, _location$
|
|
322
|
+
var _location$state, _location$state7;
|
|
305
323
|
|
|
306
324
|
var stateCode = _ref.stateCode,
|
|
307
325
|
_ref$isUserRegistered = _ref.isUserRegistered,
|
|
@@ -350,7 +368,6 @@ var Login = function Login(_ref) {
|
|
|
350
368
|
}
|
|
351
369
|
|
|
352
370
|
errorTimeout = setTimeout(function () {
|
|
353
|
-
console.error("clearing err");
|
|
354
371
|
setError("");
|
|
355
372
|
}, 5000);
|
|
356
373
|
setErrorTO(errorTimeout);
|
|
@@ -431,14 +448,18 @@ var Login = function Login(_ref) {
|
|
|
431
448
|
});
|
|
432
449
|
return;
|
|
433
450
|
} else {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
451
|
+
if (!(location.state && location.state.role === 'FSM_DSO')) {
|
|
452
|
+
history.push("/digit-ui/citizen/register/name", {
|
|
453
|
+
from: getFromLocation(location.state, searchParams),
|
|
454
|
+
data: data
|
|
455
|
+
});
|
|
456
|
+
}
|
|
438
457
|
}
|
|
439
458
|
|
|
440
459
|
if ((_location$state4 = location.state) !== null && _location$state4 !== void 0 && _location$state4.role) {
|
|
441
|
-
|
|
460
|
+
var _location$state5;
|
|
461
|
+
|
|
462
|
+
setError(((_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.role) === "FSM_DSO" ? t("ES_ERROR_DSO_LOGIN") : "User not registered.");
|
|
442
463
|
}
|
|
443
464
|
});
|
|
444
465
|
} else {
|
|
@@ -502,13 +523,13 @@ var Login = function Login(_ref) {
|
|
|
502
523
|
userType: getUserType()
|
|
503
524
|
};
|
|
504
525
|
return Promise.resolve(Digit.UserService.authenticate(requestData)).then(function (_ref5) {
|
|
505
|
-
var _location$
|
|
526
|
+
var _location$state6, _window, _window$globalConfigs;
|
|
506
527
|
|
|
507
528
|
var ResponseInfo = _ref5.ResponseInfo,
|
|
508
529
|
info = _ref5.UserRequest,
|
|
509
530
|
tokens = _objectWithoutPropertiesLoose(_ref5, _excluded);
|
|
510
531
|
|
|
511
|
-
if ((_location$
|
|
532
|
+
if ((_location$state6 = location.state) !== null && _location$state6 !== void 0 && _location$state6.role) {
|
|
512
533
|
var roleInfo = info.roles.find(function (userRole) {
|
|
513
534
|
return userRole.code === location.state.role;
|
|
514
535
|
});
|
|
@@ -560,9 +581,8 @@ var Login = function Login(_ref) {
|
|
|
560
581
|
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
561
582
|
}
|
|
562
583
|
}();
|
|
563
|
-
}, function (
|
|
584
|
+
}, function () {
|
|
564
585
|
setIsOtpValid(false);
|
|
565
|
-
console.error(err);
|
|
566
586
|
}));
|
|
567
587
|
} catch (e) {
|
|
568
588
|
return Promise.reject(e);
|
|
@@ -620,7 +640,7 @@ var Login = function Login(_ref) {
|
|
|
620
640
|
config: stepItems[0],
|
|
621
641
|
mobileNumber: params.mobileNumber || "",
|
|
622
642
|
onMobileChange: handleMobileChange,
|
|
623
|
-
showRegisterLink: isUserRegistered && !((_location$
|
|
643
|
+
showRegisterLink: isUserRegistered && !((_location$state7 = location.state) !== null && _location$state7 !== void 0 && _location$state7.role),
|
|
624
644
|
t: t
|
|
625
645
|
})), /*#__PURE__*/React.createElement(Route, {
|
|
626
646
|
path: path + "/otp"
|
|
@@ -1793,11 +1813,27 @@ var Header = function Header() {
|
|
|
1793
1813
|
|
|
1794
1814
|
var _excluded$1 = ["UserRequest"];
|
|
1795
1815
|
|
|
1816
|
+
var setEmployeeDetail = function setEmployeeDetail(userObject, token) {
|
|
1817
|
+
var _JSON$parse;
|
|
1818
|
+
|
|
1819
|
+
var locale = ((_JSON$parse = JSON.parse(sessionStorage.getItem("Digit.locale"))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.value) || "en_IN";
|
|
1820
|
+
localStorage.setItem("Employee.tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
|
|
1821
|
+
localStorage.setItem("tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
|
|
1822
|
+
localStorage.setItem("citizen.userRequestObject", JSON.stringify(userObject));
|
|
1823
|
+
localStorage.setItem("locale", locale);
|
|
1824
|
+
localStorage.setItem("Employee.locale", locale);
|
|
1825
|
+
localStorage.setItem("token", token);
|
|
1826
|
+
localStorage.setItem("Employee.token", token);
|
|
1827
|
+
localStorage.setItem("user-info", JSON.stringify(userObject));
|
|
1828
|
+
localStorage.setItem("Employee.user-info", JSON.stringify(userObject));
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1796
1831
|
var Login$1 = function Login(_ref) {
|
|
1797
|
-
var
|
|
1832
|
+
var _window3, _window3$globalConfig, _window3$globalConfig2;
|
|
1798
1833
|
|
|
1799
1834
|
var propsConfig = _ref.config,
|
|
1800
|
-
t = _ref.t
|
|
1835
|
+
t = _ref.t,
|
|
1836
|
+
isDisabled = _ref.isDisabled;
|
|
1801
1837
|
|
|
1802
1838
|
var _Digit$Hooks$useTenan = Digit.Hooks.useTenants(),
|
|
1803
1839
|
cities = _Digit$Hooks$useTenan.data,
|
|
@@ -1814,26 +1850,60 @@ var Login$1 = function Login(_ref) {
|
|
|
1814
1850
|
showToast = _useState2[0],
|
|
1815
1851
|
setShowToast = _useState2[1];
|
|
1816
1852
|
|
|
1853
|
+
var _useState3 = useState(false),
|
|
1854
|
+
setDisable = _useState3[1];
|
|
1855
|
+
|
|
1817
1856
|
var history = useHistory();
|
|
1818
1857
|
useEffect(function () {
|
|
1819
|
-
var
|
|
1858
|
+
var _user$info, _user$info$roles, _user$info2, _user$info2$roles, _window, _window$location, _window$location$href, _user$info3, _user$info4, _user$info4$roles, _user$info5, _user$info6, _user$info6$roles;
|
|
1820
1859
|
|
|
1821
1860
|
if (!user) {
|
|
1822
1861
|
return;
|
|
1823
1862
|
}
|
|
1824
1863
|
|
|
1864
|
+
Digit.SessionStorage.set("citizen.userRequestObject", user);
|
|
1865
|
+
var filteredRoles = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.filter(function (role) {
|
|
1866
|
+
return role.tenantId === Digit.SessionStorage.get("Employee.tenantId");
|
|
1867
|
+
});
|
|
1868
|
+
if ((user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : (_user$info2$roles = _user$info2.roles) === null || _user$info2$roles === void 0 ? void 0 : _user$info2$roles.length) > 0) user.info.roles = filteredRoles;
|
|
1825
1869
|
Digit.UserService.setUser(user);
|
|
1826
|
-
|
|
1870
|
+
setEmployeeDetail(user === null || user === void 0 ? void 0 : user.info, user === null || user === void 0 ? void 0 : user.access_token);
|
|
1871
|
+
var redirectPath = "/digit-ui/employee";
|
|
1872
|
+
|
|
1873
|
+
if ((_window = window) !== null && _window !== void 0 && (_window$location = _window.location) !== null && _window$location !== void 0 && (_window$location$href = _window$location.href) !== null && _window$location$href !== void 0 && _window$location$href.includes("from=")) {
|
|
1874
|
+
var _window2, _window2$location, _window2$location$hre, _window2$location$hre2;
|
|
1875
|
+
|
|
1876
|
+
redirectPath = decodeURIComponent((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$location = _window2.location) === null || _window2$location === void 0 ? void 0 : (_window2$location$hre = _window2$location.href) === null || _window2$location$hre === void 0 ? void 0 : (_window2$location$hre2 = _window2$location$hre.split("from=")) === null || _window2$location$hre2 === void 0 ? void 0 : _window2$location$hre2[1]) || "/digit-ui/employee";
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
if (user !== null && user !== void 0 && (_user$info3 = user.info) !== null && _user$info3 !== void 0 && _user$info3.roles && user !== null && user !== void 0 && (_user$info4 = user.info) !== null && _user$info4 !== void 0 && (_user$info4$roles = _user$info4.roles) !== null && _user$info4$roles !== void 0 && _user$info4$roles.every(function (e) {
|
|
1880
|
+
return e.code === "NATADMIN";
|
|
1881
|
+
})) {
|
|
1882
|
+
redirectPath = "/digit-ui/employee/payment/integration/dss/NURT_DASHBOARD";
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
if (user !== null && user !== void 0 && (_user$info5 = user.info) !== null && _user$info5 !== void 0 && _user$info5.roles && user !== null && user !== void 0 && (_user$info6 = user.info) !== null && _user$info6 !== void 0 && (_user$info6$roles = _user$info6.roles) !== null && _user$info6$roles !== void 0 && _user$info6$roles.every(function (e) {
|
|
1886
|
+
return e.code === "STADMIN";
|
|
1887
|
+
})) {
|
|
1888
|
+
redirectPath = "/digit-ui/employee/payment/integration/dss/home";
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1827
1891
|
history.replace(redirectPath);
|
|
1828
1892
|
}, [user]);
|
|
1829
1893
|
|
|
1830
1894
|
var onLogin = function onLogin(data) {
|
|
1831
1895
|
try {
|
|
1896
|
+
var _temp3 = function _temp3() {
|
|
1897
|
+
setDisable(false);
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1832
1900
|
if (!data.city) {
|
|
1833
1901
|
alert("Please Select City!");
|
|
1834
1902
|
return Promise.resolve();
|
|
1835
1903
|
}
|
|
1836
1904
|
|
|
1905
|
+
setDisable(true);
|
|
1906
|
+
|
|
1837
1907
|
var requestData = _extends({}, data, {
|
|
1838
1908
|
userType: "EMPLOYEE"
|
|
1839
1909
|
});
|
|
@@ -1841,7 +1911,7 @@ var Login$1 = function Login(_ref) {
|
|
|
1841
1911
|
requestData.tenantId = data.city.code;
|
|
1842
1912
|
delete requestData.city;
|
|
1843
1913
|
|
|
1844
|
-
var
|
|
1914
|
+
var _temp4 = _catch(function () {
|
|
1845
1915
|
return Promise.resolve(Digit.UserService.authenticate(requestData)).then(function (_ref3) {
|
|
1846
1916
|
var info = _ref3.UserRequest,
|
|
1847
1917
|
tokens = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
|
|
@@ -1858,7 +1928,7 @@ var Login$1 = function Login(_ref) {
|
|
|
1858
1928
|
setTimeout(closeToast, 5000);
|
|
1859
1929
|
});
|
|
1860
1930
|
|
|
1861
|
-
return Promise.resolve(
|
|
1931
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
1862
1932
|
} catch (e) {
|
|
1863
1933
|
return Promise.reject(e);
|
|
1864
1934
|
}
|
|
@@ -1921,6 +1991,7 @@ var Login$1 = function Login(_ref) {
|
|
|
1921
1991
|
}
|
|
1922
1992
|
})), /*#__PURE__*/React.createElement(FormComposer, {
|
|
1923
1993
|
onSubmit: onLogin,
|
|
1994
|
+
isDisabled: isDisabled,
|
|
1924
1995
|
noBoxShadow: true,
|
|
1925
1996
|
inline: true,
|
|
1926
1997
|
submitInForm: true,
|
|
@@ -1936,26 +2007,29 @@ var Login$1 = function Login(_ref) {
|
|
|
1936
2007
|
margin: "auto",
|
|
1937
2008
|
minWidth: "408px"
|
|
1938
2009
|
},
|
|
1939
|
-
className: "loginFormStyleEmployee"
|
|
2010
|
+
className: "loginFormStyleEmployee",
|
|
2011
|
+
buttonStyle: {
|
|
2012
|
+
maxWidth: "100%"
|
|
2013
|
+
}
|
|
1940
2014
|
}, /*#__PURE__*/React.createElement(Header, null)), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
1941
2015
|
error: true,
|
|
1942
2016
|
label: t(showToast),
|
|
1943
2017
|
onClose: closeToast
|
|
1944
2018
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1945
|
-
className: "employee-home-footer",
|
|
2019
|
+
className: "employee-login-home-footer",
|
|
1946
2020
|
style: {
|
|
1947
2021
|
backgroundColor: "unset"
|
|
1948
2022
|
}
|
|
1949
2023
|
}, /*#__PURE__*/React.createElement("img", {
|
|
1950
2024
|
alt: "Powered by DIGIT",
|
|
1951
|
-
src: (
|
|
2025
|
+
src: (_window3 = window) === null || _window3 === void 0 ? void 0 : (_window3$globalConfig = _window3.globalConfigs) === null || _window3$globalConfig === void 0 ? void 0 : (_window3$globalConfig2 = _window3$globalConfig.getConfig) === null || _window3$globalConfig2 === void 0 ? void 0 : _window3$globalConfig2.call(_window3$globalConfig, "DIGIT_FOOTER_BW"),
|
|
1952
2026
|
style: {
|
|
1953
2027
|
cursor: "pointer"
|
|
1954
2028
|
},
|
|
1955
2029
|
onClick: function onClick() {
|
|
1956
|
-
var
|
|
2030
|
+
var _window4, _window4$globalConfig, _window4$globalConfig2;
|
|
1957
2031
|
|
|
1958
|
-
window.open((
|
|
2032
|
+
window.open((_window4 = window) === null || _window4 === void 0 ? void 0 : (_window4$globalConfig = _window4.globalConfigs) === null || _window4$globalConfig === void 0 ? void 0 : (_window4$globalConfig2 = _window4$globalConfig.getConfig) === null || _window4$globalConfig2 === void 0 ? void 0 : _window4$globalConfig2.call(_window4$globalConfig, "DIGIT_HOME_URL"), "_blank").focus();
|
|
1959
2033
|
}
|
|
1960
2034
|
}), " "));
|
|
1961
2035
|
};
|
|
@@ -2501,8 +2575,9 @@ var LanguageSelection = function LanguageSelection() {
|
|
|
2501
2575
|
}), /*#__PURE__*/React.createElement("p", null, t("TENANT_TENANTS_" + (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.code.toUpperCase())))), /*#__PURE__*/React.createElement("div", {
|
|
2502
2576
|
className: "language-selector",
|
|
2503
2577
|
style: {
|
|
2504
|
-
justifyContent: "space-
|
|
2505
|
-
marginBottom: "24px"
|
|
2578
|
+
justifyContent: "space-around",
|
|
2579
|
+
marginBottom: "24px",
|
|
2580
|
+
padding: "0 5%"
|
|
2506
2581
|
}
|
|
2507
2582
|
}, languages.map(function (language, index) {
|
|
2508
2583
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -2560,7 +2635,7 @@ var AppModules = function AppModules(_ref) {
|
|
|
2560
2635
|
var location = useLocation();
|
|
2561
2636
|
var user = Digit.UserService.getUser();
|
|
2562
2637
|
|
|
2563
|
-
if (!user) {
|
|
2638
|
+
if (!user || !(user !== null && user !== void 0 && user.access_token) || !(user !== null && user !== void 0 && user.info)) {
|
|
2564
2639
|
return /*#__PURE__*/React.createElement(Redirect, {
|
|
2565
2640
|
to: {
|
|
2566
2641
|
pathname: "/digit-ui/employee/user/login",
|
|
@@ -2606,6 +2681,169 @@ var AppModules = function AppModules(_ref) {
|
|
|
2606
2681
|
}))));
|
|
2607
2682
|
};
|
|
2608
2683
|
|
|
2684
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
2685
|
+
_inheritsLoose(ErrorBoundary, _React$Component);
|
|
2686
|
+
|
|
2687
|
+
function ErrorBoundary(props) {
|
|
2688
|
+
var _this;
|
|
2689
|
+
|
|
2690
|
+
_this = _React$Component.call(this, props) || this;
|
|
2691
|
+
_this.state = {
|
|
2692
|
+
error: null,
|
|
2693
|
+
errorStack: null,
|
|
2694
|
+
hasError: false
|
|
2695
|
+
};
|
|
2696
|
+
return _this;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {
|
|
2700
|
+
return {
|
|
2701
|
+
error: error === null || error === void 0 ? void 0 : error.message,
|
|
2702
|
+
hasError: true,
|
|
2703
|
+
errorStack: error === null || error === void 0 ? void 0 : error.stack
|
|
2704
|
+
};
|
|
2705
|
+
};
|
|
2706
|
+
|
|
2707
|
+
var _proto = ErrorBoundary.prototype;
|
|
2708
|
+
|
|
2709
|
+
_proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
|
|
2710
|
+
this.setState({
|
|
2711
|
+
error: error === null || error === void 0 ? void 0 : error.message,
|
|
2712
|
+
hasError: true,
|
|
2713
|
+
errorStack: error === null || error === void 0 ? void 0 : error.stack
|
|
2714
|
+
});
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2717
|
+
_proto.render = function render() {
|
|
2718
|
+
if (this.state.hasError) {
|
|
2719
|
+
var _this$state, _this$state2, _this$state3;
|
|
2720
|
+
|
|
2721
|
+
console.error("UI-error", (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.error);
|
|
2722
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2723
|
+
className: "error-boundary"
|
|
2724
|
+
}, /*#__PURE__*/React.createElement("summary", null, "Something went wrong"), /*#__PURE__*/React.createElement("details", {
|
|
2725
|
+
style: {
|
|
2726
|
+
whiteSpace: "pre-wrap"
|
|
2727
|
+
}
|
|
2728
|
+
}, ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.errorStack) && this.state.errorStack.toString().substring(0, 600), (_this$state3 = this.state) === null || _this$state3 === void 0 ? void 0 : _this$state3.error));
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
return this.props.children;
|
|
2732
|
+
};
|
|
2733
|
+
|
|
2734
|
+
return ErrorBoundary;
|
|
2735
|
+
}(React.Component);
|
|
2736
|
+
|
|
2737
|
+
var stringReplaceAll = function stringReplaceAll(str, searcher, replaceWith) {
|
|
2738
|
+
if (str === void 0) {
|
|
2739
|
+
str = "";
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
if (searcher === void 0) {
|
|
2743
|
+
searcher = "";
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
if (replaceWith === void 0) {
|
|
2747
|
+
replaceWith = "";
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
if (searcher == "") return str;
|
|
2751
|
+
|
|
2752
|
+
while ((_str = str) !== null && _str !== void 0 && _str.includes(searcher)) {
|
|
2753
|
+
var _str, _str2;
|
|
2754
|
+
|
|
2755
|
+
str = (_str2 = str) === null || _str2 === void 0 ? void 0 : _str2.replace(searcher, replaceWith);
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
return str;
|
|
2759
|
+
};
|
|
2760
|
+
|
|
2761
|
+
var ChangeCity = function ChangeCity(prop) {
|
|
2762
|
+
var _stringReplaceAll2;
|
|
2763
|
+
|
|
2764
|
+
var _useState = useState(null),
|
|
2765
|
+
dropDownData = _useState[0],
|
|
2766
|
+
setDropDownData = _useState[1];
|
|
2767
|
+
|
|
2768
|
+
var _useState2 = useState([]),
|
|
2769
|
+
selectCityData = _useState2[0],
|
|
2770
|
+
setSelectCityData = _useState2[1];
|
|
2771
|
+
|
|
2772
|
+
var _useState3 = useState([]);
|
|
2773
|
+
|
|
2774
|
+
var history = useHistory();
|
|
2775
|
+
var selectedCities = [];
|
|
2776
|
+
|
|
2777
|
+
var handleChangeCity = function handleChangeCity(city) {
|
|
2778
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
|
|
2779
|
+
|
|
2780
|
+
var loggedInData = Digit.SessionStorage.get("citizen.userRequestObject");
|
|
2781
|
+
var filteredRoles = (_Digit$SessionStorage = Digit.SessionStorage.get("citizen.userRequestObject")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.filter(function (role) {
|
|
2782
|
+
return role.tenantId === city.value;
|
|
2783
|
+
});
|
|
2784
|
+
|
|
2785
|
+
if ((filteredRoles === null || filteredRoles === void 0 ? void 0 : filteredRoles.length) > 0) {
|
|
2786
|
+
loggedInData.info.roles = filteredRoles;
|
|
2787
|
+
loggedInData.info.tenantId = city === null || city === void 0 ? void 0 : city.value;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
Digit.SessionStorage.set("Employee.tenantId", city === null || city === void 0 ? void 0 : city.value);
|
|
2791
|
+
Digit.UserService.setUser(loggedInData);
|
|
2792
|
+
setDropDownData(city);
|
|
2793
|
+
|
|
2794
|
+
if (window.location.href.includes("/digit-ui/employee/")) {
|
|
2795
|
+
var _location$state;
|
|
2796
|
+
|
|
2797
|
+
var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/digit-ui/employee";
|
|
2798
|
+
history.replace(redirectPath);
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
window.location.reload();
|
|
2802
|
+
};
|
|
2803
|
+
|
|
2804
|
+
useEffect(function () {
|
|
2805
|
+
var _userloggedValues$inf, _userloggedValues$inf2;
|
|
2806
|
+
|
|
2807
|
+
var userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject");
|
|
2808
|
+
var teantsArray = [],
|
|
2809
|
+
filteredArray = [];
|
|
2810
|
+
userloggedValues === null || userloggedValues === void 0 ? void 0 : (_userloggedValues$inf = userloggedValues.info) === null || _userloggedValues$inf === void 0 ? void 0 : (_userloggedValues$inf2 = _userloggedValues$inf.roles) === null || _userloggedValues$inf2 === void 0 ? void 0 : _userloggedValues$inf2.forEach(function (role) {
|
|
2811
|
+
return teantsArray.push(role.tenantId);
|
|
2812
|
+
});
|
|
2813
|
+
var unique = teantsArray.filter(function (item, i, ar) {
|
|
2814
|
+
return ar.indexOf(item) === i;
|
|
2815
|
+
});
|
|
2816
|
+
unique === null || unique === void 0 ? void 0 : unique.forEach(function (uniCode) {
|
|
2817
|
+
var _stringReplaceAll;
|
|
2818
|
+
|
|
2819
|
+
filteredArray.push({
|
|
2820
|
+
label: prop === null || prop === void 0 ? void 0 : prop.t("TENANT_TENANTS_" + ((_stringReplaceAll = stringReplaceAll(uniCode, ".", "_")) === null || _stringReplaceAll === void 0 ? void 0 : _stringReplaceAll.toUpperCase())),
|
|
2821
|
+
value: uniCode
|
|
2822
|
+
});
|
|
2823
|
+
});
|
|
2824
|
+
selectedCities = filteredArray === null || filteredArray === void 0 ? void 0 : filteredArray.filter(function (select) {
|
|
2825
|
+
return select.value == Digit.SessionStorage.get("Employee.tenantId");
|
|
2826
|
+
});
|
|
2827
|
+
setSelectCityData(filteredArray);
|
|
2828
|
+
}, [dropDownData]);
|
|
2829
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2830
|
+
style: prop !== null && prop !== void 0 && prop.mobileView ? {
|
|
2831
|
+
color: "#767676"
|
|
2832
|
+
} : {}
|
|
2833
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
2834
|
+
option: selectCityData,
|
|
2835
|
+
selected: selectCityData.find(function (cityValue) {
|
|
2836
|
+
return cityValue.value === (dropDownData === null || dropDownData === void 0 ? void 0 : dropDownData.value);
|
|
2837
|
+
}),
|
|
2838
|
+
optionKey: "label",
|
|
2839
|
+
select: handleChangeCity,
|
|
2840
|
+
freeze: true,
|
|
2841
|
+
customSelector: /*#__PURE__*/React.createElement("label", {
|
|
2842
|
+
className: "cp"
|
|
2843
|
+
}, prop === null || prop === void 0 ? void 0 : prop.t("TENANT_TENANTS_" + ((_stringReplaceAll2 = stringReplaceAll(Digit.SessionStorage.get("Employee.tenantId"), ".", "_")) === null || _stringReplaceAll2 === void 0 ? void 0 : _stringReplaceAll2.toUpperCase())))
|
|
2844
|
+
}));
|
|
2845
|
+
};
|
|
2846
|
+
|
|
2609
2847
|
var ChangeLanguage = function ChangeLanguage(prop) {
|
|
2610
2848
|
var isDropdown = prop.dropdown || false;
|
|
2611
2849
|
|
|
@@ -2676,7 +2914,7 @@ var TextToImg = function TextToImg(props) {
|
|
|
2676
2914
|
};
|
|
2677
2915
|
|
|
2678
2916
|
var TopBar = function TopBar(_ref) {
|
|
2679
|
-
var
|
|
2917
|
+
var _userDetails$info2, _cityDetails$city, _cityDetails$city2, _stateInfo$code, _userDetails$info3, _userDetails$info4, _userDetails$info4$us;
|
|
2680
2918
|
|
|
2681
2919
|
var t = _ref.t,
|
|
2682
2920
|
stateInfo = _ref.stateInfo,
|
|
@@ -2691,7 +2929,40 @@ var TopBar = function TopBar(_ref) {
|
|
|
2691
2929
|
logoUrl = _ref.logoUrl,
|
|
2692
2930
|
_ref$showLanguageChan = _ref.showLanguageChange,
|
|
2693
2931
|
showLanguageChange = _ref$showLanguageChan === void 0 ? true : _ref$showLanguageChan;
|
|
2694
|
-
|
|
2932
|
+
|
|
2933
|
+
var _React$useState = React.useState(null),
|
|
2934
|
+
profilePic = _React$useState[0],
|
|
2935
|
+
setProfilePic = _React$useState[1];
|
|
2936
|
+
|
|
2937
|
+
React.useEffect(function () {
|
|
2938
|
+
try {
|
|
2939
|
+
var _userDetails$info;
|
|
2940
|
+
|
|
2941
|
+
var tenant = Digit.ULBService.getCurrentTenantId();
|
|
2942
|
+
var uuid = userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.uuid;
|
|
2943
|
+
|
|
2944
|
+
var _temp2 = function () {
|
|
2945
|
+
if (uuid) {
|
|
2946
|
+
return Promise.resolve(Digit.UserService.userSearch(tenant, {
|
|
2947
|
+
uuid: [uuid]
|
|
2948
|
+
}, {})).then(function (usersResponse) {
|
|
2949
|
+
if (usersResponse && usersResponse.user && usersResponse.user.length) {
|
|
2950
|
+
var _userDetails$photo;
|
|
2951
|
+
|
|
2952
|
+
var _userDetails = usersResponse.user[0];
|
|
2953
|
+
var thumbs = _userDetails === null || _userDetails === void 0 ? void 0 : (_userDetails$photo = _userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
|
|
2954
|
+
setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
|
|
2955
|
+
}
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
}();
|
|
2959
|
+
|
|
2960
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
2961
|
+
} catch (e) {
|
|
2962
|
+
return Promise.reject(e);
|
|
2963
|
+
}
|
|
2964
|
+
}, [profilePic !== null, userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info2 = userDetails.info) === null || _userDetails$info2 === void 0 ? void 0 : _userDetails$info2.uuid]);
|
|
2965
|
+
var CitizenHomePageTenantId = Digit.ULBService.getCitizenCurrentTenant();
|
|
2695
2966
|
var history = useHistory();
|
|
2696
2967
|
|
|
2697
2968
|
var _useLocation = useLocation(),
|
|
@@ -2764,7 +3035,14 @@ var TopBar = function TopBar(_ref) {
|
|
|
2764
3035
|
}) : null, /*#__PURE__*/React.createElement("img", {
|
|
2765
3036
|
className: "city",
|
|
2766
3037
|
src: loggedin ? cityDetails === null || cityDetails === void 0 ? void 0 : cityDetails.logoId : stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.statelogo
|
|
2767
|
-
}),
|
|
3038
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
3039
|
+
style: {
|
|
3040
|
+
display: "flex",
|
|
3041
|
+
alignItems: "center",
|
|
3042
|
+
justifyContent: "space-between",
|
|
3043
|
+
width: "100%"
|
|
3044
|
+
}
|
|
3045
|
+
}, loggedin && (cityDetails !== null && cityDetails !== void 0 && (_cityDetails$city = cityDetails.city) !== null && _cityDetails$city !== void 0 && _cityDetails$city.ulbGrade ? /*#__PURE__*/React.createElement("p", {
|
|
2768
3046
|
className: "ulb",
|
|
2769
3047
|
style: mobileView ? {
|
|
2770
3048
|
fontSize: "14px",
|
|
@@ -2782,10 +3060,15 @@ var TopBar = function TopBar(_ref) {
|
|
|
2782
3060
|
}, t("MYCITY_" + (stateInfo === null || stateInfo === void 0 ? void 0 : (_stateInfo$code = stateInfo.code) === null || _stateInfo$code === void 0 ? void 0 : _stateInfo$code.toUpperCase()) + "_LABEL"), " ", t("MYCITY_STATECODE_LABEL")), !mobileView && /*#__PURE__*/React.createElement("div", {
|
|
2783
3061
|
className: mobileView ? "right" : "flex-right right w-80 column-gap-15",
|
|
2784
3062
|
style: !loggedin ? {
|
|
2785
|
-
width:
|
|
3063
|
+
width: "80%"
|
|
2786
3064
|
} : {}
|
|
2787
3065
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2788
3066
|
className: "left"
|
|
3067
|
+
}, !window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && /*#__PURE__*/React.createElement(ChangeCity, {
|
|
3068
|
+
dropdown: true,
|
|
3069
|
+
t: t
|
|
3070
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3071
|
+
className: "left"
|
|
2789
3072
|
}, showLanguageChange && /*#__PURE__*/React.createElement(ChangeLanguage, {
|
|
2790
3073
|
dropdown: true
|
|
2791
3074
|
})), (userDetails === null || userDetails === void 0 ? void 0 : userDetails.access_token) && /*#__PURE__*/React.createElement("div", {
|
|
@@ -2794,7 +3077,7 @@ var TopBar = function TopBar(_ref) {
|
|
|
2794
3077
|
option: userOptions,
|
|
2795
3078
|
optionKey: "name",
|
|
2796
3079
|
select: handleUserDropdownSelection,
|
|
2797
|
-
showArrow:
|
|
3080
|
+
showArrow: true,
|
|
2798
3081
|
freeze: true,
|
|
2799
3082
|
style: mobileView ? {
|
|
2800
3083
|
right: 0
|
|
@@ -2802,13 +3085,20 @@ var TopBar = function TopBar(_ref) {
|
|
|
2802
3085
|
optionCardStyles: {
|
|
2803
3086
|
overflow: "revert"
|
|
2804
3087
|
},
|
|
2805
|
-
customSelector: /*#__PURE__*/React.createElement(TextToImg, {
|
|
2806
|
-
name: (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$
|
|
3088
|
+
customSelector: profilePic == null ? /*#__PURE__*/React.createElement(TextToImg, {
|
|
3089
|
+
name: (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info3 = userDetails.info) === null || _userDetails$info3 === void 0 ? void 0 : _userDetails$info3.name) || (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info4 = userDetails.info) === null || _userDetails$info4 === void 0 ? void 0 : (_userDetails$info4$us = _userDetails$info4.userInfo) === null || _userDetails$info4$us === void 0 ? void 0 : _userDetails$info4$us.name) || "Employee"
|
|
3090
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
3091
|
+
src: profilePic,
|
|
3092
|
+
style: {
|
|
3093
|
+
height: "48px",
|
|
3094
|
+
width: "48px",
|
|
3095
|
+
borderRadius: "50%"
|
|
3096
|
+
}
|
|
2807
3097
|
})
|
|
2808
3098
|
})), /*#__PURE__*/React.createElement("img", {
|
|
2809
3099
|
className: "state",
|
|
2810
3100
|
src: logoUrl
|
|
2811
|
-
})));
|
|
3101
|
+
}))));
|
|
2812
3102
|
};
|
|
2813
3103
|
|
|
2814
3104
|
var SideBarMenu = function SideBarMenu(t, closeSidebar, redirectToLoginPage, isEmployee) {
|
|
@@ -2846,30 +3136,69 @@ var SideBarMenu = function SideBarMenu(t, closeSidebar, redirectToLoginPage, isE
|
|
|
2846
3136
|
var defaultImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "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";
|
|
2847
3137
|
|
|
2848
3138
|
var Profile = function Profile(_ref) {
|
|
2849
|
-
var info = _ref.info
|
|
3139
|
+
var info = _ref.info,
|
|
3140
|
+
t = _ref.t;
|
|
3141
|
+
|
|
3142
|
+
var _React$useState = React.useState(null),
|
|
3143
|
+
profilePic = _React$useState[0],
|
|
3144
|
+
setProfilePic = _React$useState[1];
|
|
3145
|
+
|
|
3146
|
+
React.useEffect(function () {
|
|
3147
|
+
try {
|
|
3148
|
+
var tenant = Digit.ULBService.getCurrentTenantId();
|
|
3149
|
+
var uuid = info === null || info === void 0 ? void 0 : info.uuid;
|
|
3150
|
+
|
|
3151
|
+
var _temp2 = function () {
|
|
3152
|
+
if (uuid) {
|
|
3153
|
+
return Promise.resolve(Digit.UserService.userSearch(tenant, {
|
|
3154
|
+
uuid: [uuid]
|
|
3155
|
+
}, {})).then(function (usersResponse) {
|
|
3156
|
+
if (usersResponse && usersResponse.user && usersResponse.user.length) {
|
|
3157
|
+
var _userDetails$photo;
|
|
3158
|
+
|
|
3159
|
+
var userDetails = usersResponse.user[0];
|
|
3160
|
+
var thumbs = userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
|
|
3161
|
+
setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
|
|
3162
|
+
}
|
|
3163
|
+
});
|
|
3164
|
+
}
|
|
3165
|
+
}();
|
|
3166
|
+
|
|
3167
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
3168
|
+
} catch (e) {
|
|
3169
|
+
return Promise.reject(e);
|
|
3170
|
+
}
|
|
3171
|
+
}, [profilePic !== null]);
|
|
2850
3172
|
return /*#__PURE__*/React.createElement("div", {
|
|
2851
3173
|
className: "profile-section"
|
|
2852
3174
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2853
3175
|
className: "imageloader imageloader-loaded"
|
|
2854
3176
|
}, /*#__PURE__*/React.createElement("img", {
|
|
2855
3177
|
className: "img-responsive img-circle img-Profile",
|
|
2856
|
-
src: defaultImage
|
|
3178
|
+
src: profilePic ? profilePic : defaultImage,
|
|
3179
|
+
style: {
|
|
3180
|
+
objectFit: "cover",
|
|
3181
|
+
objectPosition: "center"
|
|
3182
|
+
}
|
|
2857
3183
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2858
3184
|
id: "profile-name",
|
|
2859
3185
|
className: "label-container name-Profile"
|
|
2860
3186
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2861
3187
|
className: "label-text"
|
|
2862
|
-
}, " ", info.name, " ")), /*#__PURE__*/React.createElement("div", {
|
|
3188
|
+
}, " ", info === null || info === void 0 ? void 0 : info.name, " ")), /*#__PURE__*/React.createElement("div", {
|
|
2863
3189
|
id: "profile-location",
|
|
2864
3190
|
className: "label-container loc-Profile"
|
|
2865
3191
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2866
3192
|
className: "label-text"
|
|
2867
|
-
}, " ", info === null || info === void 0 ? void 0 : info.mobileNumber, " ")), info.emailId && /*#__PURE__*/React.createElement("div", {
|
|
3193
|
+
}, " ", info === null || info === void 0 ? void 0 : info.mobileNumber, " ")), (info === null || info === void 0 ? void 0 : info.emailId) && /*#__PURE__*/React.createElement("div", {
|
|
2868
3194
|
id: "profile-emailid",
|
|
2869
3195
|
className: "label-container loc-Profile"
|
|
2870
3196
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2871
3197
|
className: "label-text"
|
|
2872
|
-
}, " ", info.emailId, " ")))
|
|
3198
|
+
}, " ", info.emailId, " ")), window.location.href.includes("/employee") && !window.location.href.includes("/employee/user/login") && !window.location.href.includes("employee/user/language-selection") && /*#__PURE__*/React.createElement(ChangeCity, {
|
|
3199
|
+
t: t,
|
|
3200
|
+
mobileView: true
|
|
3201
|
+
}));
|
|
2873
3202
|
};
|
|
2874
3203
|
|
|
2875
3204
|
var PoweredBy = function PoweredBy() {
|
|
@@ -2917,6 +3246,14 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
|
|
|
2917
3246
|
toggleSidebar(false);
|
|
2918
3247
|
};
|
|
2919
3248
|
|
|
3249
|
+
var tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3250
|
+
|
|
3251
|
+
var showProfilePage = function showProfilePage() {
|
|
3252
|
+
var redirectUrl = isEmployee ? "/digit-ui/employee/user/profile" : "/digit-ui/citizen/user/profile";
|
|
3253
|
+
history.push(redirectUrl);
|
|
3254
|
+
closeSidebar();
|
|
3255
|
+
};
|
|
3256
|
+
|
|
2920
3257
|
var redirectToLoginPage = function redirectToLoginPage() {
|
|
2921
3258
|
history.push("/digit-ui/citizen/login");
|
|
2922
3259
|
closeSidebar();
|
|
@@ -2927,13 +3264,25 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
|
|
|
2927
3264
|
|
|
2928
3265
|
if (isFetched && user && user.access_token) {
|
|
2929
3266
|
profileItem = /*#__PURE__*/React.createElement(Profile, {
|
|
2930
|
-
info: user.info,
|
|
2931
|
-
stateName: stateInfo.name
|
|
3267
|
+
info: user === null || user === void 0 ? void 0 : user.info,
|
|
3268
|
+
stateName: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.name,
|
|
3269
|
+
t: t
|
|
2932
3270
|
});
|
|
2933
3271
|
menuItems = menuItems.filter(function (item) {
|
|
2934
3272
|
return (item === null || item === void 0 ? void 0 : item.id) !== "login-btn";
|
|
2935
3273
|
});
|
|
2936
3274
|
menuItems = [].concat(menuItems, [{
|
|
3275
|
+
text: t("EDIT_PROFILE"),
|
|
3276
|
+
element: "PROFILE",
|
|
3277
|
+
icon: /*#__PURE__*/React.createElement(EditPencilIcon, {
|
|
3278
|
+
className: "icon edit-btn-ico",
|
|
3279
|
+
width: "16",
|
|
3280
|
+
height: "16"
|
|
3281
|
+
}),
|
|
3282
|
+
populators: {
|
|
3283
|
+
onClick: showProfilePage
|
|
3284
|
+
}
|
|
3285
|
+
}, {
|
|
2937
3286
|
text: t("CORE_COMMON_LOGOUT"),
|
|
2938
3287
|
element: "LOGOUT",
|
|
2939
3288
|
icon: /*#__PURE__*/React.createElement(LogoutIcon, {
|
|
@@ -2942,6 +3291,22 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
|
|
|
2942
3291
|
populators: {
|
|
2943
3292
|
onClick: onLogout
|
|
2944
3293
|
}
|
|
3294
|
+
}, {
|
|
3295
|
+
text: /*#__PURE__*/React.createElement(React.Fragment, null, t("CS_COMMON_HELPLINE"), /*#__PURE__*/React.createElement("div", {
|
|
3296
|
+
className: "telephone",
|
|
3297
|
+
style: {
|
|
3298
|
+
marginTop: "-10%"
|
|
3299
|
+
}
|
|
3300
|
+
}, storeData === null || storeData === void 0 ? void 0 : storeData.tenants.map(function (i) {
|
|
3301
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
3302
|
+
className: "link"
|
|
3303
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
3304
|
+
href: "tel:" + (storeData === null || storeData === void 0 ? void 0 : storeData.tenants[0].contactNumber)
|
|
3305
|
+
}, storeData === null || storeData === void 0 ? void 0 : storeData.tenants[0].contactNumber)))),
|
|
3306
|
+
element: "Helpline",
|
|
3307
|
+
icon: /*#__PURE__*/React.createElement(Phone, {
|
|
3308
|
+
className: "icon"
|
|
3309
|
+
})
|
|
2945
3310
|
}]);
|
|
2946
3311
|
}
|
|
2947
3312
|
|
|
@@ -2961,76 +3326,84 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
|
|
|
2961
3326
|
}));
|
|
2962
3327
|
};
|
|
2963
3328
|
|
|
3329
|
+
var ToolTipWrapper = function ToolTipWrapper(_ref) {
|
|
3330
|
+
var child = _ref.child,
|
|
3331
|
+
label = _ref.label,
|
|
3332
|
+
t = _ref.t;
|
|
3333
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
3334
|
+
className: "tooltip"
|
|
3335
|
+
}, child, /*#__PURE__*/React.createElement("span", {
|
|
3336
|
+
className: "tooltiptext",
|
|
3337
|
+
style: {
|
|
3338
|
+
fontSize: "14px",
|
|
3339
|
+
marginLeft: "0px",
|
|
3340
|
+
bottom: "20%"
|
|
3341
|
+
}
|
|
3342
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3343
|
+
style: {
|
|
3344
|
+
background: "#555",
|
|
3345
|
+
width: "100%",
|
|
3346
|
+
padding: "5px",
|
|
3347
|
+
borderRadius: "6px",
|
|
3348
|
+
whiteSpace: "pre"
|
|
3349
|
+
}
|
|
3350
|
+
}, t(label))));
|
|
3351
|
+
};
|
|
3352
|
+
|
|
2964
3353
|
var EmployeeSideBar = function EmployeeSideBar() {
|
|
3354
|
+
var STADMIN = Digit.UserService.hasAccess("STADMIN");
|
|
3355
|
+
var NATADMIN = Digit.UserService.hasAccess("NATADMIN");
|
|
3356
|
+
|
|
3357
|
+
var _useTranslation = useTranslation(),
|
|
3358
|
+
t = _useTranslation.t;
|
|
3359
|
+
|
|
2965
3360
|
return /*#__PURE__*/React.createElement("div", {
|
|
2966
3361
|
className: "sidebar"
|
|
2967
3362
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
2968
3363
|
to: "/digit-ui/employee"
|
|
2969
3364
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2970
3365
|
className: "actions active"
|
|
2971
|
-
}, /*#__PURE__*/React.createElement(
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
}, /*#__PURE__*/React.createElement("
|
|
2987
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2988
|
-
height: "24",
|
|
2989
|
-
viewBox: "0 0 24 24",
|
|
2990
|
-
width: "24"
|
|
2991
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
2992
|
-
d: "M0 0h24v24H0z",
|
|
2993
|
-
fill: "none"
|
|
2994
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
2995
|
-
d: "M8.17 5.7L1 10.48V21h5v-8h4v8h5V10.25z",
|
|
2996
|
-
fill: "white"
|
|
2997
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
2998
|
-
d: "M17 7h2v2h-2z",
|
|
2999
|
-
fill: "none"
|
|
3000
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
3001
|
-
d: "M10 3v1.51l2 1.33L13.73 7H15v.85l2 1.34V11h2v2h-2v2h2v2h-2v4h6V3H10zm9 6h-2V7h2v2z",
|
|
3002
|
-
fill: "white"
|
|
3003
|
-
})))), /*#__PURE__*/React.createElement("a", {
|
|
3004
|
-
href: "/employee"
|
|
3005
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
3006
|
-
className: "actions"
|
|
3007
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
3008
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3009
|
-
height: "24",
|
|
3010
|
-
viewBox: "0 0 24 24",
|
|
3011
|
-
width: "24"
|
|
3012
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
3013
|
-
d: "M0 0h24v24H0z",
|
|
3014
|
-
fill: "none"
|
|
3015
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
3016
|
-
d: "M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z",
|
|
3017
|
-
fill: "white"
|
|
3018
|
-
})))), /*#__PURE__*/React.createElement("a", {
|
|
3366
|
+
}, /*#__PURE__*/React.createElement(ToolTipWrapper, {
|
|
3367
|
+
child: /*#__PURE__*/React.createElement("svg", {
|
|
3368
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3369
|
+
height: "24",
|
|
3370
|
+
viewBox: "0 0 24 24",
|
|
3371
|
+
width: "24"
|
|
3372
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3373
|
+
d: "M0 0h24v24H0z",
|
|
3374
|
+
fill: "none"
|
|
3375
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3376
|
+
d: "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z",
|
|
3377
|
+
fill: "white"
|
|
3378
|
+
})),
|
|
3379
|
+
t: t,
|
|
3380
|
+
label: "ACTION_TEST_HOME"
|
|
3381
|
+
}))), /*#__PURE__*/React.createElement("a", {
|
|
3019
3382
|
href: "/employee"
|
|
3020
3383
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3021
3384
|
className: "actions"
|
|
3022
|
-
}, /*#__PURE__*/React.createElement(
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3385
|
+
}, /*#__PURE__*/React.createElement(ToolTipWrapper, {
|
|
3386
|
+
child: /*#__PURE__*/React.createElement("svg", {
|
|
3387
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3388
|
+
height: "24",
|
|
3389
|
+
viewBox: "0 0 24 24",
|
|
3390
|
+
width: "24"
|
|
3391
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3392
|
+
d: "M0 0h24v24H0z",
|
|
3393
|
+
fill: "none"
|
|
3394
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3395
|
+
d: "M8.17 5.7L1 10.48V21h5v-8h4v8h5V10.25z",
|
|
3396
|
+
fill: "white"
|
|
3397
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3398
|
+
d: "M17 7h2v2h-2z",
|
|
3399
|
+
fill: "none"
|
|
3400
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
3401
|
+
d: "M10 3v1.51l2 1.33L13.73 7H15v.85l2 1.34V11h2v2h-2v2h2v2h-2v4h6V3H10zm9 6h-2V7h2v2z",
|
|
3402
|
+
fill: "white"
|
|
3403
|
+
})),
|
|
3404
|
+
t: t,
|
|
3405
|
+
label: "CORE_CHANGE_TENANT_DESCRIPTION"
|
|
3406
|
+
}))));
|
|
3034
3407
|
};
|
|
3035
3408
|
|
|
3036
3409
|
var SideBar = function SideBar(_ref) {
|
|
@@ -3076,12 +3449,24 @@ var TopBarSideBar = function TopBarSideBar(_ref) {
|
|
|
3076
3449
|
isSidebarOpen = _useState[0],
|
|
3077
3450
|
toggleSidebar = _useState[1];
|
|
3078
3451
|
|
|
3452
|
+
var history = useHistory();
|
|
3453
|
+
|
|
3079
3454
|
var handleLogout = function handleLogout() {
|
|
3080
3455
|
toggleSidebar(false);
|
|
3081
3456
|
Digit.UserService.logout();
|
|
3082
3457
|
};
|
|
3083
3458
|
|
|
3459
|
+
var userProfile = function userProfile() {
|
|
3460
|
+
history.push("/digit-ui/employee/user/profile");
|
|
3461
|
+
};
|
|
3462
|
+
|
|
3084
3463
|
var userOptions = [{
|
|
3464
|
+
name: t("EDIT_PROFILE"),
|
|
3465
|
+
icon: /*#__PURE__*/React.createElement(EditPencilIcon, {
|
|
3466
|
+
className: "icon"
|
|
3467
|
+
}),
|
|
3468
|
+
func: userProfile
|
|
3469
|
+
}, {
|
|
3085
3470
|
name: t("CORE_COMMON_LOGOUT"),
|
|
3086
3471
|
icon: /*#__PURE__*/React.createElement(LogoutIcon, {
|
|
3087
3472
|
className: "icon"
|
|
@@ -3113,51 +3498,1108 @@ var TopBarSideBar = function TopBarSideBar(_ref) {
|
|
|
3113
3498
|
}));
|
|
3114
3499
|
};
|
|
3115
3500
|
|
|
3116
|
-
|
|
3117
|
-
var
|
|
3501
|
+
function UploadDrawer(_ref) {
|
|
3502
|
+
var setProfilePic = _ref.setProfilePic,
|
|
3503
|
+
closeDrawer = _ref.closeDrawer,
|
|
3504
|
+
userType = _ref.userType,
|
|
3505
|
+
removeProfilePic = _ref.removeProfilePic,
|
|
3506
|
+
showToast = _ref.showToast;
|
|
3118
3507
|
|
|
3119
|
-
var
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
modules = _ref.modules,
|
|
3129
|
-
appTenants = _ref.appTenants;
|
|
3508
|
+
var _useState = useState(null),
|
|
3509
|
+
setUploadedFile = _useState[1];
|
|
3510
|
+
|
|
3511
|
+
var _useState2 = useState(""),
|
|
3512
|
+
file = _useState2[0],
|
|
3513
|
+
setFile = _useState2[1];
|
|
3514
|
+
|
|
3515
|
+
var _useState3 = useState(null),
|
|
3516
|
+
setError = _useState3[1];
|
|
3130
3517
|
|
|
3131
3518
|
var _useTranslation = useTranslation(),
|
|
3132
3519
|
t = _useTranslation.t;
|
|
3133
3520
|
|
|
3134
|
-
var
|
|
3135
|
-
|
|
3521
|
+
var selectfile = function selectfile(e) {
|
|
3522
|
+
return setFile(e.target.files[0]);
|
|
3523
|
+
};
|
|
3524
|
+
|
|
3525
|
+
var removeimg = function removeimg() {
|
|
3526
|
+
removeProfilePic();
|
|
3527
|
+
closeDrawer();
|
|
3528
|
+
};
|
|
3529
|
+
|
|
3530
|
+
var onOverlayBodyClick = function onOverlayBodyClick() {
|
|
3531
|
+
return closeDrawer();
|
|
3532
|
+
};
|
|
3136
3533
|
|
|
3137
|
-
var location = useLocation();
|
|
3138
|
-
var showLanguageChange = location === null || location === void 0 ? void 0 : (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : _location$pathname.includes("language-selection");
|
|
3139
3534
|
useEffect(function () {
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3535
|
+
(function () {
|
|
3536
|
+
try {
|
|
3537
|
+
setError(null);
|
|
3538
|
+
|
|
3539
|
+
var _temp4 = function () {
|
|
3540
|
+
if (file) {
|
|
3541
|
+
var _temp5 = function () {
|
|
3542
|
+
if (file.size >= 1000000) {
|
|
3543
|
+
showToast("error", t("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
|
|
3544
|
+
setError(t("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
|
|
3545
|
+
} else {
|
|
3546
|
+
var _temp6 = _catch(function () {
|
|
3547
|
+
return Promise.resolve(Digit.UploadServices.Filestorage(userType + "-profile", file, Digit.ULBService.getStateId())).then(function (response) {
|
|
3548
|
+
var _response$data, _response$data$files;
|
|
3549
|
+
|
|
3550
|
+
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
|
|
3551
|
+
var _response$data2, _response$data2$files;
|
|
3552
|
+
|
|
3553
|
+
var fileStoreId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
|
|
3554
|
+
setUploadedFile(fileStoreId);
|
|
3555
|
+
setProfilePic(fileStoreId);
|
|
3556
|
+
} else {
|
|
3557
|
+
showToast("error", t("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"));
|
|
3558
|
+
setError(t("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"));
|
|
3559
|
+
}
|
|
3560
|
+
});
|
|
3561
|
+
}, function () {
|
|
3562
|
+
showToast("error", t("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"));
|
|
3563
|
+
});
|
|
3564
|
+
|
|
3565
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
3566
|
+
}
|
|
3567
|
+
}();
|
|
3568
|
+
|
|
3569
|
+
if (_temp5 && _temp5.then) return _temp5.then(function () {});
|
|
3570
|
+
}
|
|
3571
|
+
}();
|
|
3572
|
+
|
|
3573
|
+
return _temp4 && _temp4.then ? _temp4.then(function () {}) : void 0;
|
|
3574
|
+
} catch (e) {
|
|
3575
|
+
Promise.reject(e);
|
|
3576
|
+
}
|
|
3577
|
+
})();
|
|
3578
|
+
}, [file]);
|
|
3579
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
3159
3580
|
style: {
|
|
3160
|
-
|
|
3581
|
+
position: "fixed",
|
|
3582
|
+
top: "0",
|
|
3583
|
+
left: "0",
|
|
3584
|
+
right: "0",
|
|
3585
|
+
bottom: "0",
|
|
3586
|
+
width: "100%",
|
|
3587
|
+
height: "100vh",
|
|
3588
|
+
backgroundColor: "rgba(0,0,0,.5)"
|
|
3589
|
+
},
|
|
3590
|
+
onClick: onOverlayBodyClick
|
|
3591
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
3592
|
+
style: {
|
|
3593
|
+
width: "100%",
|
|
3594
|
+
justifyContent: "space-between",
|
|
3595
|
+
display: "flex",
|
|
3596
|
+
backgroundColor: "white",
|
|
3597
|
+
alignItems: "center",
|
|
3598
|
+
position: "fixed",
|
|
3599
|
+
left: "0",
|
|
3600
|
+
right: "0",
|
|
3601
|
+
height: "20%",
|
|
3602
|
+
bottom: userType === "citizen" ? "2.5rem" : "0",
|
|
3603
|
+
zIndex: "2"
|
|
3604
|
+
}
|
|
3605
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
3606
|
+
style: {
|
|
3607
|
+
display: "flex",
|
|
3608
|
+
flex: "1",
|
|
3609
|
+
flexDirection: "column",
|
|
3610
|
+
width: "100%",
|
|
3611
|
+
justifyContent: "center",
|
|
3612
|
+
alignItems: "center",
|
|
3613
|
+
gap: "8px 0"
|
|
3614
|
+
}
|
|
3615
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
3616
|
+
for: "file",
|
|
3617
|
+
style: {
|
|
3618
|
+
cursor: "pointer"
|
|
3619
|
+
}
|
|
3620
|
+
}, " ", /*#__PURE__*/React.createElement(GalleryIcon, null)), /*#__PURE__*/React.createElement("label", {
|
|
3621
|
+
style: {
|
|
3622
|
+
cursor: "pointer"
|
|
3623
|
+
}
|
|
3624
|
+
}, " Gallery"), /*#__PURE__*/React.createElement("input", {
|
|
3625
|
+
type: "file",
|
|
3626
|
+
id: "file",
|
|
3627
|
+
accept: "image/*, .png, .jpeg, .jpg",
|
|
3628
|
+
onChange: selectfile,
|
|
3629
|
+
style: {
|
|
3630
|
+
display: "none"
|
|
3631
|
+
}
|
|
3632
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3633
|
+
style: {
|
|
3634
|
+
display: "flex",
|
|
3635
|
+
flex: "1",
|
|
3636
|
+
width: "100%",
|
|
3637
|
+
justifyContent: "center",
|
|
3638
|
+
alignItems: "center",
|
|
3639
|
+
flexDirection: "column",
|
|
3640
|
+
gap: "8px 0"
|
|
3641
|
+
}
|
|
3642
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
3643
|
+
onClick: removeimg
|
|
3644
|
+
}, /*#__PURE__*/React.createElement(RemoveIcon, null)), /*#__PURE__*/React.createElement("label", {
|
|
3645
|
+
style: {
|
|
3646
|
+
cursor: "pointer"
|
|
3647
|
+
}
|
|
3648
|
+
}, "Remove"))));
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
var defaultImage$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "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";
|
|
3652
|
+
|
|
3653
|
+
var UserProfile = function UserProfile(_ref) {
|
|
3654
|
+
var _Digit$UserService$ge, _errors$userName, _errors$emailAddress, _errors$userName2, _errors$mobileNumber, _errors$emailAddress2, _ref3, _errors$currentPasswo, _errors$newPassword, _errors$confirmPasswo;
|
|
3655
|
+
|
|
3656
|
+
var stateCode = _ref.stateCode,
|
|
3657
|
+
userType = _ref.userType,
|
|
3658
|
+
cityDetails = _ref.cityDetails;
|
|
3659
|
+
var history = useHistory();
|
|
3660
|
+
|
|
3661
|
+
var _useTranslation = useTranslation(),
|
|
3662
|
+
t = _useTranslation.t;
|
|
3663
|
+
|
|
3664
|
+
var url = window.location.href;
|
|
3665
|
+
var stateId = Digit.ULBService.getStateId();
|
|
3666
|
+
var tenant = Digit.ULBService.getCurrentTenantId();
|
|
3667
|
+
var userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
|
|
3668
|
+
|
|
3669
|
+
var _useState = useState(null),
|
|
3670
|
+
userDetails = _useState[0],
|
|
3671
|
+
setUserDetails = _useState[1];
|
|
3672
|
+
|
|
3673
|
+
var _useState2 = useState(userInfo !== null && userInfo !== void 0 && userInfo.name ? userInfo.name : ""),
|
|
3674
|
+
name = _useState2[0],
|
|
3675
|
+
setName = _useState2[1];
|
|
3676
|
+
|
|
3677
|
+
var _useState3 = useState(userInfo !== null && userInfo !== void 0 && userInfo.emailId ? userInfo.emailId : ""),
|
|
3678
|
+
email = _useState3[0],
|
|
3679
|
+
setEmail = _useState3[1];
|
|
3680
|
+
|
|
3681
|
+
var _useState4 = useState(userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender),
|
|
3682
|
+
gender = _useState4[0],
|
|
3683
|
+
setGender = _useState4[1];
|
|
3684
|
+
|
|
3685
|
+
var _useState5 = useState(userInfo !== null && userInfo !== void 0 && userInfo.permanentCity ? userInfo.permanentCity : cityDetails.name),
|
|
3686
|
+
city = _useState5[0],
|
|
3687
|
+
setCity = _useState5[1];
|
|
3688
|
+
|
|
3689
|
+
var _useState6 = useState(userInfo !== null && userInfo !== void 0 && userInfo.mobileNumber ? userInfo.mobileNumber : ""),
|
|
3690
|
+
mobileNumber = _useState6[0],
|
|
3691
|
+
setMobileNo = _useState6[1];
|
|
3692
|
+
|
|
3693
|
+
var _useState7 = useState(null),
|
|
3694
|
+
profilePic = _useState7[0],
|
|
3695
|
+
setProfilePic = _useState7[1];
|
|
3696
|
+
|
|
3697
|
+
var _useState8 = useState(""),
|
|
3698
|
+
profileImg = _useState8[0],
|
|
3699
|
+
setProfileImg = _useState8[1];
|
|
3700
|
+
|
|
3701
|
+
var _useState9 = useState(false),
|
|
3702
|
+
openUploadSlide = _useState9[0],
|
|
3703
|
+
setOpenUploadSide = _useState9[1];
|
|
3704
|
+
|
|
3705
|
+
var _useState10 = useState(false),
|
|
3706
|
+
changepassword = _useState10[0],
|
|
3707
|
+
setChangepassword = _useState10[1];
|
|
3708
|
+
|
|
3709
|
+
var _useState11 = useState(""),
|
|
3710
|
+
currentPassword = _useState11[0],
|
|
3711
|
+
setCurrentPassword = _useState11[1];
|
|
3712
|
+
|
|
3713
|
+
var _useState12 = useState(""),
|
|
3714
|
+
newPassword = _useState12[0],
|
|
3715
|
+
setNewPassword = _useState12[1];
|
|
3716
|
+
|
|
3717
|
+
var _useState13 = useState(""),
|
|
3718
|
+
confirmPassword = _useState13[0],
|
|
3719
|
+
setConfirmPassword = _useState13[1];
|
|
3720
|
+
|
|
3721
|
+
var _useState14 = useState(null),
|
|
3722
|
+
toast = _useState14[0],
|
|
3723
|
+
setToast = _useState14[1];
|
|
3724
|
+
|
|
3725
|
+
var _useState15 = useState(false),
|
|
3726
|
+
loading = _useState15[0],
|
|
3727
|
+
setLoading = _useState15[1];
|
|
3728
|
+
|
|
3729
|
+
var _React$useState = React.useState(window.innerWidth),
|
|
3730
|
+
windowWidth = _React$useState[0],
|
|
3731
|
+
setWindowWidth = _React$useState[1];
|
|
3732
|
+
|
|
3733
|
+
var _React$useState2 = React.useState({}),
|
|
3734
|
+
errors = _React$useState2[0],
|
|
3735
|
+
setErrors = _React$useState2[1];
|
|
3736
|
+
|
|
3737
|
+
var getUserInfo = function getUserInfo() {
|
|
3738
|
+
try {
|
|
3739
|
+
var uuid = userInfo === null || userInfo === void 0 ? void 0 : userInfo.uuid;
|
|
3740
|
+
|
|
3741
|
+
var _temp2 = function () {
|
|
3742
|
+
if (uuid) {
|
|
3743
|
+
return Promise.resolve(Digit.UserService.userSearch(tenant, {
|
|
3744
|
+
uuid: [uuid]
|
|
3745
|
+
}, {})).then(function (usersResponse) {
|
|
3746
|
+
usersResponse && usersResponse.user && usersResponse.user.length && setUserDetails(usersResponse.user[0]);
|
|
3747
|
+
});
|
|
3748
|
+
}
|
|
3749
|
+
}();
|
|
3750
|
+
|
|
3751
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
3752
|
+
} catch (e) {
|
|
3753
|
+
return Promise.reject(e);
|
|
3754
|
+
}
|
|
3755
|
+
};
|
|
3756
|
+
|
|
3757
|
+
React.useEffect(function () {
|
|
3758
|
+
window.addEventListener("resize", function () {
|
|
3759
|
+
return setWindowWidth(window.innerWidth);
|
|
3760
|
+
});
|
|
3761
|
+
return function () {
|
|
3762
|
+
window.removeEventListener("resize", function () {
|
|
3763
|
+
return setWindowWidth(window.innerWidth);
|
|
3764
|
+
});
|
|
3765
|
+
};
|
|
3766
|
+
});
|
|
3767
|
+
useEffect(function () {
|
|
3768
|
+
var _userDetails$photo;
|
|
3769
|
+
|
|
3770
|
+
setLoading(true);
|
|
3771
|
+
getUserInfo();
|
|
3772
|
+
setGender({
|
|
3773
|
+
i18nKey: undefined,
|
|
3774
|
+
code: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender,
|
|
3775
|
+
value: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender
|
|
3776
|
+
});
|
|
3777
|
+
var thumbs = userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
|
|
3778
|
+
setProfileImg(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
|
|
3779
|
+
setLoading(false);
|
|
3780
|
+
}, [userDetails !== null]);
|
|
3781
|
+
var validation = {};
|
|
3782
|
+
var editScreen = false;
|
|
3783
|
+
|
|
3784
|
+
var onClickAddPic = function onClickAddPic() {
|
|
3785
|
+
return setOpenUploadSide(!openUploadSlide);
|
|
3786
|
+
};
|
|
3787
|
+
|
|
3788
|
+
var TogleforPassword = function TogleforPassword() {
|
|
3789
|
+
return setChangepassword(!changepassword);
|
|
3790
|
+
};
|
|
3791
|
+
|
|
3792
|
+
var setGenderName = function setGenderName(value) {
|
|
3793
|
+
return setGender(value);
|
|
3794
|
+
};
|
|
3795
|
+
|
|
3796
|
+
var closeFileUploadDrawer = function closeFileUploadDrawer() {
|
|
3797
|
+
return setOpenUploadSide(false);
|
|
3798
|
+
};
|
|
3799
|
+
|
|
3800
|
+
var setUserName = function setUserName(value) {
|
|
3801
|
+
setName(value);
|
|
3802
|
+
|
|
3803
|
+
if (!new RegExp(/^[a-zA-Z ]+$/i).test(value) || value.length === 0 || value.length > 50) {
|
|
3804
|
+
setErrors(_extends({}, errors, {
|
|
3805
|
+
userName: {
|
|
3806
|
+
type: "pattern",
|
|
3807
|
+
message: "CORE_COMMON_PROFILE_NAME_INVALID"
|
|
3808
|
+
}
|
|
3809
|
+
}));
|
|
3810
|
+
} else {
|
|
3811
|
+
setErrors(_extends({}, errors, {
|
|
3812
|
+
userName: null
|
|
3813
|
+
}));
|
|
3814
|
+
}
|
|
3815
|
+
};
|
|
3816
|
+
|
|
3817
|
+
var setUserEmailAddress = function setUserEmailAddress(value) {
|
|
3818
|
+
setEmail(value);
|
|
3819
|
+
|
|
3820
|
+
if (value.length && !(value.includes("@") && value.includes("."))) {
|
|
3821
|
+
setErrors(_extends({}, errors, {
|
|
3822
|
+
emailAddress: {
|
|
3823
|
+
type: "pattern",
|
|
3824
|
+
message: "CORE_COMMON_PROFILE_EMAIL_INVALID"
|
|
3825
|
+
}
|
|
3826
|
+
}));
|
|
3827
|
+
} else {
|
|
3828
|
+
setErrors(_extends({}, errors, {
|
|
3829
|
+
emailAddress: null
|
|
3830
|
+
}));
|
|
3831
|
+
}
|
|
3832
|
+
};
|
|
3833
|
+
|
|
3834
|
+
var setUserMobileNumber = function setUserMobileNumber(value) {
|
|
3835
|
+
setMobileNo(value);
|
|
3836
|
+
|
|
3837
|
+
if (userType === "employee" && !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(value)) {
|
|
3838
|
+
setErrors(_extends({}, errors, {
|
|
3839
|
+
mobileNumber: {
|
|
3840
|
+
type: 'pattern',
|
|
3841
|
+
message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"
|
|
3842
|
+
}
|
|
3843
|
+
}));
|
|
3844
|
+
} else {
|
|
3845
|
+
setErrors(_extends({}, errors, {
|
|
3846
|
+
mobileNumber: null
|
|
3847
|
+
}));
|
|
3848
|
+
}
|
|
3849
|
+
};
|
|
3850
|
+
|
|
3851
|
+
var setUserCurrentPassword = function setUserCurrentPassword(value) {
|
|
3852
|
+
setCurrentPassword(value);
|
|
3853
|
+
|
|
3854
|
+
if (value.length && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) {
|
|
3855
|
+
setErrors(_extends({}, errors, {
|
|
3856
|
+
currentPassword: {
|
|
3857
|
+
type: "pattern",
|
|
3858
|
+
message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
|
|
3859
|
+
}
|
|
3860
|
+
}));
|
|
3861
|
+
} else {
|
|
3862
|
+
setErrors(_extends({}, errors, {
|
|
3863
|
+
currentPassword: null
|
|
3864
|
+
}));
|
|
3865
|
+
}
|
|
3866
|
+
};
|
|
3867
|
+
|
|
3868
|
+
var setUserNewPassword = function setUserNewPassword(value) {
|
|
3869
|
+
setNewPassword(value);
|
|
3870
|
+
|
|
3871
|
+
if (value.length && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) {
|
|
3872
|
+
setErrors(_extends({}, errors, {
|
|
3873
|
+
newPassword: {
|
|
3874
|
+
type: "pattern",
|
|
3875
|
+
message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
|
|
3876
|
+
}
|
|
3877
|
+
}));
|
|
3878
|
+
} else {
|
|
3879
|
+
setErrors(_extends({}, errors, {
|
|
3880
|
+
newPassword: null
|
|
3881
|
+
}));
|
|
3882
|
+
}
|
|
3883
|
+
};
|
|
3884
|
+
|
|
3885
|
+
var setUserConfirmPassword = function setUserConfirmPassword(value) {
|
|
3886
|
+
setConfirmPassword(value);
|
|
3887
|
+
|
|
3888
|
+
if (value.length && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) {
|
|
3889
|
+
setErrors(_extends({}, errors, {
|
|
3890
|
+
confirmPassword: {
|
|
3891
|
+
type: "pattern",
|
|
3892
|
+
message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
|
|
3893
|
+
}
|
|
3894
|
+
}));
|
|
3895
|
+
} else {
|
|
3896
|
+
setErrors(_extends({}, errors, {
|
|
3897
|
+
confirmPassword: null
|
|
3898
|
+
}));
|
|
3899
|
+
}
|
|
3900
|
+
};
|
|
3901
|
+
|
|
3902
|
+
var removeProfilePic = function removeProfilePic() {
|
|
3903
|
+
setProfilePic(null);
|
|
3904
|
+
setProfileImg(null);
|
|
3905
|
+
};
|
|
3906
|
+
|
|
3907
|
+
var showToast = function showToast(type, message, duration) {
|
|
3908
|
+
if (duration === void 0) {
|
|
3909
|
+
duration = 5000;
|
|
3910
|
+
}
|
|
3911
|
+
|
|
3912
|
+
setToast({
|
|
3913
|
+
key: type,
|
|
3914
|
+
action: message
|
|
3915
|
+
});
|
|
3916
|
+
setTimeout(function () {
|
|
3917
|
+
setToast(null);
|
|
3918
|
+
}, duration);
|
|
3919
|
+
};
|
|
3920
|
+
|
|
3921
|
+
var updateProfile = function updateProfile() {
|
|
3922
|
+
try {
|
|
3923
|
+
var _temp5 = function _temp5(_result) {
|
|
3924
|
+
if (_exit2) return _result;
|
|
3925
|
+
setLoading(false);
|
|
3926
|
+
};
|
|
3927
|
+
|
|
3928
|
+
var _exit2 = false;
|
|
3929
|
+
setLoading(true);
|
|
3930
|
+
|
|
3931
|
+
var _temp6 = _catch(function () {
|
|
3932
|
+
var requestData = _extends({}, userInfo, {
|
|
3933
|
+
name: name,
|
|
3934
|
+
gender: gender === null || gender === void 0 ? void 0 : gender.value,
|
|
3935
|
+
emailId: email,
|
|
3936
|
+
photo: profilePic
|
|
3937
|
+
});
|
|
3938
|
+
|
|
3939
|
+
if (!new RegExp(/^([a-zA-Z ])*$/).test(name) || name === "" || name.length > 50 || name.length < 1) {
|
|
3940
|
+
throw JSON.stringify({
|
|
3941
|
+
type: "error",
|
|
3942
|
+
message: "CORE_COMMON_PROFILE_NAME_INVALID"
|
|
3943
|
+
});
|
|
3944
|
+
}
|
|
3945
|
+
|
|
3946
|
+
if (userType === "employee" && !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(mobileNumber)) {
|
|
3947
|
+
throw JSON.stringify({
|
|
3948
|
+
type: "error",
|
|
3949
|
+
message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"
|
|
3950
|
+
});
|
|
3951
|
+
}
|
|
3952
|
+
|
|
3953
|
+
if (email.length && !(email.includes("@") && email.includes("."))) {
|
|
3954
|
+
throw JSON.stringify({
|
|
3955
|
+
type: "error",
|
|
3956
|
+
message: "CORE_COMMON_PROFILE_EMAIL_INVALID"
|
|
3957
|
+
});
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
if (currentPassword.length || newPassword.length || confirmPassword.length) {
|
|
3961
|
+
if (newPassword !== confirmPassword) {
|
|
3962
|
+
throw JSON.stringify({
|
|
3963
|
+
type: "error",
|
|
3964
|
+
message: "CORE_COMMON_PROFILE_PASSWORD_MISMATCH"
|
|
3965
|
+
});
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3968
|
+
if (!(currentPassword.length && newPassword.length && confirmPassword.length)) {
|
|
3969
|
+
throw JSON.stringify({
|
|
3970
|
+
type: "error",
|
|
3971
|
+
message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
|
|
3972
|
+
});
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(newPassword) && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(confirmPassword)) {
|
|
3976
|
+
throw JSON.stringify({
|
|
3977
|
+
type: "error",
|
|
3978
|
+
message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
|
|
3979
|
+
});
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
return Promise.resolve(Digit.UserService.updateUser(requestData, stateCode)).then(function (_ref2) {
|
|
3984
|
+
var responseInfo = _ref2.responseInfo,
|
|
3985
|
+
user = _ref2.user;
|
|
3986
|
+
|
|
3987
|
+
if (responseInfo && responseInfo.status === "200") {
|
|
3988
|
+
var _user = Digit.UserService.getUser();
|
|
3989
|
+
|
|
3990
|
+
if (_user) {
|
|
3991
|
+
Digit.UserService.setUser(_extends({}, _user, {
|
|
3992
|
+
info: _extends({}, _user.info, {
|
|
3993
|
+
name: name,
|
|
3994
|
+
mobileNumber: mobileNumber,
|
|
3995
|
+
emailId: email,
|
|
3996
|
+
permanentCity: city
|
|
3997
|
+
})
|
|
3998
|
+
}));
|
|
3999
|
+
}
|
|
4000
|
+
}
|
|
4001
|
+
|
|
4002
|
+
return function () {
|
|
4003
|
+
if (currentPassword.length && newPassword.length && confirmPassword.length) {
|
|
4004
|
+
var _requestData = {
|
|
4005
|
+
existingPassword: currentPassword,
|
|
4006
|
+
newPassword: newPassword,
|
|
4007
|
+
tenantId: tenant,
|
|
4008
|
+
type: "EMPLOYEE",
|
|
4009
|
+
username: userInfo === null || userInfo === void 0 ? void 0 : userInfo.userName,
|
|
4010
|
+
confirmPassword: confirmPassword
|
|
4011
|
+
};
|
|
4012
|
+
return function () {
|
|
4013
|
+
if (newPassword === confirmPassword) {
|
|
4014
|
+
return _catch(function () {
|
|
4015
|
+
return Promise.resolve(Digit.UserService.changePassword(_requestData, tenant)).then(function (res) {
|
|
4016
|
+
var changePasswordResponseInfo = res.responseInfo;
|
|
4017
|
+
|
|
4018
|
+
if (changePasswordResponseInfo !== null && changePasswordResponseInfo !== void 0 && changePasswordResponseInfo.status && changePasswordResponseInfo.status === "200") {
|
|
4019
|
+
showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"), 5000);
|
|
4020
|
+
} else {
|
|
4021
|
+
throw "";
|
|
4022
|
+
}
|
|
4023
|
+
});
|
|
4024
|
+
}, function (error) {
|
|
4025
|
+
var _error$Errors, _error$Errors$at;
|
|
4026
|
+
|
|
4027
|
+
throw JSON.stringify({
|
|
4028
|
+
type: "error",
|
|
4029
|
+
message: (_error$Errors = error.Errors) !== null && _error$Errors !== void 0 && (_error$Errors$at = _error$Errors.at(0)) !== null && _error$Errors$at !== void 0 && _error$Errors$at.description ? error.Errors.at(0).description : "CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"
|
|
4030
|
+
});
|
|
4031
|
+
});
|
|
4032
|
+
} else {
|
|
4033
|
+
throw JSON.stringify({
|
|
4034
|
+
type: "error",
|
|
4035
|
+
message: "CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"
|
|
4036
|
+
});
|
|
4037
|
+
}
|
|
4038
|
+
}();
|
|
4039
|
+
} else if (responseInfo !== null && responseInfo !== void 0 && responseInfo.status && responseInfo.status === "200") {
|
|
4040
|
+
showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS"), 5000);
|
|
4041
|
+
}
|
|
4042
|
+
}();
|
|
4043
|
+
});
|
|
4044
|
+
}, function (error) {
|
|
4045
|
+
var errorObj = JSON.parse(error);
|
|
4046
|
+
showToast(errorObj.type, t(errorObj.message), 5000);
|
|
4047
|
+
});
|
|
4048
|
+
|
|
4049
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
|
|
4050
|
+
} catch (e) {
|
|
4051
|
+
return Promise.reject(e);
|
|
4052
|
+
}
|
|
4053
|
+
};
|
|
4054
|
+
|
|
4055
|
+
var menu = [];
|
|
4056
|
+
|
|
4057
|
+
var _Digit$Hooks$pt$useGe = Digit.Hooks.pt.useGenderMDMS(stateId, "common-masters", "GenderType"),
|
|
4058
|
+
Menu = _Digit$Hooks$pt$useGe.data;
|
|
4059
|
+
|
|
4060
|
+
Menu && Menu.map(function (genderDetails) {
|
|
4061
|
+
menu.push({
|
|
4062
|
+
i18nKey: "PT_COMMON_GENDER_" + genderDetails.code,
|
|
4063
|
+
code: "" + genderDetails.code,
|
|
4064
|
+
value: "" + genderDetails.code
|
|
4065
|
+
});
|
|
4066
|
+
});
|
|
4067
|
+
|
|
4068
|
+
var setFileStoreId = function setFileStoreId(fileStoreId) {
|
|
4069
|
+
try {
|
|
4070
|
+
var _temp8 = function _temp8(thumbnails) {
|
|
4071
|
+
setProfileImg(thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.thumbs[0]);
|
|
4072
|
+
closeFileUploadDrawer();
|
|
4073
|
+
};
|
|
4074
|
+
|
|
4075
|
+
setProfilePic(fileStoreId);
|
|
4076
|
+
return Promise.resolve(fileStoreId ? Promise.resolve(getThumbnails([fileStoreId], stateId)).then(_temp8) : _temp8(null));
|
|
4077
|
+
} catch (e) {
|
|
4078
|
+
return Promise.reject(e);
|
|
4079
|
+
}
|
|
4080
|
+
};
|
|
4081
|
+
|
|
4082
|
+
var getThumbnails = function getThumbnails(ids, tenantId) {
|
|
4083
|
+
try {
|
|
4084
|
+
return Promise.resolve(Digit.UploadServices.Filefetch(ids, tenantId)).then(function (res) {
|
|
4085
|
+
if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
|
|
4086
|
+
return {
|
|
4087
|
+
thumbs: res.data.fileStoreIds.map(function (o) {
|
|
4088
|
+
return o.url.split(",")[3];
|
|
4089
|
+
}),
|
|
4090
|
+
images: res.data.fileStoreIds.map(function (o) {
|
|
4091
|
+
return Digit.Utils.getFileUrl(o.url);
|
|
4092
|
+
})
|
|
4093
|
+
};
|
|
4094
|
+
} else {
|
|
4095
|
+
return null;
|
|
4096
|
+
}
|
|
4097
|
+
});
|
|
4098
|
+
} catch (e) {
|
|
4099
|
+
return Promise.reject(e);
|
|
4100
|
+
}
|
|
4101
|
+
};
|
|
4102
|
+
|
|
4103
|
+
if (loading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
4104
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("section", {
|
|
4105
|
+
style: {
|
|
4106
|
+
margin: userType === "citizen" ? "8px" : "24px"
|
|
4107
|
+
}
|
|
4108
|
+
}, userType === "citizen" ? /*#__PURE__*/React.createElement(BackButton, null) : /*#__PURE__*/React.createElement(BreadCrumb, {
|
|
4109
|
+
crumbs: [{
|
|
4110
|
+
path: "/digit-ui/employee",
|
|
4111
|
+
content: t("ES_COMMON_HOME"),
|
|
4112
|
+
show: true
|
|
4113
|
+
}, {
|
|
4114
|
+
path: "/digit-ui/employee/user/profile",
|
|
4115
|
+
content: t("ES_COMMON_PAGE_1"),
|
|
4116
|
+
show: url.includes("/user/profile")
|
|
4117
|
+
}]
|
|
4118
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
4119
|
+
style: {
|
|
4120
|
+
display: "flex",
|
|
4121
|
+
flex: 1,
|
|
4122
|
+
flexDirection: windowWidth < 768 || userType === "citizen" ? "column" : "row",
|
|
4123
|
+
margin: userType === "citizen" ? "8px" : "16px",
|
|
4124
|
+
gap: userType === "citizen" ? "" : "0 24px",
|
|
4125
|
+
boxShadow: userType === "citizen" ? "1px 1px 4px 0px rgba(0,0,0,0.2)" : "",
|
|
4126
|
+
background: userType === "citizen" ? "white" : "",
|
|
4127
|
+
borderRadius: userType === "citizen" ? "4px" : ""
|
|
4128
|
+
}
|
|
4129
|
+
}, /*#__PURE__*/React.createElement("section", {
|
|
4130
|
+
style: {
|
|
4131
|
+
position: "relative",
|
|
4132
|
+
display: "flex",
|
|
4133
|
+
flex: userType === "citizen" ? 1 : 2.5,
|
|
4134
|
+
justifyContent: "center",
|
|
4135
|
+
alignItems: "center",
|
|
4136
|
+
maxWidth: "100%",
|
|
4137
|
+
height: "376px",
|
|
4138
|
+
borderRadius: "4px",
|
|
4139
|
+
boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
|
|
4140
|
+
border: (userType === "citizen" ? "8px" : "24px") + " solid #fff",
|
|
4141
|
+
background: "#EEEEEE",
|
|
4142
|
+
padding: userType === "citizen" ? "8px" : "16px"
|
|
4143
|
+
}
|
|
4144
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4145
|
+
style: {
|
|
4146
|
+
position: "relative",
|
|
4147
|
+
height: userType === "citizen" ? "114px" : "150px",
|
|
4148
|
+
width: userType === "citizen" ? "114px" : "150px",
|
|
4149
|
+
margin: "16px"
|
|
4150
|
+
}
|
|
4151
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
4152
|
+
style: {
|
|
4153
|
+
margin: "auto",
|
|
4154
|
+
borderRadius: "300px",
|
|
4155
|
+
justifyContent: "center",
|
|
4156
|
+
height: "100%",
|
|
4157
|
+
width: "100%"
|
|
4158
|
+
},
|
|
4159
|
+
src: !profileImg || profileImg === "" ? defaultImage$1 : profileImg
|
|
4160
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
4161
|
+
style: {
|
|
4162
|
+
position: "absolute",
|
|
4163
|
+
left: "50%",
|
|
4164
|
+
bottom: "-24px",
|
|
4165
|
+
transform: "translateX(-50%)"
|
|
4166
|
+
},
|
|
4167
|
+
onClick: onClickAddPic
|
|
4168
|
+
}, /*#__PURE__*/React.createElement(CameraIcon, null)))), /*#__PURE__*/React.createElement("section", {
|
|
4169
|
+
style: {
|
|
4170
|
+
display: "flex",
|
|
4171
|
+
flexDirection: "column",
|
|
4172
|
+
flex: userType === "citizen" ? 1 : 7.5,
|
|
4173
|
+
width: "100%",
|
|
4174
|
+
borderRadius: "4px",
|
|
4175
|
+
height: "fit-content",
|
|
4176
|
+
boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
|
|
4177
|
+
background: "white",
|
|
4178
|
+
padding: userType === "citizen" ? "8px" : "24px",
|
|
4179
|
+
paddingBottom: "20px"
|
|
4180
|
+
}
|
|
4181
|
+
}, userType === "citizen" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4182
|
+
style: {}
|
|
4183
|
+
}, "" + t("CORE_COMMON_PROFILE_NAME"), "*"), /*#__PURE__*/React.createElement("div", {
|
|
4184
|
+
style: {
|
|
4185
|
+
width: "100%"
|
|
4186
|
+
}
|
|
4187
|
+
}, /*#__PURE__*/React.createElement(TextInput, _extends({
|
|
4188
|
+
t: t,
|
|
4189
|
+
style: {
|
|
4190
|
+
width: "100%"
|
|
4191
|
+
},
|
|
4192
|
+
type: "text",
|
|
4193
|
+
isMandatory: false,
|
|
4194
|
+
name: "name",
|
|
4195
|
+
value: name,
|
|
4196
|
+
onChange: function onChange(e) {
|
|
4197
|
+
return setUserName(e.target.value);
|
|
4198
|
+
}
|
|
4199
|
+
}, validation = {
|
|
4200
|
+
isRequired: true,
|
|
4201
|
+
pattern: "^[a-zA-Z-.`' ]*$",
|
|
4202
|
+
type: "tel",
|
|
4203
|
+
title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
|
|
4204
|
+
}, {
|
|
4205
|
+
disable: editScreen
|
|
4206
|
+
})), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4207
|
+
style: {
|
|
4208
|
+
width: "70%",
|
|
4209
|
+
fontSize: "12px",
|
|
4210
|
+
marginTop: "-21px"
|
|
4211
|
+
}
|
|
4212
|
+
}, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$userName = errors.userName) === null || _errors$userName === void 0 ? void 0 : _errors$userName.message), " "))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4213
|
+
style: {}
|
|
4214
|
+
}, "" + t("CORE_COMMON_PROFILE_GENDER")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
4215
|
+
style: {
|
|
4216
|
+
width: "100%"
|
|
4217
|
+
},
|
|
4218
|
+
className: "form-field",
|
|
4219
|
+
selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
|
|
4220
|
+
disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
|
|
4221
|
+
option: menu,
|
|
4222
|
+
select: setGenderName,
|
|
4223
|
+
value: gender,
|
|
4224
|
+
optionKey: "code",
|
|
4225
|
+
t: t,
|
|
4226
|
+
name: "gender"
|
|
4227
|
+
})), /*#__PURE__*/React.createElement(CardLabelError, null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4228
|
+
style: {}
|
|
4229
|
+
}, "" + t("CORE_COMMON_PROFILE_EMAIL")), /*#__PURE__*/React.createElement("div", {
|
|
4230
|
+
style: {
|
|
4231
|
+
width: "100%"
|
|
4232
|
+
}
|
|
4233
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
4234
|
+
t: t,
|
|
4235
|
+
style: {
|
|
4236
|
+
width: "100%"
|
|
4237
|
+
},
|
|
4238
|
+
type: "email",
|
|
4239
|
+
isMandatory: false,
|
|
4240
|
+
optionKey: "i18nKey",
|
|
4241
|
+
name: "email",
|
|
4242
|
+
value: email,
|
|
4243
|
+
onChange: function onChange(e) {
|
|
4244
|
+
return setUserEmailAddress(e.target.value);
|
|
4245
|
+
},
|
|
4246
|
+
disable: editScreen
|
|
4247
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4248
|
+
style: {
|
|
4249
|
+
width: "70%",
|
|
4250
|
+
fontSize: "12px",
|
|
4251
|
+
marginTop: "-21px"
|
|
4252
|
+
}
|
|
4253
|
+
}, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$emailAddress = errors.emailAddress) === null || _errors$emailAddress === void 0 ? void 0 : _errors$emailAddress.message), " "))), /*#__PURE__*/React.createElement("button", {
|
|
4254
|
+
onClick: updateProfile,
|
|
4255
|
+
style: {
|
|
4256
|
+
marginTop: "24px",
|
|
4257
|
+
backgroundColor: "#F47738",
|
|
4258
|
+
width: "100%",
|
|
4259
|
+
height: "40px",
|
|
4260
|
+
color: "white",
|
|
4261
|
+
borderBottom: "1px solid black"
|
|
4262
|
+
}
|
|
4263
|
+
}, t("CORE_COMMON_SAVE"))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4264
|
+
style: {
|
|
4265
|
+
display: "flex"
|
|
4266
|
+
}
|
|
4267
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4268
|
+
className: "profile-label-margin",
|
|
4269
|
+
style: {
|
|
4270
|
+
width: "300px"
|
|
4271
|
+
}
|
|
4272
|
+
}, "" + t("CORE_COMMON_PROFILE_NAME"), "*"), /*#__PURE__*/React.createElement("div", {
|
|
4273
|
+
style: {
|
|
4274
|
+
width: "100%"
|
|
4275
|
+
}
|
|
4276
|
+
}, /*#__PURE__*/React.createElement(TextInput, _extends({
|
|
4277
|
+
t: t,
|
|
4278
|
+
type: "text",
|
|
4279
|
+
isMandatory: false,
|
|
4280
|
+
name: "name",
|
|
4281
|
+
value: name,
|
|
4282
|
+
onChange: function onChange(e) {
|
|
4283
|
+
return setUserName(e.target.value);
|
|
4284
|
+
},
|
|
4285
|
+
placeholder: "Enter Your Name"
|
|
4286
|
+
}, validation = {
|
|
4287
|
+
isRequired: true,
|
|
4288
|
+
pattern: "^[a-zA-Z-.`' ]*$",
|
|
4289
|
+
type: "text",
|
|
4290
|
+
title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
|
|
4291
|
+
}, {
|
|
4292
|
+
disable: editScreen
|
|
4293
|
+
})), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4294
|
+
style: {
|
|
4295
|
+
width: "70%",
|
|
4296
|
+
fontSize: "12px",
|
|
4297
|
+
marginTop: "-21px"
|
|
4298
|
+
}
|
|
4299
|
+
}, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$userName2 = errors.userName) === null || _errors$userName2 === void 0 ? void 0 : _errors$userName2.message), " "))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4300
|
+
style: {
|
|
4301
|
+
display: "flex"
|
|
4302
|
+
}
|
|
4303
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4304
|
+
className: "profile-label-margin",
|
|
4305
|
+
style: {
|
|
4306
|
+
width: "300px"
|
|
4307
|
+
}
|
|
4308
|
+
}, "" + t("CORE_COMMON_PROFILE_GENDER")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
4309
|
+
style: {
|
|
4310
|
+
width: "100%"
|
|
4311
|
+
},
|
|
4312
|
+
selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
|
|
4313
|
+
disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
|
|
4314
|
+
option: menu,
|
|
4315
|
+
select: setGenderName,
|
|
4316
|
+
value: gender,
|
|
4317
|
+
optionKey: "code",
|
|
4318
|
+
t: t,
|
|
4319
|
+
name: "gender"
|
|
4320
|
+
})), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4321
|
+
style: {
|
|
4322
|
+
display: "flex"
|
|
4323
|
+
}
|
|
4324
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4325
|
+
className: "profile-label-margin",
|
|
4326
|
+
style: {
|
|
4327
|
+
width: "300px"
|
|
4328
|
+
}
|
|
4329
|
+
}, "" + t("CORE_COMMON_PROFILE_CITY")), /*#__PURE__*/React.createElement("div", {
|
|
4330
|
+
style: {
|
|
4331
|
+
width: "100%"
|
|
4332
|
+
}
|
|
4333
|
+
}, /*#__PURE__*/React.createElement(TextInput, _extends({
|
|
4334
|
+
t: t,
|
|
4335
|
+
type: "text",
|
|
4336
|
+
isMandatory: false,
|
|
4337
|
+
name: "city",
|
|
4338
|
+
value: city,
|
|
4339
|
+
onChange: function onChange(e) {
|
|
4340
|
+
return setCity(e.target.value);
|
|
4341
|
+
},
|
|
4342
|
+
placeholder: "Enter Your City Name"
|
|
4343
|
+
}, validation = {
|
|
4344
|
+
isRequired: true,
|
|
4345
|
+
type: "text",
|
|
4346
|
+
title: t("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")
|
|
4347
|
+
}, {
|
|
4348
|
+
disable: true
|
|
4349
|
+
})), /*#__PURE__*/React.createElement(CardLabelError, null))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4350
|
+
style: {
|
|
4351
|
+
display: "flex"
|
|
4352
|
+
}
|
|
4353
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4354
|
+
className: "profile-label-margin",
|
|
4355
|
+
style: {
|
|
4356
|
+
width: "300px"
|
|
4357
|
+
}
|
|
4358
|
+
}, t("CORE_COMMON_PROFILE_MOBILE_NUMBER") + "*"), /*#__PURE__*/React.createElement("div", {
|
|
4359
|
+
style: {
|
|
4360
|
+
width: "100%"
|
|
4361
|
+
}
|
|
4362
|
+
}, /*#__PURE__*/React.createElement(MobileNumber, {
|
|
4363
|
+
value: mobileNumber,
|
|
4364
|
+
style: {
|
|
4365
|
+
width: "100%"
|
|
4366
|
+
},
|
|
4367
|
+
name: "mobileNumber",
|
|
4368
|
+
placeholder: "Enter a valid Mobile No.",
|
|
4369
|
+
onChange: function onChange(value) {
|
|
4370
|
+
return setUserMobileNumber(value);
|
|
4371
|
+
},
|
|
4372
|
+
disable: true,
|
|
4373
|
+
required: true,
|
|
4374
|
+
pattern: "[6-9]{1}[0-9]{9}",
|
|
4375
|
+
type: "tel",
|
|
4376
|
+
title: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")
|
|
4377
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.mobileNumber) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4378
|
+
style: {
|
|
4379
|
+
width: "70%",
|
|
4380
|
+
fontSize: "12px",
|
|
4381
|
+
marginTop: "-21px"
|
|
4382
|
+
}
|
|
4383
|
+
}, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber = errors.mobileNumber) === null || _errors$mobileNumber === void 0 ? void 0 : _errors$mobileNumber.message), " "))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4384
|
+
style: {
|
|
4385
|
+
display: "flex"
|
|
4386
|
+
}
|
|
4387
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4388
|
+
className: "profile-label-margin",
|
|
4389
|
+
style: {
|
|
4390
|
+
width: "300px"
|
|
4391
|
+
}
|
|
4392
|
+
}, "" + t("CORE_COMMON_PROFILE_EMAIL")), /*#__PURE__*/React.createElement("div", {
|
|
4393
|
+
style: {
|
|
4394
|
+
width: "100%"
|
|
4395
|
+
}
|
|
4396
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
4397
|
+
t: t,
|
|
4398
|
+
type: "email",
|
|
4399
|
+
isMandatory: false,
|
|
4400
|
+
placeholder: "Enter a valid Email",
|
|
4401
|
+
optionKey: "i18nKey",
|
|
4402
|
+
name: "email",
|
|
4403
|
+
value: email,
|
|
4404
|
+
onChange: function onChange(e) {
|
|
4405
|
+
return setUserEmailAddress(e.target.value);
|
|
4406
|
+
},
|
|
4407
|
+
disable: editScreen
|
|
4408
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4409
|
+
style: {
|
|
4410
|
+
width: "70%",
|
|
4411
|
+
fontSize: "12px",
|
|
4412
|
+
marginTop: "-21px"
|
|
4413
|
+
}
|
|
4414
|
+
}, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$emailAddress2 = errors.emailAddress) === null || _errors$emailAddress2 === void 0 ? void 0 : _errors$emailAddress2.message), " "))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
4415
|
+
style: (_ref3 = {
|
|
4416
|
+
color: "orange",
|
|
4417
|
+
cursor: "default",
|
|
4418
|
+
marginBottom: "5"
|
|
4419
|
+
}, _ref3["cursor"] = "pointer", _ref3),
|
|
4420
|
+
onClick: TogleforPassword
|
|
4421
|
+
}, t("CORE_COMMON_CHANGE_PASSWORD")), changepassword ? /*#__PURE__*/React.createElement("div", {
|
|
4422
|
+
style: {
|
|
4423
|
+
marginTop: "10px"
|
|
4424
|
+
}
|
|
4425
|
+
}, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4426
|
+
style: {
|
|
4427
|
+
display: "flex"
|
|
4428
|
+
}
|
|
4429
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4430
|
+
className: "profile-label-margin",
|
|
4431
|
+
style: {
|
|
4432
|
+
width: "300px"
|
|
4433
|
+
}
|
|
4434
|
+
}, "" + t("CORE_COMMON_PROFILE_CURRENT_PASSWORD")), /*#__PURE__*/React.createElement("div", {
|
|
4435
|
+
style: {
|
|
4436
|
+
width: "100%"
|
|
4437
|
+
}
|
|
4438
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
4439
|
+
t: t,
|
|
4440
|
+
type: "password",
|
|
4441
|
+
isMandatory: false,
|
|
4442
|
+
name: "name",
|
|
4443
|
+
pattern: "^([a-zA-Z0-9@#$%])+$",
|
|
4444
|
+
onChange: function onChange(e) {
|
|
4445
|
+
return setUserCurrentPassword(e.target.value);
|
|
4446
|
+
},
|
|
4447
|
+
disable: editScreen
|
|
4448
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.currentPassword) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4449
|
+
style: {
|
|
4450
|
+
width: "70%",
|
|
4451
|
+
fontSize: "12px",
|
|
4452
|
+
marginTop: "-21px"
|
|
4453
|
+
}
|
|
4454
|
+
}, t(errors === null || errors === void 0 ? void 0 : (_errors$currentPasswo = errors.currentPassword) === null || _errors$currentPasswo === void 0 ? void 0 : _errors$currentPasswo.message)))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4455
|
+
style: {
|
|
4456
|
+
display: "flex"
|
|
4457
|
+
}
|
|
4458
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4459
|
+
className: "profile-label-margin",
|
|
4460
|
+
style: {
|
|
4461
|
+
width: "300px"
|
|
4462
|
+
}
|
|
4463
|
+
}, "" + t("CORE_COMMON_PROFILE_NEW_PASSWORD")), /*#__PURE__*/React.createElement("div", {
|
|
4464
|
+
style: {
|
|
4465
|
+
width: "100%"
|
|
4466
|
+
}
|
|
4467
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
4468
|
+
t: t,
|
|
4469
|
+
type: "password",
|
|
4470
|
+
isMandatory: false,
|
|
4471
|
+
name: "name",
|
|
4472
|
+
pattern: "^([a-zA-Z0-9@#$%])+$",
|
|
4473
|
+
onChange: function onChange(e) {
|
|
4474
|
+
return setUserNewPassword(e.target.value);
|
|
4475
|
+
},
|
|
4476
|
+
disable: editScreen
|
|
4477
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.newPassword) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4478
|
+
style: {
|
|
4479
|
+
width: "70%",
|
|
4480
|
+
fontSize: "12px",
|
|
4481
|
+
marginTop: "-21px"
|
|
4482
|
+
}
|
|
4483
|
+
}, t(errors === null || errors === void 0 ? void 0 : (_errors$newPassword = errors.newPassword) === null || _errors$newPassword === void 0 ? void 0 : _errors$newPassword.message)))), /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
4484
|
+
style: {
|
|
4485
|
+
display: "flex"
|
|
4486
|
+
}
|
|
4487
|
+
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
4488
|
+
className: "profile-label-margin",
|
|
4489
|
+
style: {
|
|
4490
|
+
width: "300px"
|
|
4491
|
+
}
|
|
4492
|
+
}, "" + t("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")), /*#__PURE__*/React.createElement("div", {
|
|
4493
|
+
style: {
|
|
4494
|
+
width: "100%"
|
|
4495
|
+
}
|
|
4496
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
4497
|
+
t: t,
|
|
4498
|
+
type: "password",
|
|
4499
|
+
isMandatory: false,
|
|
4500
|
+
name: "name",
|
|
4501
|
+
pattern: "^([a-zA-Z0-9@#$%])+$",
|
|
4502
|
+
onChange: function onChange(e) {
|
|
4503
|
+
return setUserConfirmPassword(e.target.value);
|
|
4504
|
+
},
|
|
4505
|
+
disable: editScreen
|
|
4506
|
+
}), (errors === null || errors === void 0 ? void 0 : errors.confirmPassword) && /*#__PURE__*/React.createElement(CardLabelError, {
|
|
4507
|
+
style: {
|
|
4508
|
+
width: "70%",
|
|
4509
|
+
fontSize: "12px",
|
|
4510
|
+
marginTop: "-21px"
|
|
4511
|
+
}
|
|
4512
|
+
}, t(errors === null || errors === void 0 ? void 0 : (_errors$confirmPasswo = errors.confirmPassword) === null || _errors$confirmPasswo === void 0 ? void 0 : _errors$confirmPasswo.message))))) : ""))))), userType === "employee" ? /*#__PURE__*/React.createElement("div", {
|
|
4513
|
+
style: {
|
|
4514
|
+
height: "88px",
|
|
4515
|
+
backgroundColor: "#FFFFFF",
|
|
4516
|
+
display: "flex",
|
|
4517
|
+
justifyContent: "flex-end",
|
|
4518
|
+
marginTop: "64px",
|
|
4519
|
+
alignItems: "center"
|
|
4520
|
+
}
|
|
4521
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
4522
|
+
onClick: updateProfile,
|
|
4523
|
+
style: {
|
|
4524
|
+
marginTop: "24px",
|
|
4525
|
+
backgroundColor: "#F47738",
|
|
4526
|
+
width: windowWidth < 768 ? "100%" : "248px",
|
|
4527
|
+
height: "40px",
|
|
4528
|
+
float: "right",
|
|
4529
|
+
margin: windowWidth < 768 ? "0 16px" : "",
|
|
4530
|
+
marginRight: windowWidth < 768 ? "16px" : "31px",
|
|
4531
|
+
color: "white",
|
|
4532
|
+
borderBottom: "1px solid black"
|
|
4533
|
+
}
|
|
4534
|
+
}, t("CORE_COMMON_SAVE"))) : "", toast && /*#__PURE__*/React.createElement(Toast, {
|
|
4535
|
+
error: toast.key === "error",
|
|
4536
|
+
label: t(toast.key === "success" ? "CORE_COMMON_PROFILE_UPDATE_SUCCESS" : toast.action),
|
|
4537
|
+
onClose: function onClose() {
|
|
4538
|
+
return setToast(null);
|
|
4539
|
+
},
|
|
4540
|
+
style: {
|
|
4541
|
+
maxWidth: "670px"
|
|
4542
|
+
}
|
|
4543
|
+
}), openUploadSlide == true ? /*#__PURE__*/React.createElement(UploadDrawer, {
|
|
4544
|
+
setProfilePic: setFileStoreId,
|
|
4545
|
+
closeDrawer: closeFileUploadDrawer,
|
|
4546
|
+
userType: userType,
|
|
4547
|
+
removeProfilePic: removeProfilePic,
|
|
4548
|
+
showToast: showToast
|
|
4549
|
+
}) : "");
|
|
4550
|
+
};
|
|
4551
|
+
|
|
4552
|
+
var EmployeeApp = function EmployeeApp(_ref) {
|
|
4553
|
+
var _location$pathname, _location$pathname2, _window, _window$globalConfigs, _window$globalConfigs2;
|
|
4554
|
+
|
|
4555
|
+
var stateInfo = _ref.stateInfo,
|
|
4556
|
+
userDetails = _ref.userDetails,
|
|
4557
|
+
CITIZEN = _ref.CITIZEN,
|
|
4558
|
+
cityDetails = _ref.cityDetails,
|
|
4559
|
+
mobileView = _ref.mobileView,
|
|
4560
|
+
handleUserDropdownSelection = _ref.handleUserDropdownSelection,
|
|
4561
|
+
logoUrl = _ref.logoUrl,
|
|
4562
|
+
DSO = _ref.DSO,
|
|
4563
|
+
stateCode = _ref.stateCode,
|
|
4564
|
+
modules = _ref.modules,
|
|
4565
|
+
appTenants = _ref.appTenants;
|
|
4566
|
+
|
|
4567
|
+
var _useTranslation = useTranslation(),
|
|
4568
|
+
t = _useTranslation.t;
|
|
4569
|
+
|
|
4570
|
+
var _useRouteMatch = useRouteMatch(),
|
|
4571
|
+
path = _useRouteMatch.path;
|
|
4572
|
+
|
|
4573
|
+
var location = useLocation();
|
|
4574
|
+
var showLanguageChange = location === null || location === void 0 ? void 0 : (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : _location$pathname.includes("language-selection");
|
|
4575
|
+
var isUserProfile = location === null || location === void 0 ? void 0 : (_location$pathname2 = location.pathname) === null || _location$pathname2 === void 0 ? void 0 : _location$pathname2.includes("user/profile");
|
|
4576
|
+
useEffect(function () {
|
|
4577
|
+
Digit.UserService.setType("employee");
|
|
4578
|
+
}, []);
|
|
4579
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4580
|
+
className: "employee"
|
|
4581
|
+
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
4582
|
+
path: path + "/user"
|
|
4583
|
+
}, isUserProfile && /*#__PURE__*/React.createElement(TopBarSideBar, {
|
|
4584
|
+
t: t,
|
|
4585
|
+
stateInfo: stateInfo,
|
|
4586
|
+
userDetails: userDetails,
|
|
4587
|
+
CITIZEN: CITIZEN,
|
|
4588
|
+
cityDetails: cityDetails,
|
|
4589
|
+
mobileView: mobileView,
|
|
4590
|
+
handleUserDropdownSelection: handleUserDropdownSelection,
|
|
4591
|
+
logoUrl: logoUrl,
|
|
4592
|
+
showSidebar: isUserProfile ? true : false,
|
|
4593
|
+
showLanguageChange: !showLanguageChange
|
|
4594
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
4595
|
+
className: isUserProfile ? "grounded-container" : "loginContainer",
|
|
4596
|
+
style: isUserProfile ? {
|
|
4597
|
+
padding: 0,
|
|
4598
|
+
paddingTop: "80px",
|
|
4599
|
+
marginLeft: mobileView ? "" : "64px"
|
|
4600
|
+
} : {
|
|
4601
|
+
"--banner-url": "url(" + (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl) + ")",
|
|
4602
|
+
padding: "0px"
|
|
3161
4603
|
}
|
|
3162
4604
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
3163
4605
|
path: path + "/user/login"
|
|
@@ -3165,7 +4607,13 @@ var EmployeeApp = function EmployeeApp(_ref) {
|
|
|
3165
4607
|
path: path + "/user/forgot-password"
|
|
3166
4608
|
}, /*#__PURE__*/React.createElement(EmployeeForgotPassword, null)), /*#__PURE__*/React.createElement(Route, {
|
|
3167
4609
|
path: path + "/user/change-password"
|
|
3168
|
-
},
|
|
4610
|
+
}, /*#__PURE__*/React.createElement(EmployeeChangePassword, null)), /*#__PURE__*/React.createElement(Route, {
|
|
4611
|
+
path: path + "/user/profile"
|
|
4612
|
+
}, /*#__PURE__*/React.createElement(UserProfile, {
|
|
4613
|
+
stateCode: stateCode,
|
|
4614
|
+
userType: "employee",
|
|
4615
|
+
cityDetails: cityDetails
|
|
4616
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
3169
4617
|
path: path + "/user/language-selection"
|
|
3170
4618
|
}, /*#__PURE__*/React.createElement(LanguageSelection, null)), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
|
|
3171
4619
|
to: path + "/user/language-selection"
|
|
@@ -3180,13 +4628,18 @@ var EmployeeApp = function EmployeeApp(_ref) {
|
|
|
3180
4628
|
logoUrl: logoUrl
|
|
3181
4629
|
}), /*#__PURE__*/React.createElement("div", {
|
|
3182
4630
|
className: "main " + (DSO ? "m-auto" : "")
|
|
3183
|
-
}, /*#__PURE__*/React.createElement("div",
|
|
4631
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4632
|
+
className: "employee-app-wrapper"
|
|
4633
|
+
}, /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(AppModules, {
|
|
3184
4634
|
stateCode: stateCode,
|
|
3185
4635
|
userType: "employee",
|
|
3186
4636
|
modules: modules,
|
|
3187
4637
|
appTenants: appTenants
|
|
3188
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
3189
|
-
className: "employee-home-footer"
|
|
4638
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
4639
|
+
className: "employee-home-footer",
|
|
4640
|
+
style: {
|
|
4641
|
+
position: "absolute"
|
|
4642
|
+
}
|
|
3190
4643
|
}, /*#__PURE__*/React.createElement("img", {
|
|
3191
4644
|
alt: "Powered by DIGIT",
|
|
3192
4645
|
src: (_window = window) === null || _window === void 0 ? void 0 : (_window$globalConfigs = _window.globalConfigs) === null || _window$globalConfigs === void 0 ? void 0 : (_window$globalConfigs2 = _window$globalConfigs.getConfig) === null || _window$globalConfigs2 === void 0 ? void 0 : _window$globalConfigs2.call(_window$globalConfigs, "DIGIT_FOOTER"),
|
|
@@ -3205,13 +4658,11 @@ var EmployeeApp = function EmployeeApp(_ref) {
|
|
|
3205
4658
|
};
|
|
3206
4659
|
|
|
3207
4660
|
var Home = function Home() {
|
|
3208
|
-
var _Digit$SessionStorage;
|
|
3209
|
-
|
|
3210
4661
|
var _useTranslation = useTranslation(),
|
|
3211
4662
|
t = _useTranslation.t;
|
|
3212
4663
|
|
|
3213
4664
|
var history = useHistory();
|
|
3214
|
-
var tenantId =
|
|
4665
|
+
var tenantId = Digit.ULBService.getCitizenCurrentTenant();
|
|
3215
4666
|
|
|
3216
4667
|
var _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
|
|
3217
4668
|
_Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data;
|
|
@@ -3290,9 +4741,7 @@ var Home = function Home() {
|
|
|
3290
4741
|
header: t("CS_COMMON_DASHBOARD_INFO_UPDATES"),
|
|
3291
4742
|
sideOption: {
|
|
3292
4743
|
name: t("DASHBOARD_VIEW_ALL_LABEL"),
|
|
3293
|
-
onClick: function onClick() {
|
|
3294
|
-
return console.debug("view all");
|
|
3295
|
-
}
|
|
4744
|
+
onClick: function onClick() {}
|
|
3296
4745
|
},
|
|
3297
4746
|
options: [{
|
|
3298
4747
|
name: t("CS_HEADER_MYCITY"),
|
|
@@ -3313,7 +4762,7 @@ var Home = function Home() {
|
|
|
3313
4762
|
name: t("CS_COMMON_SURVEYS"),
|
|
3314
4763
|
Icon: /*#__PURE__*/React.createElement(DocumentIcon, null),
|
|
3315
4764
|
onClick: function onClick() {
|
|
3316
|
-
return history.push("/digit-ui/citizen/engagement/
|
|
4765
|
+
return history.push("/digit-ui/citizen/engagement/surveys/list");
|
|
3317
4766
|
}
|
|
3318
4767
|
}],
|
|
3319
4768
|
styles: {
|
|
@@ -3401,7 +4850,9 @@ var LocationSelection = function LocationSelection() {
|
|
|
3401
4850
|
isLoading = _Digit$Hooks$useTenan.isLoading;
|
|
3402
4851
|
|
|
3403
4852
|
var _useState = useState(function () {
|
|
3404
|
-
return
|
|
4853
|
+
return {
|
|
4854
|
+
code: Digit.ULBService.getCitizenCurrentTenant()
|
|
4855
|
+
};
|
|
3405
4856
|
}),
|
|
3406
4857
|
selectedCity = _useState[0],
|
|
3407
4858
|
setSelectedCity = _useState[1];
|
|
@@ -3507,7 +4958,8 @@ var Home$1 = function Home$1(_ref) {
|
|
|
3507
4958
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3508
4959
|
className: "moduleLinkHomePage"
|
|
3509
4960
|
}, /*#__PURE__*/React.createElement("img", {
|
|
3510
|
-
src: bannerImage || (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl)
|
|
4961
|
+
src: bannerImage || (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl),
|
|
4962
|
+
alt: "noimagefound"
|
|
3511
4963
|
}), /*#__PURE__*/React.createElement(BackButton, {
|
|
3512
4964
|
className: "moduleLinkHomePageBackButton"
|
|
3513
4965
|
}), /*#__PURE__*/React.createElement("h1", null, t("MODULE_" + code.toUpperCase()))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -3528,7 +4980,8 @@ var Home$1 = function Home$1(_ref) {
|
|
|
3528
4980
|
cityDetails: cityDetails,
|
|
3529
4981
|
mobileView: mobileView,
|
|
3530
4982
|
handleUserDropdownSelection: handleUserDropdownSelection,
|
|
3531
|
-
logoUrl: logoUrl
|
|
4983
|
+
logoUrl: logoUrl,
|
|
4984
|
+
showSidebar: true
|
|
3532
4985
|
}), /*#__PURE__*/React.createElement("div", {
|
|
3533
4986
|
className: "main center-container mb-25"
|
|
3534
4987
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
@@ -3547,14 +5000,20 @@ var Home$1 = function Home$1(_ref) {
|
|
|
3547
5000
|
modules: modules
|
|
3548
5001
|
})), /*#__PURE__*/React.createElement(Route, {
|
|
3549
5002
|
path: path + "/login"
|
|
3550
|
-
},
|
|
5003
|
+
}, /*#__PURE__*/React.createElement(Login, {
|
|
3551
5004
|
stateCode: stateCode
|
|
3552
5005
|
})), /*#__PURE__*/React.createElement(Route, {
|
|
3553
5006
|
path: path + "/register"
|
|
3554
5007
|
}, /*#__PURE__*/React.createElement(Login, {
|
|
3555
5008
|
stateCode: stateCode,
|
|
3556
5009
|
isUserRegistered: false
|
|
3557
|
-
})),
|
|
5010
|
+
})), /*#__PURE__*/React.createElement(Route, {
|
|
5011
|
+
path: path + "/user/profile"
|
|
5012
|
+
}, /*#__PURE__*/React.createElement(UserProfile, {
|
|
5013
|
+
stateCode: stateCode,
|
|
5014
|
+
userType: "citizen",
|
|
5015
|
+
cityDetails: cityDetails
|
|
5016
|
+
})), /*#__PURE__*/React.createElement(ErrorBoundary, null, appRoutes, ModuleLevelLinkHomePages))), /*#__PURE__*/React.createElement("div", {
|
|
3558
5017
|
className: "citizen-home-footer",
|
|
3559
5018
|
style: window.location.href.includes("citizen/obps") ? {
|
|
3560
5019
|
zIndex: "-1"
|
|
@@ -3596,8 +5055,9 @@ var DigitApp = function DigitApp(_ref) {
|
|
|
3596
5055
|
var _ref2 = storeData || {},
|
|
3597
5056
|
stateInfo = _ref2.stateInfo;
|
|
3598
5057
|
|
|
3599
|
-
var CITIZEN = (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.type) === "CITIZEN" || !window.location.pathname.split("/").includes("employee") ? true : false;
|
|
3600
5058
|
var DSO = Digit.UserService.hasAccess(["FSM_DSO"]);
|
|
5059
|
+
var CITIZEN = (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.type) === "CITIZEN" || !window.location.pathname.split("/").includes("employee") ? true : false;
|
|
5060
|
+
if (window.location.pathname.split("/").includes("employee")) CITIZEN = false;
|
|
3601
5061
|
useEffect(function () {
|
|
3602
5062
|
if (!(pathname !== null && pathname !== void 0 && pathname.includes("application-details"))) {
|
|
3603
5063
|
if (!(pathname !== null && pathname !== void 0 && pathname.includes("inbox"))) {
|
|
@@ -3728,13 +5188,16 @@ var DigitUI = function DigitUI(_ref2) {
|
|
|
3728
5188
|
defaultOptions: {
|
|
3729
5189
|
queries: {
|
|
3730
5190
|
staleTime: 15 * 60 * 1000,
|
|
3731
|
-
cacheTime:
|
|
5191
|
+
cacheTime: 50 * 60 * 1000,
|
|
5192
|
+
retryDelay: function retryDelay(attemptIndex) {
|
|
5193
|
+
return Infinity;
|
|
5194
|
+
}
|
|
3732
5195
|
}
|
|
3733
5196
|
}
|
|
3734
5197
|
});
|
|
3735
5198
|
var ComponentProvider = Digit.Contexts.ComponentProvider;
|
|
3736
5199
|
var DSO = Digit.UserService.hasAccess(["FSM_DSO"]);
|
|
3737
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(QueryClientProvider, {
|
|
5200
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(QueryClientProvider, {
|
|
3738
5201
|
client: queryClient
|
|
3739
5202
|
}, /*#__PURE__*/React.createElement(ComponentProvider.Provider, {
|
|
3740
5203
|
value: registry
|
|
@@ -3742,9 +5205,11 @@ var DigitUI = function DigitUI(_ref2) {
|
|
|
3742
5205
|
stateCode: stateCode,
|
|
3743
5206
|
enabledModules: enabledModules,
|
|
3744
5207
|
moduleReducers: moduleReducers
|
|
3745
|
-
}))));
|
|
5208
|
+
})))));
|
|
5209
|
+
};
|
|
5210
|
+
var componentsToRegister = {
|
|
5211
|
+
SelectOtp: SelectOtp
|
|
3746
5212
|
};
|
|
3747
|
-
var componentsToRegister = {};
|
|
3748
5213
|
var initCoreComponents = function initCoreComponents() {
|
|
3749
5214
|
Object.entries(componentsToRegister).forEach(function (_ref3) {
|
|
3750
5215
|
var key = _ref3[0],
|