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