From b8813f0b850d4de0da66181b33c4d4ae1bb0ef1d Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:56:36 +0530 Subject: [PATCH 01/41] PFM-5822: forgot password fixes WIP --- .../employee/ChangePassword/changePassword.js | 9 ------- .../employee/ForgotPassword/forgotPassword.js | 26 ++++++++++++------- .../core/src/pages/employee/Login/login.js | 12 +++++---- .../src/atoms/MobileNumber.js | 11 +++++--- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index c67853708..1aaacee06 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -6,7 +6,6 @@ import Background from "../../../components/Background"; import Header from "../../../components/Header"; import SelectOtp from "../../citizen/Login/SelectOtp"; - const ChangePasswordComponent = ({ config: propsConfig, t }) => { const [user, setUser] = useState(null); const { mobile_number: mobileNumber, tenantId } = Digit.Hooks.useQueryParams(); @@ -76,14 +75,6 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { const config = [ { body: [ - { - label: t(username.label), - type: username.type, - populators: { - name: username.name, - }, - isMandatory: true, - }, { label: t(password.label), type: password.type, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js index 4968abec2..ce4ffd34c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ForgotPassword/forgotPassword.js @@ -12,6 +12,8 @@ const ForgotPassword = ({ config: propsConfig, t }) => { const [showToast, setShowToast] = useState(null); const getUserType = () => Digit.UserService.getType(); + const tenantId = Digit.ULBService.getCurrentTenantId(); + useEffect(() => { if (!user) { Digit.UserService.setType("employee"); @@ -27,21 +29,22 @@ const ForgotPassword = ({ config: propsConfig, t }) => { }; const onForgotPassword = async (data) => { - if (!data.city) { - alert("Please Select City!"); - return; - } + console.log("datatata", data); + // if (!data.city) { + // alert("Please Select City!"); + // return; + // } const requestData = { otp: { mobileNumber: data.mobileNumber, userType: getUserType().toUpperCase(), type: "passwordreset", - tenantId: data.city.code, + tenantId: tenantId, }, }; try { - await Digit.UserService.sendOtp(requestData, data.city.code); - history.push(`/${window?.contextPath}/employee/user/change-password?mobile_number=${data.mobileNumber}&tenantId=${data.city.code}`); + await Digit.UserService.sendOtp(requestData, tenantId); + history.push(`/${window?.contextPath}/employee/user/change-password?mobile_number=${data.mobileNumber}&tenantId=${tenantId}`); } catch (err) { setShowToast(err?.response?.data?.error?.fields?.[0]?.message || "Invalid login credentials!"); setTimeout(closeToast, 5000); @@ -61,10 +64,15 @@ const ForgotPassword = ({ config: propsConfig, t }) => { type: userId.type, populators: { name: userId.name, + validation: { + pattern: /^[6-9]\d{9}$/, + maxLength: 10, + }, componentInFront: "+91", }, + isMandatory: true, - } + }, ], }, ]; @@ -72,7 +80,7 @@ const ForgotPassword = ({ config: propsConfig, t }) => { if (isLoading) { return ; } - console.log(config,"config") + console.log("configgg", config); return (
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js index 733971c1f..755a546d8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js @@ -99,17 +99,19 @@ const Login = ({ config: propsConfig, t, isDisabled }) => { let config = [{ body: propsConfig?.inputs }]; + console.log("configigigig", config); + const { mode } = Digit.Hooks.useQueryParams(); if (mode === "admin" && config?.[0]?.body?.[2]?.disable == false && config?.[0]?.body?.[2]?.populators?.defaultValue == undefined) { config[0].body[2].disable = true; config[0].body[2].isMandatory = false; config[0].body[2].populators.defaultValue = defaultValue; } - if(config && config[0].body && config[0].body[1].label === 'CORE_LOGIN_PASSWORD'){ + if (config && config[0].body && config[0].body[1].label === "CORE_LOGIN_PASSWORD") { config[0].body[1].populators.validation = { - maxlength: 30 + maxlength: 30, }; - } + } return isLoading || isStoreLoading ? ( ) : ( @@ -117,7 +119,7 @@ const Login = ({ config: propsConfig, t, isDisabled }) => {
- + {
{!props.hideSpan ? ( - + +91 ) : null} -
+
Date: Tue, 12 Mar 2024 20:29:57 +0530 Subject: [PATCH 02/41] PFM-5822:Fixed forgot password not redirecting,added validation for password,added error message, upgraded to formcomposerv2 in forgotpassword & change password --- .../css/src/pages/employee/login.scss | 2 +- .../employee/ChangePassword/changePassword.js | 26 +++++++++++++++---- .../employee/ForgotPassword/forgotPassword.js | 22 +++++----------- .../core/src/pages/employee/Login/login.js | 1 - 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss index 11e44e28c..7f87db7f4 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss @@ -28,7 +28,7 @@ } .employeeForgotPassword .employee-card-input { - margin-bottom: 0px; + margin-bottom: 24px; border-left: none; } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index 1aaacee06..a699add8d 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -1,4 +1,4 @@ -import { BackButton, CardSubHeader, CardText, FormComposer, Toast } from "@egovernments/digit-ui-react-components"; +import { BackButton, CardSubHeader, CardText, FormComposer, FormComposerV2, Toast } from "@egovernments/digit-ui-react-components"; import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; @@ -71,15 +71,28 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { history.replace(`/${window?.contextPath}/employee/user/login`); }; - const [username, password, confirmPassword] = propsConfig.inputs; + const [ password, confirmPassword] = propsConfig.inputs; + + const config = [ { body: [ + // { + // label: t(username.label), + // type: username.type, + // populators: { + // name: username.name, + // }, + // isMandatory: true, + // }, { label: t(password.label), type: password.type, populators: { name: password.name, + validation:{ + maxlength: 30, + } }, isMandatory: true, }, @@ -88,19 +101,22 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { type: confirmPassword.type, populators: { name: confirmPassword.name, + validation:{ + maxlength: 30, + } }, isMandatory: true, }, ], }, - ]; + ]; return (
- { {t("CORE_OTP_RESEND")}
*/} - + {showToast && }
{ setShowToast(null); }; - const onForgotPassword = async (data) => { - console.log("datatata", data); - // if (!data.city) { - // alert("Please Select City!"); - // return; - // } + const onForgotPassword = async (data) => { const requestData = { otp: { mobileNumber: data.mobileNumber, @@ -61,18 +56,14 @@ const ForgotPassword = ({ config: propsConfig, t }) => { body: [ { label: t(userId.label), - type: userId.type, + type: "mobileNumber", populators: { name: userId.name, - validation: { - pattern: /^[6-9]\d{9}$/, - maxLength: 10, - }, componentInFront: "+91", }, - isMandatory: true, }, + ], }, ]; @@ -80,13 +71,12 @@ const ForgotPassword = ({ config: propsConfig, t }) => { if (isLoading) { return ; } - console.log("configgg", config); return (
- { className="employeeForgotPassword" >
- + {showToast && }
{ let config = [{ body: propsConfig?.inputs }]; - console.log("configigigig", config); const { mode } = Digit.Hooks.useQueryParams(); if (mode === "admin" && config?.[0]?.body?.[2]?.disable == false && config?.[0]?.body?.[2]?.populators?.defaultValue == undefined) { From b8988fa5fc4607afc2d7ebcea049dac7d32513db Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:30:24 +0530 Subject: [PATCH 03/41] PFM-5882: Updatd mobile --- .../react-components/src/atoms/MobileNumber.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js index 3fba3bf66..4339de81a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js @@ -16,21 +16,16 @@ const MobileNumber = (props) => {
{!props.hideSpan ? ( - + +91 ) : null} -
+
Date: Wed, 13 Mar 2024 10:40:33 +0530 Subject: [PATCH 04/41] PFM-5822: Updated css --- .../example/public/index.html | 18 +++++++++++++----- .../packages/css/src/pages/employee/login.scss | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html index ae2c5e697..e2d69c9f6 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html @@ -16,19 +16,27 @@ + + .employeeForgotPassword .employee-card-input { + margin-bottom: 24px; + border-left: none; + } + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss index 7f87db7f4..11e44e28c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss @@ -28,7 +28,7 @@ } .employeeForgotPassword .employee-card-input { - margin-bottom: 24px; + margin-bottom: 0px; border-left: none; } From 1dfbb70417f2ad7698e4777d4563fa6835e329c0 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:00:29 +0530 Subject: [PATCH 05/41] PFM-5822:Updated max and min length to 15 for change password --- .../core/src/pages/employee/ChangePassword/changePassword.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index a699add8d..b2dae9ba0 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -91,7 +91,7 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { populators: { name: password.name, validation:{ - maxlength: 30, + maxlength: 15, } }, isMandatory: true, @@ -102,7 +102,7 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { populators: { name: confirmPassword.name, validation:{ - maxlength: 30, + maxlength: 15, } }, isMandatory: true, From 70cd6fc37f1a0854c8641e2cdd52bb4a06d61560 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:07:26 +0530 Subject: [PATCH 06/41] PFM-5822: Updated css in index.html --- .../example/public/index.html | 2 +- frontend/micro-ui/web/public/index.html | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html index e2d69c9f6..dafdfbd71 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html @@ -33,7 +33,7 @@ } .employeeForgotPassword .employee-card-input { - margin-bottom: 24px; + margin-bottom: 24px !important; border-left: none; } diff --git a/frontend/micro-ui/web/public/index.html b/frontend/micro-ui/web/public/index.html index 2596676c6..2561ac4d5 100644 --- a/frontend/micro-ui/web/public/index.html +++ b/frontend/micro-ui/web/public/index.html @@ -12,18 +12,26 @@ mSeva From 022b3d26e51cd517fa72b2f5622e77cbacc38d2b Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:09:34 +0530 Subject: [PATCH 07/41] PFM-5842: Fixed category & subcategory value showing null --- .../providers/consumer_details_provider.dart | 105 +++++++++++------- 1 file changed, 62 insertions(+), 43 deletions(-) diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 71f9c50d9..aabae950a 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -152,15 +152,12 @@ class ConsumerProvider with ChangeNotifier { isEdit = true; waterconnection = data; waterconnection.getText(); - selectedcycle = {'code':DateTime.fromMillisecondsSinceEpoch(waterconnection.previousReadingDate!), - 'name':"${ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate(DateFormats.timeStampToDate( - waterconnection.previousReadingDate, - format: 'MMMM')) + - " - " + - DateFormats.timeStampToDate( - waterconnection.previousReadingDate, - format: 'yyyy')}"}; + selectedcycle = { + 'code': DateTime.fromMillisecondsSinceEpoch( + waterconnection.previousReadingDate!), + 'name': + "${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(DateFormats.timeStampToDate(waterconnection.previousReadingDate, format: 'MMMM')) + " - " + DateFormats.timeStampToDate(waterconnection.previousReadingDate, format: 'yyyy')}" + }; if (waterconnection.previousReadingDate != null && (languageList?.mdmsRes?.billingService?.taxPeriodList?.isNotEmpty ?? false)) { @@ -479,12 +476,14 @@ class ConsumerProvider with ChangeNotifier { "tenantId": commonProvider.userDetails!.selectedtenant!.code }); boundaryList = []; - result['TenantBoundary']!=null && result['TenantBoundary'].length>0?boundaryList.addAll( - TenantBoundary.fromJson(result['TenantBoundary'][0]).boundary!):{}; + result['TenantBoundary'] != null && result['TenantBoundary'].length > 0 + ? boundaryList.addAll( + TenantBoundary.fromJson(result['TenantBoundary'][0]).boundary!) + : {}; if (boundaryList.length == 1) { property.address.localityCtrl = boundaryList.first; onChangeOfLocality(property.address.localityCtrl); - }else{ + } else { boundaryList.add(Boundary.fromJson({ "code": "WARD1", "name": commonProvider.userDetails!.selectedtenant!.name, @@ -528,12 +527,14 @@ class ConsumerProvider with ChangeNotifier { void onChangeOfCategory(val) { waterconnection.additionalDetails ??= addition.AdditionalDetails(); + waterconnection.categoryCtrl.text = val; waterconnection.additionalDetails?.category = val; notifyListeners(); } void onChangeOfSubCategory(val) { waterconnection.additionalDetails ??= addition.AdditionalDetails(); + waterconnection.subCategoryCtrl.text = val; waterconnection.additionalDetails?.subCategory = val; notifyListeners(); } @@ -555,8 +556,8 @@ class ConsumerProvider with ChangeNotifier { return (languageList?.mdmsRes?.category?.categoryList ?? []) .map((value) { return value.code!; - }).toList(); - } + }).toList(); + } return []; } @@ -600,7 +601,8 @@ class ConsumerProvider with ChangeNotifier { DateTime result = DateTime.parse(val['code'].toString()); waterconnection.previousReadingDateCtrl.clear(); waterconnection.BillingCycleCtrl.text = result.toLocal().toString(); - waterconnection.meterInstallationDateCtrl.text = result.toLocal().toString(); + waterconnection.meterInstallationDateCtrl.text = + result.toLocal().toString(); notifyListeners(); } @@ -617,8 +619,8 @@ class ConsumerProvider with ChangeNotifier { } //Displaying Billing Cycle Vaule (EX- JAN-2021,,) - List> getBillingCycle() { - var dates = >[]; + List> getBillingCycle() { + var dates = >[]; if (billYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -627,32 +629,35 @@ class ConsumerProvider with ChangeNotifier { var toDate = DateFormats.getFormattedDateToDateTime( DateFormats.timeStampToDate(billYear?.toDate)) as DateTime; - ytd = DatePeriod(fromDate,toDate,DateType.YTD); + ytd = DatePeriod(fromDate, toDate, DateType.YTD); /// Get months based on selected billing year var months = CommonMethods.getPastMonthUntilFinancialYTD(ytd); /// if selected year is future year means all the months will be removed - if(fromDate.year > ytd.endDate.year) months.clear(); + if (fromDate.year > ytd.endDate.year) months.clear(); for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[prevMonth.month - 1])) + - " - " + - prevMonth.year.toString()}'}; + var r = { + "code": prevMonth, + "name": + '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate((Constants.MONTHS[prevMonth.month - 1])) + " - " + prevMonth.year.toString()}' + }; dates.add(r); } } if (dates.length > 0 && waterconnection.connectionType == 'Non_Metered') { return dates; } - return >[]; + return >[]; } + //Displaying Billing Cycle Vaule (EX- JAN-2021,,) - List> getBillingCycleMonthCountCurrent(TaxPeriod? billYear) { - var dates = >[]; - if (billYear!=null) { + List> getBillingCycleMonthCountCurrent( + TaxPeriod? billYear) { + var dates = >[]; + if (billYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( DateFormats.timeStampToDate(billYear?.fromDate)) as DateTime; @@ -660,27 +665,28 @@ class ConsumerProvider with ChangeNotifier { var toDate = DateFormats.getFormattedDateToDateTime( DateFormats.timeStampToDate(billYear?.toDate)) as DateTime; - ytd = DatePeriod(fromDate,toDate,DateType.YTD); + ytd = DatePeriod(fromDate, toDate, DateType.YTD); /// Get months based on selected billing year var months = CommonMethods.getPastMonthUntilFinancialYTD(ytd); /// if selected year is future year means all the months will be removed - if(fromDate.year > ytd.endDate.year) months.clear(); + if (fromDate.year > ytd.endDate.year) months.clear(); for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[prevMonth.month - 1])) + - " - " + - prevMonth.year.toString()}'}; + var r = { + "code": prevMonth, + "name": + '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate((Constants.MONTHS[prevMonth.month - 1])) + " - " + prevMonth.year.toString()}' + }; dates.add(r); } } if (dates.length > 0 && waterconnection.connectionType == 'Non_Metered') { return dates; } - return >[]; + return >[]; } incrementIndex(index, consumerGenderKey) async { @@ -714,28 +720,41 @@ class ConsumerProvider with ChangeNotifier { List getFinancialYearList() { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { - CommonMethods.getFilteredFinancialYearList(languageList?.mdmsRes?.billingService?.taxPeriodList ?? []); - languageList?.mdmsRes?.billingService?.taxPeriodList!.sort((a,b)=>a.fromDate!.compareTo(b.fromDate!)); + CommonMethods.getFilteredFinancialYearList( + languageList?.mdmsRes?.billingService?.taxPeriodList ?? + []); + languageList?.mdmsRes?.billingService?.taxPeriodList! + .sort((a, b) => a.fromDate!.compareTo(b.fromDate!)); return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []) + []) .map((value) { - return value; - }).toList().reversed.toList(); + return value; + }) + .toList() + .reversed + .toList(); } return []; } + List getLastFinancialYearList(int count) { - return getFinancialYearList().length>count?getFinancialYearList().sublist(0,count):getFinancialYearList(); + return getFinancialYearList().length > count + ? getFinancialYearList().sublist(0, count) + : getFinancialYearList(); } - List> newBillingCycleFunction({int pastMonthCount = 2}){ + + List> newBillingCycleFunction({int pastMonthCount = 2}) { List financialYears = getFinancialYearList(); - var dates = >[]; + var dates = >[]; financialYears.forEach((year) { dates.addAll(getBillingCycleMonthCountCurrent(year)); }); dates.sort((a, b) => b['code'].compareTo(a['code'])); - return dates.toList().length>2?dates.toList().sublist(0,2):dates.toList(); + return dates.toList().length > 2 + ? dates.toList().sublist(0, 2) + : dates.toList(); } + void onChangeOfAmountType(value) { waterconnection.paymentType = value; From 50cba4d484c098346b17bd2367f4f83c0952ee19 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:13:49 +0530 Subject: [PATCH 08/41] Revert "PFM-5842: Fixed category & subcategory value showing null" This reverts commit 022b3d26e51cd517fa72b2f5622e77cbacc38d2b. --- .../providers/consumer_details_provider.dart | 105 +++++++----------- 1 file changed, 43 insertions(+), 62 deletions(-) diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index aabae950a..71f9c50d9 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -152,12 +152,15 @@ class ConsumerProvider with ChangeNotifier { isEdit = true; waterconnection = data; waterconnection.getText(); - selectedcycle = { - 'code': DateTime.fromMillisecondsSinceEpoch( - waterconnection.previousReadingDate!), - 'name': - "${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(DateFormats.timeStampToDate(waterconnection.previousReadingDate, format: 'MMMM')) + " - " + DateFormats.timeStampToDate(waterconnection.previousReadingDate, format: 'yyyy')}" - }; + selectedcycle = {'code':DateTime.fromMillisecondsSinceEpoch(waterconnection.previousReadingDate!), + 'name':"${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate(DateFormats.timeStampToDate( + waterconnection.previousReadingDate, + format: 'MMMM')) + + " - " + + DateFormats.timeStampToDate( + waterconnection.previousReadingDate, + format: 'yyyy')}"}; if (waterconnection.previousReadingDate != null && (languageList?.mdmsRes?.billingService?.taxPeriodList?.isNotEmpty ?? false)) { @@ -476,14 +479,12 @@ class ConsumerProvider with ChangeNotifier { "tenantId": commonProvider.userDetails!.selectedtenant!.code }); boundaryList = []; - result['TenantBoundary'] != null && result['TenantBoundary'].length > 0 - ? boundaryList.addAll( - TenantBoundary.fromJson(result['TenantBoundary'][0]).boundary!) - : {}; + result['TenantBoundary']!=null && result['TenantBoundary'].length>0?boundaryList.addAll( + TenantBoundary.fromJson(result['TenantBoundary'][0]).boundary!):{}; if (boundaryList.length == 1) { property.address.localityCtrl = boundaryList.first; onChangeOfLocality(property.address.localityCtrl); - } else { + }else{ boundaryList.add(Boundary.fromJson({ "code": "WARD1", "name": commonProvider.userDetails!.selectedtenant!.name, @@ -527,14 +528,12 @@ class ConsumerProvider with ChangeNotifier { void onChangeOfCategory(val) { waterconnection.additionalDetails ??= addition.AdditionalDetails(); - waterconnection.categoryCtrl.text = val; waterconnection.additionalDetails?.category = val; notifyListeners(); } void onChangeOfSubCategory(val) { waterconnection.additionalDetails ??= addition.AdditionalDetails(); - waterconnection.subCategoryCtrl.text = val; waterconnection.additionalDetails?.subCategory = val; notifyListeners(); } @@ -556,8 +555,8 @@ class ConsumerProvider with ChangeNotifier { return (languageList?.mdmsRes?.category?.categoryList ?? []) .map((value) { return value.code!; - }).toList(); - } + }).toList(); + } return []; } @@ -601,8 +600,7 @@ class ConsumerProvider with ChangeNotifier { DateTime result = DateTime.parse(val['code'].toString()); waterconnection.previousReadingDateCtrl.clear(); waterconnection.BillingCycleCtrl.text = result.toLocal().toString(); - waterconnection.meterInstallationDateCtrl.text = - result.toLocal().toString(); + waterconnection.meterInstallationDateCtrl.text = result.toLocal().toString(); notifyListeners(); } @@ -619,8 +617,8 @@ class ConsumerProvider with ChangeNotifier { } //Displaying Billing Cycle Vaule (EX- JAN-2021,,) - List> getBillingCycle() { - var dates = >[]; + List> getBillingCycle() { + var dates = >[]; if (billYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -629,35 +627,32 @@ class ConsumerProvider with ChangeNotifier { var toDate = DateFormats.getFormattedDateToDateTime( DateFormats.timeStampToDate(billYear?.toDate)) as DateTime; - ytd = DatePeriod(fromDate, toDate, DateType.YTD); + ytd = DatePeriod(fromDate,toDate,DateType.YTD); /// Get months based on selected billing year var months = CommonMethods.getPastMonthUntilFinancialYTD(ytd); /// if selected year is future year means all the months will be removed - if (fromDate.year > ytd.endDate.year) months.clear(); + if(fromDate.year > ytd.endDate.year) months.clear(); for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = { - "code": prevMonth, - "name": - '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate((Constants.MONTHS[prevMonth.month - 1])) + " - " + prevMonth.year.toString()}' - }; + var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}'}; dates.add(r); } } if (dates.length > 0 && waterconnection.connectionType == 'Non_Metered') { return dates; } - return >[]; + return >[]; } - //Displaying Billing Cycle Vaule (EX- JAN-2021,,) - List> getBillingCycleMonthCountCurrent( - TaxPeriod? billYear) { - var dates = >[]; - if (billYear != null) { + List> getBillingCycleMonthCountCurrent(TaxPeriod? billYear) { + var dates = >[]; + if (billYear!=null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( DateFormats.timeStampToDate(billYear?.fromDate)) as DateTime; @@ -665,28 +660,27 @@ class ConsumerProvider with ChangeNotifier { var toDate = DateFormats.getFormattedDateToDateTime( DateFormats.timeStampToDate(billYear?.toDate)) as DateTime; - ytd = DatePeriod(fromDate, toDate, DateType.YTD); + ytd = DatePeriod(fromDate,toDate,DateType.YTD); /// Get months based on selected billing year var months = CommonMethods.getPastMonthUntilFinancialYTD(ytd); /// if selected year is future year means all the months will be removed - if (fromDate.year > ytd.endDate.year) months.clear(); + if(fromDate.year > ytd.endDate.year) months.clear(); for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = { - "code": prevMonth, - "name": - '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate((Constants.MONTHS[prevMonth.month - 1])) + " - " + prevMonth.year.toString()}' - }; + var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}'}; dates.add(r); } } if (dates.length > 0 && waterconnection.connectionType == 'Non_Metered') { return dates; } - return >[]; + return >[]; } incrementIndex(index, consumerGenderKey) async { @@ -720,41 +714,28 @@ class ConsumerProvider with ChangeNotifier { List getFinancialYearList() { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { - CommonMethods.getFilteredFinancialYearList( - languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []); - languageList?.mdmsRes?.billingService?.taxPeriodList! - .sort((a, b) => a.fromDate!.compareTo(b.fromDate!)); + CommonMethods.getFilteredFinancialYearList(languageList?.mdmsRes?.billingService?.taxPeriodList ?? []); + languageList?.mdmsRes?.billingService?.taxPeriodList!.sort((a,b)=>a.fromDate!.compareTo(b.fromDate!)); return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []) + []) .map((value) { - return value; - }) - .toList() - .reversed - .toList(); + return value; + }).toList().reversed.toList(); } return []; } - List getLastFinancialYearList(int count) { - return getFinancialYearList().length > count - ? getFinancialYearList().sublist(0, count) - : getFinancialYearList(); + return getFinancialYearList().length>count?getFinancialYearList().sublist(0,count):getFinancialYearList(); } - - List> newBillingCycleFunction({int pastMonthCount = 2}) { + List> newBillingCycleFunction({int pastMonthCount = 2}){ List financialYears = getFinancialYearList(); - var dates = >[]; + var dates = >[]; financialYears.forEach((year) { dates.addAll(getBillingCycleMonthCountCurrent(year)); }); dates.sort((a, b) => b['code'].compareTo(a['code'])); - return dates.toList().length > 2 - ? dates.toList().sublist(0, 2) - : dates.toList(); + return dates.toList().length>2?dates.toList().sublist(0,2):dates.toList(); } - void onChangeOfAmountType(value) { waterconnection.paymentType = value; From 2cf7ca635b4fcc8959d616a5d9e449570dc3cea1 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:17:16 +0530 Subject: [PATCH 09/41] PFM-5842: Fixed category & subcategory value showing null --- frontend/mgramseva/lib/providers/consumer_details_provider.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 71f9c50d9..92b8cac9b 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -528,12 +528,14 @@ class ConsumerProvider with ChangeNotifier { void onChangeOfCategory(val) { waterconnection.additionalDetails ??= addition.AdditionalDetails(); + waterconnection.categoryCtrl.text = val; waterconnection.additionalDetails?.category = val; notifyListeners(); } void onChangeOfSubCategory(val) { waterconnection.additionalDetails ??= addition.AdditionalDetails(); + waterconnection.subCategoryCtrl.text = val; waterconnection.additionalDetails?.subCategory = val; notifyListeners(); } From 043553ebece25c720ae964c30499423200932234 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:22:04 +0530 Subject: [PATCH 10/41] PFM-5968:Updated password to max 10 --- .../core/src/pages/employee/ChangePassword/changePassword.js | 4 ++-- .../packages/modules/core/src/pages/employee/Login/login.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index b2dae9ba0..f525f93b2 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -91,7 +91,7 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { populators: { name: password.name, validation:{ - maxlength: 15, + maxlength: 10, } }, isMandatory: true, @@ -102,7 +102,7 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { populators: { name: confirmPassword.name, validation:{ - maxlength: 15, + maxlength: 10, } }, isMandatory: true, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js index 099bf707a..d260417c8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js @@ -108,7 +108,7 @@ const Login = ({ config: propsConfig, t, isDisabled }) => { } if (config && config[0].body && config[0].body[1].label === "CORE_LOGIN_PASSWORD") { config[0].body[1].populators.validation = { - maxlength: 30, + maxlength: 10, }; } return isLoading || isStoreLoading ? ( From 608f00b797e7c825a95c41d8a2e68690d175b3d1 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:59:41 +0530 Subject: [PATCH 11/41] PFM-5969: Added select all for roles dropdown --- .../modules/hrms/src/components/pageComponents/jurisdiction.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index 5a406bce8..a669c3b21 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -613,6 +613,7 @@ function Jurisdiction({ options={getroledata(roleoption)} onSelect={selectrole} optionsKey="labelKey" + showSelectAll={true} t={t} />
From c5611aba247045f9d3a83d78c650aecff434592b Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:16:24 +0530 Subject: [PATCH 12/41] PFM-5983: Password length max set to 10, Fixed uppercase not giving hint --- .../change_password/change_password.dart | 3 +++ .../lib/utils/constants/i18_key_constants.dart | 3 +++ .../mgramseva/lib/widgets/password_hint.dart | 17 +++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/frontend/mgramseva/lib/screeens/change_password/change_password.dart b/frontend/mgramseva/lib/screeens/change_password/change_password.dart index ea786bedf..58f51b9ca 100644 --- a/frontend/mgramseva/lib/screeens/change_password/change_password.dart +++ b/frontend/mgramseva/lib/screeens/change_password/change_password.dart @@ -85,6 +85,7 @@ class _ChangePasswordState extends State { passwordDetails.currentpasswordCtrl, obscureText: true, isRequired: true, + maxLength: 10, maxLines: 1, onChange: (value) => saveInput(value), key: Keys.changePassword.CURRENT_PASSWORD_KEY, @@ -94,6 +95,7 @@ class _ChangePasswordState extends State { passwordDetails.newpasswordCtrl, obscureText: true, isRequired: true, + maxLength: 10, maxLines: 1, validator: (val) => Validators.passwordComparision( val, ApplicationLocalizations.of(context).translate(i18.password.NEW_PASSWORD_ENTER)), @@ -105,6 +107,7 @@ class _ChangePasswordState extends State { passwordDetails.confirmpasswordCtrl, obscureText: true, isRequired: true, + maxLength: 10, maxLines: 1, validator: (val) => Validators.passwordComparision( val, diff --git a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart index 27c7708d6..6fd9a90e6 100644 --- a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart +++ b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart @@ -261,6 +261,8 @@ class Password { 'CORE_PASS_HINT_ATLEAST_ONE_LETTER'; String get PASS_HINT_ATLEAST_ONE_NUMBER => 'CORE_PASS_HINT_ATLEAST_ONE_NUMBER'; + String get PASS_HINT_ATLEAST_ONE_UPPERCASE => + 'CORE_PASS_HINT_ATLEAST_ONE_UPPERCASE'; String get PASS_HINT_ATLEAST_ONE_SPECIAL_CHARACTER => 'CORE_PASS_HINT_ATLEAST_ONE_SPECIAL_CHARACTER'; String get ENTER_OTP_SENT_TO => 'ENTER_OTP_SENT_TO'; @@ -277,6 +279,7 @@ class Password { String get NEW_PASSWORD_ENTER => 'NEW_PASSWORD_ENTER'; String get CONFIRM_PASSWORD_ENTER => 'CONFIRM_PASSWORD_ENTER'; String get INVITED_TO_SINGLE_GP => 'INVITED_TO_SINGLE_GP'; + } class Expense { diff --git a/frontend/mgramseva/lib/widgets/password_hint.dart b/frontend/mgramseva/lib/widgets/password_hint.dart index 117cae20e..e38ec3256 100644 --- a/frontend/mgramseva/lib/widgets/password_hint.dart +++ b/frontend/mgramseva/lib/widgets/password_hint.dart @@ -97,6 +97,23 @@ class PasswordHint extends StatelessWidget { color: Colors.green[900], ) : Text("") + ]), + SizedBox(height: 5), + Row(children: [ + Text( + ApplicationLocalizations.of(context).translate(i18.password.PASS_HINT_ATLEAST_ONE_UPPERCASE), + style: TextStyle( + fontSize: 16, + color: RegExp(r'^(?=.*[A-Z])').hasMatch(inputPassword) + ? Colors.green[900] + : Theme.of(context).hintColor), + ), + new RegExp(r'^(?=.*[A-Z])').hasMatch(inputPassword) + ? Icon( + Icons.check, + color: Colors.green[900], + ) + : Text("") ]) ], )), From 8508a99f23206ed410722aca8ff9465418fd7398 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:27:02 +0530 Subject: [PATCH 13/41] PFM-5973 Added condtion to open any dashboard in new tab --- .../modules/hrms/src/components/EmployeeModuleCard.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js index 4e02d0591..d15c46784 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js @@ -18,6 +18,8 @@ const EmployeeModuleCard = ({ ); + console.log(links,'links') + return (
@@ -48,6 +50,9 @@ const EmployeeModuleCard = ({ {links.map(({ count, label, link }, index) => ( {link && link?.includes("https") ? ( + label.includes("Dashboard")? + {label} + : {label} From b8c7ae3fa25bd1cb79ff02a923d9212700c5f310 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:29:53 +0530 Subject: [PATCH 14/41] PFM-5973 Added condtion to open any dashboard in new tab --- .../packages/modules/hrms/src/components/EmployeeModuleCard.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js index d15c46784..d46766fb7 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/EmployeeModuleCard.js @@ -18,8 +18,6 @@ const EmployeeModuleCard = ({ ); - console.log(links,'links') - return (
From 3ed308a2be78c6bd49d5d19daef2df7ec3bdce46 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:03:43 +0530 Subject: [PATCH 15/41] PFM-5971 added filter for current tenant --- .../modules/hrms/src/components/pageComponents/jurisdiction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index 5a406bce8..805bc0f00 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -73,7 +73,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => { }, []); useEffect(() => { - let cities = userData?.user[0]?.roles?.map((role) => role.tenantId)?.filter((value, index, array) => array.indexOf(value) === index); + let cities = [Digit.ULBService.getCurrentTenantId()] selectboundary( data?.MdmsRes?.tenant?.tenants From f612d1438143a7aacdb757eb1efc9356952f4f50 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:09:47 +0530 Subject: [PATCH 16/41] PFM-5984 Added Eye for password visibility --- .../react-components/src/atoms/Password.js | 51 ++++ .../react-components/src/atoms/svgindex.js | 21 +- .../src/hoc/FormComposerV2.js | 289 ++++++++++-------- 3 files changed, 226 insertions(+), 135 deletions(-) create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js new file mode 100644 index 000000000..e48d11618 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js @@ -0,0 +1,51 @@ +import React, { useEffect, useState } from "react"; +import PropTypes from "prop-types"; +import { PasswordEyeEnableSvg, PasswordEyeDisableSvg } from "./svgindex"; + +const Password = (props) => { + const user_type = Digit.SessionStorage.get("userType"); + const [passwordVisibleFlag, setPasswordVisibleFlag] = useState(false); + const onChange = (e) => { + let val = e.target.value; + props?.onChange?.(val); + }; + const showPassword = () => { + setPasswordVisibleFlag(!passwordVisibleFlag); + }; + + return ( + +
+
+ +
+ {!props.hideSpan ? ( + + {passwordVisibleFlag?:} + + + ) : null} +
+
+ ); +}; + +export default Password; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js index 25aaa8c80..22df02952 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js @@ -1741,6 +1741,22 @@ const WarningIcon =({ className = "", fill = "none", style = {} })=>( ) + +const PasswordEyeEnableSvg = ({ className, fill = "white", style = {} }) => ( + + + + +); + +const PasswordEyeDisableSvg = ({ className, fill = "white", style = {} }) => ( + + + + + +); + const ExpenditureIcon = BillsIcon; export { @@ -1893,5 +1909,8 @@ export { InfoIcon, PaymentIcon, HistoryIcon, - WarningIcon + WarningIcon, + PasswordEyeEnableSvg, + PasswordEyeDisableSvg + }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposerV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposerV2.js index e887890e4..9c7263f48 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposerV2.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposerV2.js @@ -21,7 +21,7 @@ import MobileNumber from "../atoms/MobileNumber"; import _ from "lodash"; import CustomDropdown from "../molecules/CustomDropdown"; import MultiUploadWrapper from "../molecules/MultiUploadWrapper"; -import HorizontalNav from "../atoms/HorizontalNav" +import HorizontalNav from "../atoms/HorizontalNav" import Toast from "../atoms/Toast"; import UploadFileComposer from "./UploadFileComposer"; import CheckBox from "../atoms/CheckBox"; @@ -30,6 +30,7 @@ import Paragraph from "../atoms/Paragraph"; import InputTextAmount from "../atoms/InputTextAmount"; import LocationDropdownWrapper from "../molecules/LocationDropdownWrapper"; import ApiDropdown from "../molecules/ApiDropdown"; +import Password from "../atoms/Password"; const wrapperStyles = { // "display":"flex", @@ -86,20 +87,20 @@ export const FormComposer = (props) => { const { t } = useTranslation(); const formData = watch(); const selectedFormCategory = props?.currentFormCategory; - const [showErrorToast, setShowErrorToast] = useState(false); + const [showErrorToast, setShowErrorToast] = useState(false); //clear all errors if user has changed the form category. //This is done in case user first click on submit and have errors in cat 1, switches to cat 2 and hit submit with errors //So, he should not get error prompts from previous cat 1 on cat 2 submit. - useEffect(()=>{ + useEffect(() => { clearErrors(); - },[selectedFormCategory]); + }, [selectedFormCategory]); - useEffect(()=>{ - if(Object.keys(formState?.errors).length > 0 && formState?.submitCount > 0) { + useEffect(() => { + if (Object.keys(formState?.errors).length > 0 && formState?.submitCount > 0) { setShowErrorToast(true); } - },[formState?.errors, formState?.submitCount]); + }, [formState?.errors, formState?.submitCount]); useEffect(() => { if ( @@ -137,13 +138,33 @@ export const FormComposer = (props) => { } const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component; const customValidation = config?.populators?.validation?.customValidation; - const customRules = customValidation ? {validate : customValidation} : {}; + const customRules = customValidation ? { validate: customValidation } : {}; const customProps = config?.customProps; + console.log(type,"type"); switch (type) { case "date": case "text": case "number": case "password": + return ( + ( + + )} + defaultValue={populators.defaultValue} + name={populators?.name} + rules={!disableFormValidation ? { required: isMandatory, ...populators.validation } : {}} + control={control} + /> + ); case "time": // if (populators.defaultValue) setTimeout(setValue(populators?.name, populators.defaultValue)); return ( @@ -178,40 +199,40 @@ export const FormComposer = (props) => {
); case "amount": - // if (populators.defaultValue) setTimeout(setValue(populators?.name, populators.defaultValue)); - return ( -
- {populators?.componentInFront ? ( - {populators.componentInFront} - ) : null} - ( - - )} - name={populators.name} - rules={!disableFormValidation ? { required: isMandatory, ...populators.validation, ...customRules } : {}} - control={control} - /> -
- ); + // if (populators.defaultValue) setTimeout(setValue(populators?.name, populators.defaultValue)); + return ( +
+ {populators?.componentInFront ? ( + {populators.componentInFront} + ) : null} + ( + + )} + name={populators.name} + rules={!disableFormValidation ? { required: isMandatory, ...populators.validation, ...customRules } : {}} + control={control} + /> +
+ ); case "textarea": // if (populators.defaultValue) setTimeout(setValue(populators?.name, populators.defaultValue)); return ( @@ -227,7 +248,7 @@ export const FormComposer = (props) => { inputRef={ref} disable={disable} errorStyle={errors?.[populators.name]} - style={{marginTop: 0}} + style={{ marginTop: 0 }} maxlength={populators?.validation?.maxlength} minlength={populators?.validation?.minlength} /> @@ -295,7 +316,7 @@ export const FormComposer = (props) => { defaultValue={formData?.[populators.name]} rules={{ required: populators?.isMandatory }} render={(props) => { - + return (
{ // ...props.value, // [e.target.value]: e.target.checked // } - + props.onChange(e.target.checked) }} - value={formData?.[populators.name] } + value={formData?.[populators.name]} checked={formData?.[populators.name]} label={t(`${populators?.title}`)} - styles = {populators?.styles} + styles={populators?.styles} style={populators?.labelStyles} customLabelMarkup={populators?.customLabelMarkup} /> @@ -339,7 +360,7 @@ export const FormComposer = (props) => { }); } //here we need to update the form the same way as the state of the reducer in multiupload, since Upload component within the multiupload wrapper uses that same format of state so we need to set the form data as well in the same way. Previously we were altering it and updating the formData - onChange(numberOfFiles>0?filesData:[]); + onChange(numberOfFiles > 0 ? filesData : []); } return ( { extraStyleName={{ padding: "0.5rem" }} customClass={populators?.customClass} customErrorMsg={populators?.errorMessage} - containerStyles={{...populators?.containerStyles}} + containerStyles={{ ...populators?.containerStyles }} /> ); }} @@ -402,7 +423,7 @@ export const FormComposer = (props) => { formData={formData} register={register} errors={errors} - props={{...props, ...customProps}} + props={{ ...props, ...customProps }} setError={setError} clearErrors={clearErrors} formState={formState} @@ -453,8 +474,8 @@ export const FormComposer = (props) => { control={control} /> - ); - + ); + case "locationdropdown": return ( { /> ); - case "apidropdown": + case "apidropdown": return ( { }} /> ); - case "multiselectdropdown": + case "multiselectdropdown": return ( { props={props} isPropsNeeded={true} onSelect={(e) => { - props.onChange(e?.map(row=>{return row?.[1] ? row[1] : null}).filter(e=>e)) + props.onChange(e?.map(row => { return row?.[1] ? row[1] : null }).filter(e => e)) }} selected={props?.value || []} defaultLabel={t(populators?.defaultText)} @@ -606,20 +627,20 @@ export const FormComposer = (props) => { } //remove Toast from 3s - useEffect(()=>{ - if(showErrorToast){ - setTimeout(()=>{ + useEffect(() => { + if (showErrorToast) { + setTimeout(() => { closeToast(); - },3000) + }, 3000) } - },[showErrorToast]) + }, [showErrorToast]) const formFields = useCallback( (section, index, array, sectionFormCategory) => ( {section && getCombinedComponent(section)} {section.body.map((field, index) => { - if(field?.populators?.hideInForm) return null + if (field?.populators?.hideInForm) return null if (props.inline) return ( @@ -664,7 +685,7 @@ export const FormComposer = (props) => { style={ props?.showWrapperContainers && !field.hideContainer ? { ...wrapperStyles, ...field?.populators?.customStyle } - : { border: "none", background: "white", ...field?.populators?.customStyle } + : { border: "none", background: "white", ...field?.populators?.customStyle } } > {!field.withoutLabel && ( @@ -776,7 +797,7 @@ export const FormComposer = (props) => { const getCardStyles = (shouldDisplay = true) => { let styles = props.cardStyle || {}; if (props.noBoxShadow) styles = { ...styles, boxShadow: "none" }; - if(!shouldDisplay) styles = {...styles, display : "none"} + if (!shouldDisplay) styles = { ...styles, display: "none" } return styles; }; @@ -789,98 +810,98 @@ export const FormComposer = (props) => { }; const setActiveNavByDefault = (configNav) => { - + let setActiveByDefaultRow = null configNav?.forEach(row => { - if(row?.activeByDefault){ + if (row?.activeByDefault) { setActiveByDefaultRow = row } }) - if(setActiveByDefaultRow){ + if (setActiveByDefaultRow) { return setActiveByDefaultRow?.name } - + return configNav?.[0]?.name } - const [activeLink, setActiveLink] = useState(props.horizontalNavConfig?setActiveNavByDefault(props.horizontalNavConfig):null); + const [activeLink, setActiveLink] = useState(props.horizontalNavConfig ? setActiveNavByDefault(props.horizontalNavConfig) : null); - useEffect(()=>{ + useEffect(() => { setActiveLink(setActiveNavByDefault(props.horizontalNavConfig)); - },[props.horizontalNavConfig]); - + }, [props.horizontalNavConfig]); + const renderFormFields = (props, section, index, array, sectionFormCategory) => ( - - {!props.childrenAtTheBottom && props.children} - {props.heading && {props.heading} } - {props.description && {props.description} } - {props.text && {props.text}} - {formFields(section, index, array, sectionFormCategory)} - {props.childrenAtTheBottom && props.children} - {props.submitInForm && ( - - )} - {props.secondaryActionLabel && ( -
- {props.secondaryActionLabel} -
)} -
+ + {!props.childrenAtTheBottom && props.children} + {props.heading && {props.heading} } + {props.description && {props.description} } + {props.text && {props.text}} + {formFields(section, index, array, sectionFormCategory)} + {props.childrenAtTheBottom && props.children} + {props.submitInForm && ( + + )} + {props.secondaryActionLabel && ( +
+ {props.secondaryActionLabel} +
)} +
); return (
checkKeyDown(e)} id={props.formId} className={props.className}> {props?.showMultipleCardsWithoutNavs ? ( - props?.config?.map((section, index, array) => { - return !section.navLink && ( - - {renderFormFields(props, section, index, array)} - - ) - }) - ) : ( - - { - props?.config?.map((section, index, array) => { - return !section.navLink && ( - <> - {renderFormFields(props, section, index, array)} - - ) - }) - } - + props?.config?.map((section, index, array) => { + return !section.navLink && ( + + {renderFormFields(props, section, index, array)} + ) + }) + ) : ( + + { + props?.config?.map((section, index, array) => { + return !section.navLink && ( + <> + {renderFormFields(props, section, index, array)} + + ) + }) + } + + ) } - { props?.showFormInNav && props.horizontalNavConfig && ( - - {props?.showMultipleCardsInNavs ? ( - props?.config?.map((section, index, array) => { - return section.navLink ? ( - - {renderFormFields(props, section, index, array, section?.sectionFormCategory)} - - ) : null - }) - ) : - ( - - { - props?.config?.map((section, index, array) => { - return section.navLink ? ( - <> -
- {renderFormFields(props, section, index, array, section?.sectionFormCategory)} -
- - ) : null - }) - } -
- ) - } -
- ) + {props?.showFormInNav && props.horizontalNavConfig && ( + + {props?.showMultipleCardsInNavs ? ( + props?.config?.map((section, index, array) => { + return section.navLink ? ( + + {renderFormFields(props, section, index, array, section?.sectionFormCategory)} + + ) : null + }) + ) : + ( + + { + props?.config?.map((section, index, array) => { + return section.navLink ? ( + <> +
+ {renderFormFields(props, section, index, array, section?.sectionFormCategory)} +
+ + ) : null + }) + } +
+ ) + } +
+ ) } {!props.submitInForm && props.label && ( From 2044be5c155046883b8d74cd8974a16e5d2ac521 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:18:47 +0530 Subject: [PATCH 17/41] PFM-5984 Addition of password icon --- .../react-components/src/atoms/SVG.js | 1583 +++++++++++++++++ .../src/atoms/StringManipulator.js | 54 + 2 files changed, 1637 insertions(+) create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js create mode 100644 frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StringManipulator.js diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js new file mode 100644 index 000000000..56d3ab2dc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js @@ -0,0 +1,1583 @@ +import { + Rotation3D, + SixFtApart, + Rotate360, + Accessibility, + AccessibilityNew, + Accessible, + AccessibleForward, + AccountBalance, + AccountBalanceWallet, + AccountBox, + AccountCircle, + AddAlert, + AddBusiness, + AddChart, + AddExpense, + AddExpenseTwo, + AddIcCall, + AddLocation, + AddLocationAlt, + AddModerator, + AddRoad, + AddShoppingCart, + AddTask, + AddToDrive, + AdminPanelSettings, + Agriculture, + Alarm, + AlarmAdd, + AlarmOff, + AlarmOn, + AllInbox, + AllOut, + AlternateEmail, + AltRoute, + Analytics, + Anchor, + Android, + Announcement, + Api, + AppBlocking, + AppRegistration, + Approval, + Apps, + AppSettingsAlt, + Architecture, + ArrowBack, + ArrowBackIos, + ArrowCircleDown, + ArrowCircleUp, + ArrowDownward, + ArrowDropDown, + ArrowDropDownCircle, + ArrowDropUp, + ArrowForward, + ArrowForwardIos, + ArrowForwardIosAlt, + ArrowLeft, + ArrowRight, + ArrowRightAlt, + ArrowUpward, + Article, + AspectRatio, + Assessment, + Assignment, + AssignmentInd, + AssignmentLate, + AssignmentReturn, + AssignmentReturned, + AssignmentTurnedIn, + AssistantDirection, + AssistantNavigation, + Atm, + AttachEmail, + Attachment, + Attractions, + AutoDelete, + AutoRenew, + Backup, + BackupTable, + Badge, + BakeryDining, + BatchPrediction, + BeenHere, + BikeScooter, + Book, + Bookmark, + BookmarkBorder, + Bookmarks, + BookOnline, + BreakfastDining, + BrunchDining, + BugReport, + Build, + BuildCircle, + BusAlert, + Business, + Cached, + Cake, + CalendarToday, + CalendarViewDay, + Call, + CallEnd, + CallMade, + CallMerge, + CallMissed, + CallMissedOutgoing, + CallReceived, + CallSplit, + CameraEnhance, + Campaign, + Cancel, + CancelPresentation, + CancelScheduleSend, + CardGiftcard, + CardMembership, + CardTravel, + CarRental, + CarRepair, + Category, + Celebration, + CellWifi, + ChangeHistory, + Chat, + ChatBubble, + ChatBubbleOutline, + Check, + CheckCircle, + CheckCircleOutline, + ChevronLeft, + ChevronRight, + ChromeReaderMode, + CircleNotifications, + Class, + CleanHands, + CleaningServices, + ClearAll, + Clock, + Close, + CloseFullscreen, + Cloud, + CloudCircle, + CloudDone, + CloudDownload, + CloudOff, + CloudQueue, + CloudUpload, + Code, + Comment, + CommentBank, + Commute, + CompareArrows, + CompassCalibration, + Compress, + ConnectWithoutContact, + Construction, + Contactless, + ContactMail, + ContactPage, + ContactPhone, + Contacts, + ContactSupport, + Copyright, + Coronavirus, + CreateNewFolder, + CreditCard, + Cut, + Dangerous, + Dashboard, + DashboardCustomize, + DateRange, + Deck, + Delete, + DeleteForever, + DeleteOutline, + DeliveryDining, + DepartureBoard, + Description, + DesignServices, + DesktopAccessDisabled, + DialerSip, + Dialpad, + DinnerDining, + Directions, + DirectionsBike, + DirectionsBoat, + DirectionsBus, + DirectionsCar, + DirectionsRailway, + DirectionsRun, + DirectionsSubway, + DirectionsTransit, + DirectionsWalk, + DisabledByDefault, + Dns, + Domain, + DomainDisabled, + DomainVerification, + Done, + DoneAll, + DoneOutline, + DonutLarge, + DonutSmall, + DoubleArrow, + DragIndicator, + DriveFileMove, + DriveFileMoveOutline, + DriveFileRenameOutline, + DriveFolderUpload, + DryCleaning, + DSOTruck, + Duo, + DynamicForm, + East, + Eco, + Edit, + EditAttributes, + EditLocation, + EditOff, + EditRoad, + Eject, + Elderly, + ElectricalServices, + ElectricBike, + ElectricCar, + ElectricMoped, + ElectricRickshaw, + ElectricScooter, + Email, + EmojiEmotions, + EmojiEvents, + EmojiFlags, + EmojiFoodBeverage, + EmojiNature, + EmojiObjects, + EmojiPeople, + EmojiSymbols, + EmojiTransportation, + Engineering, + Error, + ErrorOutline, + EuroSymbol, + Event, + EventSeat, + EvStation, + ExitToApp, + Expand, + ExpandLess, + ExpandMore, + Explore, + ExploreOff, + Extension, + Face, + Facebook, + FactCheck, + Fastfood, + Favorite, + FavoriteBorder, + Feedback, + Festival, + File, + FileDownload, + FileDownloadDone, + FilePresent, + FileUpload, + FilterAlt, + FilterListAlt, + FindInPage, + FindReplace, + Fingerprint, + Fireplace, + FirstPageAlt, + FirstPage, + FitScreen, + Flaky, + Flight, + FlightLand, + FlightTakeoff, + FlipToBack, + FlipToFront, + Folder, + FolderOpen, + FolderShared, + FollowTheSigns, + Forum, + ForwardToInbox, + Fullscreen, + FullscreenExit, + Gavel, + GetApp, + Gif, + Grade, + Grading, + GridView, + Group, + GroupAdd, + Groups, + GroupWork, + GTranslate, + Hail, + Handyman, + Hardware, + Help, + HelpCenter, + HelpOutline, + HighlightAlt, + HighlightOff, + History, + HistoryEdu, + HistoryToggleOff, + Home, + HomeFilled, + HomeRepairService, + HomeWork, + HorizontalSplit, + Hotel, + HourglassBottom, + HourglassDisabled, + HourglassEmpty, + HourglassFull, + HourglassTop, + Http, + Https, + Hvac, + Icecream, + IconSwerage, + IconSwerageAlt, + ImportantDevices, + ImportContacts, + ImportExport, + Info, + InfoOutline, + Input, + IntegrationInstructions, + InvertColors, + InvertColorsOff, + IosShare, + KingBed, + Label, + LabelImportant, + LabelImportantOutline, + LabelOff, + LabelOutline, + TranslateLanguage, + Language, + LastPageAlt, + LastPage, + Launch, + Layers, + LayersClear, + Leaderboard, + LegendToggle, + Lightbulb, + LightbulbOutline, + LineStyle, + LineWeight, + Liquor, + List, + ListAlt, + LiveHelp, + LocalActivity, + LocalAirport, + LocalAtm, + LocalBar, + LocalCafe, + LocalCarWash, + LocalConvenienceStore, + LocalDining, + LocalDrink, + LocalFireDepartment, + LocalFlorist, + LocalGasStation, + LocalGroceryStore, + LocalHospital, + LocalHotel, + LocalLaundryService, + LocalLibrary, + LocalMall, + LocalMovies, + LocalOffer, + LocalParking, + LocalPharmacy, + LocalPhone, + LocalPizza, + LocalPlay, + LocalPolice, + LocalPostOffice, + LocalPrintshop, + LocalSee, + LocalShipping, + LocalTaxi, + LocationCity, + LocationOff, + LocationOn, + LocationPin, + Lock, + LockClock, + LockOpen, + LockOutline, + Login, + Logout, + Loyalty, + Luggage, + LunchDining, + MailOutline, + Map, + MapsUgc, + MarkAsUnread, + MarkChatRead, + MarkChatUnread, + MarkEmailRead, + MarkEmailUnread, + MarkunreadMailbox, + Masks, + Maximize, + Mediation, + MedicalServices, + Menu, + MenuBook, + MenuOpen, + Message, + MilitaryTech, + Minimize, + MiscellaneousServices, + MobileScreenShare, + ModelTraining, + Money, + Mood, + MoodBad, + Moped, + MoreHoriz, + MoreTime, + MoreVert, + MultipleStop, + Museum, + MyLocation, + Nat, + Navigation, + NearMe, + NearMeDisabled, + NextPlan, + Nightlife, + NightlightRound, + NightsStay, + NoLuggage, + NoMeals, + NoMealsOuline, + North, + NorthEast, + NorthWest, + NoSim, + NotAccessible, + NoteAdd, + NotificationImportant, + Notifications, + NotificationsActive, + NotificationsNone, + NotificationsOff, + NotificationsPaused, + NotListedLocation, + NoTransfer, + NotStarted, + TorchNoun, + OfflineBolt, + OfflinePin, + OfflineShare, + OnlinePrediction, + Opacity, + OpenInBrowser, + OpenInFull, + OpenInNew, + OpenWith, + Outbond, + Outbox, + OutdoorGrill, + OutgoingMail, + Outlet, + Pages, + Pageview, + PanTool, + Park, + PartyMode, + PausePresentation, + Payment, + Payments, + PedalBike, + Pending, + PendingActions, + People, + PeopleAlt, + PeopleOutline, + PermCameraMic, + PermContactCalendar, + PermDataSetting, + PermDeviceInformation, + PermIdentity, + PermMedia, + PermPhoneMsg, + PermScanWifi, + Person, + PersonAdd, + PersonAddAlt, + PersonAddSecondary, + PersonAddDisabled, + PersonOutline, + PersonPin, + PersonPinCircle, + PersonRemove, + PersonRemoveAlt, + PersonSearch, + PestControl, + PestControlRodent, + Pets, + Phone, + PhoneDisabled, + PhoneEnabled, + PhonelinkErase, + PhonelinkLock, + PhonelinkRing, + PhonelinkSetup, + PictureInPicture, + PictureInPictureAlt, + PinDrop, + PivotTableChart, + Place, + Plagiarism, + PlayForWork, + Plumbing, + PlusOne, + Poll, + Polymer, + Population, + PortableWifiOff, + PowerSettingsNew, + PregnantWoman, + PresentToAll, + Preview, + Print, + PrintDisabled, + PrivacyTip, + Psychology, + Public, + PublicOff, + PublishedWithChanges, + QrCode, + QrCodeScanner, + QueryBuilder, + QuestionAnswer, + Quickreply, + RailwayAlert, + RamenDining, + RateReview, + ReadMore, + Receipt, + Recommend, + RecordVoiceOver, + Redeem, + ReduceCapacity, + Refresh, + RemoveDone, + RemoveModerator, + RemoveShoppingCart, + Reorder, + ReportProblem, + RequestPage, + RequestQuote, + Restaurant, + RestaurantMenu, + Restore, + RestoreFromTrash, + RestorePage, + RingVolume, + Room, + RoundedCorner, + Rowing, + RssFeed, + Rtt, + Rule, + RuleFolder, + RunCircle, + Sanitizer, + Satellite, + SavedSearch, + Schedule, + ScheduleSend, + School, + Science, + ScreenShare, + Search, + SearchOff, + Segment, + SelfImprovement, + SendAndArchive, + SentimentDissatisfied, + SentimentNeutral, + SentimentSatisfied, + SentimentSatisfiedAlt, + SentimentVeryDissatisfied, + SentimentVerySatisfied, + SetMeal, + Settings, + SettingsApplications, + SettingsBackupRestore, + SettingsBluetooth, + SettingsBrightness, + SettingsCell, + SettingsEthernet, + SettingsInputAntenna, + SettingsInputComponent, + SettingsInputComposite, + SettingsInputHdmi, + SettingsInputVideo, + SettingsOverscan, + SettingsPhone, + SettingsPower, + SettingsRemote, + SettingsVoice, + Share, + Shop, + ShoppingBag, + ShoppingBasket, + ShoppingCart, + ShopAlt, + Sick, + SingleBed, + SmartButton, + SnippetFolder, + Source, + South, + SouthEast, + SouthWest, + SpeakerNotes, + SpeakerNotesOff, + SpeakerPhone, + SpellCheck, + Sports, + SportsBaseball, + SportsBasketball, + SportsCricket, + SportsEsports, + SportsFootball, + SportsGolf, + SportsHandball, + SportsHockey, + SportsKabaddi, + SportsMma, + SportsMotorsports, + SportsRugby, + SportsSoccer, + SportsTennis, + SportsVolleyball, + StarRate, + Stars, + StayCurrentLandscape, + StayCurrentPortrait, + StayPrimaryLandscape, + StayPrimaryPortrait, + StickyNotesSecondary, + ScreenShareStop, + Store, + StoreMallDirectory, + StreetView, + SubdirectoryArrowLeft, + SubdirectoryArrowRight, + Subject, + SubtitlesOff, + Subway, + SupervisedUserCircle, + SupervisorAccount, + Support, + SwapCalls, + SwapHorizontal, + SwapHorizontalCircle, + SwapVertical, + SwapVerticalCircle, + Swipe, + SwitchAccount, + SwitchLeft, + SwitchRight, + SyncAlt, + SystemUpdateAlt, + Tab, + TableView, + TabUnselected, + TakeOutDining, + TaxiAlert, + Terrain, + TextRotateUp, + TextRotateVertical, + TextRotationAngleDown, + TextRotationAngleUp, + TextRotationDown, + TextRotationNone, + SMSText, + TextSnippet, + TheaterComedy, + Theaters, + ThumbDown, + ThumbDownAlt, + ThumbDownOffAlt, + ThumbsUpDown, + ThumbUp, + ThumbUpAlt, + ThumbUpOffAlt, + Timeline, + Toc, + Today, + Toll, + Topic, + Torch, + TouchApp, + Tour, + TrackChanges, + Traffic, + Train, + Tram, + TransferWithinStation, + TransitEnterExit, + Translate, + TrendingDown, + TrendingFlat, + TrendingUp, + TripOrigin, + TurnedIn, + TurnedInNot, + TwoWheeler, + UnfoldLess, + UnfoldMore, + Unpublished, + Unsubscribe, + Update, + UpdateExpense, + UpdateExpenseSecondary, + Upgrade, + UploadFile, + Verified, + VerifiedUser, + VerticalSplit, + ViewAgenda, + ViewArray, + ViewCarousel, + ViewColumn, + ViewDay, + ViewHeadline, + ViewInAr, + ViewList, + ViewModule, + ViewQuilt, + ViewSidebar, + ViewStream, + ViewWeek, + Visibility, + VisibilityOff, + Voicemail, + VoiceOverOff, + VolunteerActivism, + VpnKey, + Warning, + WatchLater, + WaterfallChart, + West, + Whatsapp, + Whatshot, + WifiCalling, + WifiProtectedSetup, + WineBar, + Work, + WorkOff, + WorkOutline, + WorkspacesFilled, + WorkspacesOutline, + WrongLocation, + Wysiwyg, + YoutubeSearchedFor, + ZoomIn, + ZoomOut, + ZoomOutMap, + Success, + TickMark, + NoResultsFoundIcon, + StarFilled, + StarEmpty, + } from "@egovernments/digit-ui-svg-components"; + import PropTypes from "prop-types"; + + export const SVG = { + NoResultsFoundIcon, + Success, + TickMark, + Rotation3D, + SixFtApart, + Rotate360, + Accessibility, + AccessibilityNew, + Accessible, + AccessibleForward, + AccountBalance, + AccountBalanceWallet, + AccountBox, + AccountCircle, + AddAlert, + AddBusiness, + AddChart, + AddExpense, + AddExpenseTwo, + AddIcCall, + AddLocation, + AddLocationAlt, + AddModerator, + AddRoad, + AddShoppingCart, + AddTask, + AddToDrive, + AdminPanelSettings, + Agriculture, + Alarm, + AlarmAdd, + AlarmOff, + AlarmOn, + AllInbox, + AllOut, + AlternateEmail, + AltRoute, + Analytics, + Anchor, + Android, + Announcement, + Api, + AppBlocking, + AppRegistration, + Approval, + Apps, + AppSettingsAlt, + Architecture, + ArrowBack, + ArrowBackIos, + ArrowCircleDown, + ArrowCircleUp, + ArrowDownward, + ArrowDropDown, + ArrowDropDownCircle, + ArrowDropUp, + ArrowForward, + ArrowForwardIos, + ArrowForwardIosAlt, + ArrowLeft, + ArrowRight, + ArrowRightAlt, + ArrowUpward, + Article, + AspectRatio, + Assessment, + Assignment, + AssignmentInd, + AssignmentLate, + AssignmentReturn, + AssignmentReturned, + AssignmentTurnedIn, + AssistantDirection, + AssistantNavigation, + Atm, + AttachEmail, + Attachment, + Attractions, + AutoDelete, + AutoRenew, + Backup, + BackupTable, + Badge, + BakeryDining, + BatchPrediction, + BeenHere, + BikeScooter, + Book, + Bookmark, + BookmarkBorder, + Bookmarks, + BookOnline, + BreakfastDining, + BrunchDining, + BugReport, + Build, + BuildCircle, + BusAlert, + Business, + Cached, + Cake, + CalendarToday, + CalendarViewDay, + Call, + CallEnd, + CallMade, + CallMerge, + CallMissed, + CallMissedOutgoing, + CallReceived, + CallSplit, + CameraEnhance, + Campaign, + Cancel, + CancelPresentation, + CancelScheduleSend, + CardGiftcard, + CardMembership, + CardTravel, + CarRental, + CarRepair, + Category, + Celebration, + CellWifi, + ChangeHistory, + Chat, + ChatBubble, + ChatBubbleOutline, + Check, + CheckCircle, + CheckCircleOutline, + ChevronLeft, + ChevronRight, + ChromeReaderMode, + CircleNotifications, + Class, + CleanHands, + CleaningServices, + ClearAll, + Clock, + Close, + CloseFullscreen, + Cloud, + CloudCircle, + CloudDone, + CloudDownload, + CloudOff, + CloudQueue, + CloudUpload, + Code, + Comment, + CommentBank, + Commute, + CompareArrows, + CompassCalibration, + Compress, + ConnectWithoutContact, + Construction, + Contactless, + ContactMail, + ContactPage, + ContactPhone, + Contacts, + ContactSupport, + Copyright, + Coronavirus, + CreateNewFolder, + CreditCard, + Cut, + Dangerous, + Dashboard, + DashboardCustomize, + DateRange, + Deck, + Delete, + DeleteForever, + DeleteOutline, + DeliveryDining, + DepartureBoard, + Description, + DesignServices, + DesktopAccessDisabled, + DialerSip, + Dialpad, + DinnerDining, + Directions, + DirectionsBike, + DirectionsBoat, + DirectionsBus, + DirectionsCar, + DirectionsRailway, + DirectionsRun, + DirectionsSubway, + DirectionsTransit, + DirectionsWalk, + DisabledByDefault, + Dns, + Domain, + DomainDisabled, + DomainVerification, + Done, + DoneAll, + DoneOutline, + DonutLarge, + DonutSmall, + DoubleArrow, + DragIndicator, + DriveFileMove, + DriveFileMoveOutline, + DriveFileRenameOutline, + DriveFolderUpload, + DryCleaning, + DSOTruck, + Duo, + DynamicForm, + East, + Eco, + Edit, + EditAttributes, + EditLocation, + EditOff, + EditRoad, + Eject, + Elderly, + ElectricalServices, + ElectricBike, + ElectricCar, + ElectricMoped, + ElectricRickshaw, + ElectricScooter, + Email, + EmojiEmotions, + EmojiEvents, + EmojiFlags, + EmojiFoodBeverage, + EmojiNature, + EmojiObjects, + EmojiPeople, + EmojiSymbols, + EmojiTransportation, + Engineering, + Error, + ErrorOutline, + EuroSymbol, + Event, + EventSeat, + EvStation, + ExitToApp, + Expand, + ExpandLess, + ExpandMore, + Explore, + ExploreOff, + Extension, + Face, + Facebook, + FactCheck, + Fastfood, + Favorite, + FavoriteBorder, + Feedback, + Festival, + File, + FileDownload, + FileDownloadDone, + FilePresent, + FileUpload, + FilterAlt, + FilterListAlt, + FindInPage, + FindReplace, + Fingerprint, + Fireplace, + FirstPageAlt, + FirstPage, + FitScreen, + Flaky, + Flight, + FlightLand, + FlightTakeoff, + FlipToBack, + FlipToFront, + Folder, + FolderOpen, + FolderShared, + FollowTheSigns, + Forum, + ForwardToInbox, + Fullscreen, + FullscreenExit, + Gavel, + GetApp, + Gif, + Grade, + Grading, + GridView, + Group, + GroupAdd, + Groups, + GroupWork, + GTranslate, + Hail, + Handyman, + Hardware, + Help, + HelpCenter, + HelpOutline, + HighlightAlt, + HighlightOff, + History, + HistoryEdu, + HistoryToggleOff, + Home, + HomeFilled, + HomeRepairService, + HomeWork, + HorizontalSplit, + Hotel, + HourglassBottom, + HourglassDisabled, + HourglassEmpty, + HourglassFull, + HourglassTop, + Http, + Https, + Hvac, + Icecream, + IconSwerage, + IconSwerageAlt, + ImportantDevices, + ImportContacts, + ImportExport, + Info, + InfoOutline, + Input, + IntegrationInstructions, + InvertColors, + InvertColorsOff, + IosShare, + KingBed, + Label, + LabelImportant, + LabelImportantOutline, + LabelOff, + LabelOutline, + TranslateLanguage, + Language, + LastPageAlt, + LastPage, + Launch, + Layers, + LayersClear, + Leaderboard, + LegendToggle, + Lightbulb, + LightbulbOutline, + LineStyle, + LineWeight, + Liquor, + List, + ListAlt, + LiveHelp, + LocalActivity, + LocalAirport, + LocalAtm, + LocalBar, + LocalCafe, + LocalCarWash, + LocalConvenienceStore, + LocalDining, + LocalDrink, + LocalFireDepartment, + LocalFlorist, + LocalGasStation, + LocalGroceryStore, + LocalHospital, + LocalHotel, + LocalLaundryService, + LocalLibrary, + LocalMall, + LocalMovies, + LocalOffer, + LocalParking, + LocalPharmacy, + LocalPhone, + LocalPizza, + LocalPlay, + LocalPolice, + LocalPostOffice, + LocalPrintshop, + LocalSee, + LocalShipping, + LocalTaxi, + LocationCity, + LocationOff, + LocationOn, + LocationPin, + Lock, + LockClock, + LockOpen, + LockOutline, + Login, + Logout, + Loyalty, + Luggage, + LunchDining, + MailOutline, + Map, + MapsUgc, + MarkAsUnread, + MarkChatRead, + MarkChatUnread, + MarkEmailRead, + MarkEmailUnread, + MarkunreadMailbox, + Masks, + Maximize, + Mediation, + MedicalServices, + Menu, + MenuBook, + MenuOpen, + Message, + MilitaryTech, + Minimize, + MiscellaneousServices, + MobileScreenShare, + ModelTraining, + Money, + Mood, + MoodBad, + Moped, + MoreHoriz, + MoreTime, + MoreVert, + MultipleStop, + Museum, + MyLocation, + Nat, + Navigation, + NearMe, + NearMeDisabled, + NextPlan, + Nightlife, + NightlightRound, + NightsStay, + NoLuggage, + NoMeals, + NoMealsOuline, + North, + NorthEast, + NorthWest, + NoSim, + NotAccessible, + NoteAdd, + NotificationImportant, + Notifications, + NotificationsActive, + NotificationsNone, + NotificationsOff, + NotificationsPaused, + NotListedLocation, + NoTransfer, + NotStarted, + TorchNoun, + OfflineBolt, + OfflinePin, + OfflineShare, + OnlinePrediction, + Opacity, + OpenInBrowser, + OpenInFull, + OpenInNew, + OpenWith, + Outbond, + Outbox, + OutdoorGrill, + OutgoingMail, + Outlet, + Pages, + Pageview, + PanTool, + Park, + PartyMode, + PausePresentation, + Payment, + Payments, + PedalBike, + Pending, + PendingActions, + People, + PeopleAlt, + PeopleOutline, + PermCameraMic, + PermContactCalendar, + PermDataSetting, + PermDeviceInformation, + PermIdentity, + PermMedia, + PermPhoneMsg, + PermScanWifi, + Person, + PersonAdd, + PersonAddAlt, + PersonAddSecondary, + PersonAddDisabled, + PersonOutline, + PersonPin, + PersonPinCircle, + PersonRemove, + PersonRemoveAlt, + PersonSearch, + PestControl, + PestControlRodent, + Pets, + Phone, + PhoneDisabled, + PhoneEnabled, + PhonelinkErase, + PhonelinkLock, + PhonelinkRing, + PhonelinkSetup, + PictureInPicture, + PictureInPictureAlt, + PinDrop, + PivotTableChart, + Place, + Plagiarism, + PlayForWork, + Plumbing, + PlusOne, + Poll, + Polymer, + Population, + PortableWifiOff, + PowerSettingsNew, + PregnantWoman, + PresentToAll, + Preview, + Print, + PrintDisabled, + PrivacyTip, + Psychology, + Public, + PublicOff, + PublishedWithChanges, + QrCode, + QrCodeScanner, + QueryBuilder, + QuestionAnswer, + Quickreply, + RailwayAlert, + RamenDining, + RateReview, + ReadMore, + Receipt, + Recommend, + RecordVoiceOver, + Redeem, + ReduceCapacity, + Refresh, + RemoveDone, + RemoveModerator, + RemoveShoppingCart, + Reorder, + ReportProblem, + RequestPage, + RequestQuote, + Restaurant, + RestaurantMenu, + Restore, + RestoreFromTrash, + RestorePage, + RingVolume, + Room, + RoundedCorner, + Rowing, + RssFeed, + Rtt, + Rule, + RuleFolder, + RunCircle, + Sanitizer, + Satellite, + SavedSearch, + Schedule, + ScheduleSend, + School, + Science, + ScreenShare, + Search, + SearchOff, + Segment, + SelfImprovement, + SendAndArchive, + SentimentDissatisfied, + SentimentNeutral, + SentimentSatisfied, + SentimentSatisfiedAlt, + SentimentVeryDissatisfied, + SentimentVerySatisfied, + SetMeal, + Settings, + SettingsApplications, + SettingsBackupRestore, + SettingsBluetooth, + SettingsBrightness, + SettingsCell, + SettingsEthernet, + SettingsInputAntenna, + SettingsInputComponent, + SettingsInputComposite, + SettingsInputHdmi, + SettingsInputVideo, + SettingsOverscan, + SettingsPhone, + SettingsPower, + SettingsRemote, + SettingsVoice, + Share, + Shop, + ShoppingBag, + ShoppingBasket, + ShoppingCart, + ShopAlt, + Sick, + SingleBed, + SmartButton, + SnippetFolder, + Source, + South, + SouthEast, + SouthWest, + SpeakerNotes, + SpeakerNotesOff, + SpeakerPhone, + SpellCheck, + Sports, + SportsBaseball, + SportsBasketball, + SportsCricket, + SportsEsports, + SportsFootball, + SportsGolf, + SportsHandball, + SportsHockey, + SportsKabaddi, + SportsMma, + SportsMotorsports, + SportsRugby, + SportsSoccer, + SportsTennis, + SportsVolleyball, + StarRate, + Stars, + StayCurrentLandscape, + StayCurrentPortrait, + StayPrimaryLandscape, + StayPrimaryPortrait, + StickyNotesSecondary, + ScreenShareStop, + Store, + StoreMallDirectory, + StreetView, + SubdirectoryArrowLeft, + SubdirectoryArrowRight, + Subject, + SubtitlesOff, + Subway, + SupervisedUserCircle, + SupervisorAccount, + Support, + SwapCalls, + SwapHorizontal, + SwapHorizontalCircle, + SwapVertical, + SwapVerticalCircle, + Swipe, + SwitchAccount, + SwitchLeft, + SwitchRight, + SyncAlt, + SystemUpdateAlt, + Tab, + TableView, + TabUnselected, + TakeOutDining, + TaxiAlert, + Terrain, + TextRotateUp, + TextRotateVertical, + TextRotationAngleDown, + TextRotationAngleUp, + TextRotationDown, + TextRotationNone, + SMSText, + TextSnippet, + TheaterComedy, + Theaters, + ThumbDown, + ThumbDownAlt, + ThumbDownOffAlt, + ThumbsUpDown, + ThumbUp, + ThumbUpAlt, + ThumbUpOffAlt, + Timeline, + Toc, + Today, + Toll, + Topic, + Torch, + TouchApp, + Tour, + TrackChanges, + Traffic, + Train, + Tram, + TransferWithinStation, + TransitEnterExit, + Translate, + TrendingDown, + TrendingFlat, + TrendingUp, + TripOrigin, + TurnedIn, + TurnedInNot, + TwoWheeler, + UnfoldLess, + UnfoldMore, + Unpublished, + Unsubscribe, + Update, + UpdateExpense, + UpdateExpenseSecondary, + Upgrade, + UploadFile, + Verified, + VerifiedUser, + VerticalSplit, + ViewAgenda, + ViewArray, + ViewCarousel, + ViewColumn, + ViewDay, + ViewHeadline, + ViewInAr, + ViewList, + ViewModule, + ViewQuilt, + ViewSidebar, + ViewStream, + ViewWeek, + Visibility, + VisibilityOff, + Voicemail, + VoiceOverOff, + VolunteerActivism, + VpnKey, + Warning, + WatchLater, + WaterfallChart, + West, + Whatsapp, + Whatshot, + WifiCalling, + WifiProtectedSetup, + WineBar, + Work, + WorkOff, + WorkOutline, + WorkspacesFilled, + WorkspacesOutline, + WrongLocation, + Wysiwyg, + YoutubeSearchedFor, + ZoomIn, + ZoomOut, + ZoomOutMap, + StarFilled, + StarEmpty, + }; + + SVG.propTypes = { + /** custom width of the svg icon */ + width: PropTypes.string, + /** custom height of the svg icon */ + height: PropTypes.string, + /** custom colour of the svg icon */ + fill: PropTypes.string, + /** custom class of the svg icon */ + className: PropTypes.string, + /** custom style of the svg icon */ + style: PropTypes.object, + /** Click Event handler when icon is clicked */ + onClick: PropTypes.func, + }; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StringManipulator.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StringManipulator.js new file mode 100644 index 000000000..bccb7463b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StringManipulator.js @@ -0,0 +1,54 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const StringManipulator = (functionName, string, props) => { + const manipulateString = () => { + if (!string) return null; + + switch (functionName) { + case "toSentenceCase": + return toSentenceCase(string); + case "capitalizeFirstLetter": + return capitalizeFirstLetter(string); + case "toTitleCase": + return toTitleCase(string); + case "truncateString": + return truncateString(string, props?.maxLength); + default: + return string; + } + }; + + const toSentenceCase = (str) => { + return str.toLowerCase().replace(/(^\s*\w|[\.\!\?]\s*\w)/g, (c) => { + return c.toUpperCase(); + }); + }; + + const capitalizeFirstLetter = (str) => { + return str.charAt(0).toUpperCase() + str.slice(1); + }; + + const toTitleCase = (str) => { + return str.toLowerCase().replace(/\b\w/g, (c) => { + return c.toUpperCase(); + }); + }; + + const truncateString = (str, maxLength) => { + if (str.length > maxLength) { + return str.slice(0, maxLength) + "..."; + } + return str; + }; + + return manipulateString(); +}; + +StringManipulator.propTypes = { + functionName: PropTypes.func, + string: PropTypes.string, + props: PropTypes.object, +}; + +export default StringManipulator; \ No newline at end of file From 8b843034717f4bba6ee07b5623482be7452c0e0a Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:40:21 +0530 Subject: [PATCH 18/41] PFM-5984 Addition of password icon --- .../react-components/src/atoms/TextInput.js | 518 +++++++++++++++--- 1 file changed, 435 insertions(+), 83 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js index 2ac692c75..f3d099e98 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js @@ -1,10 +1,13 @@ -import React, { useEffect, useState } from "react"; +import React, { forwardRef, useEffect, useState } from "react"; import PropTypes from "prop-types"; -import { LocateIcon } from "./svgindex"; +import { SVG } from "./SVG"; +import StringManipulator from "./StringManipulator"; const TextInput = (props) => { - const user_type = Digit.SessionStorage.get("userType"); - const [date, setDate] = useState(props?.type==="date"&&props?.value); + const user_type = window?.Digit?.SessionStorage.get("userType"); + const [date, setDate] = useState(props?.type === "date" && props?.value); + const [visibility, setVisibility] = useState(false); + const [inputType, setInputType] = useState(props?.type || "text"); const data = props?.watch ? { fromDate: props?.watch("fromDate"), @@ -13,93 +16,409 @@ const TextInput = (props) => { : {}; const handleDate = (event) => { - const { value } = event.target; - setDate(getDDMMYYYY(value)); + const { value } = event?.target; + setDate(value); + props?.onChange(value); + }; + const incrementCount = () => { + const newValue = + Number(props.value) + (Number(props?.step) ? Number(props?.step) : 1); + props.onChange(newValue); + }; + + const decrementCount = () => { + const newValue = Math.max( + Number(props.value) - (Number(props?.step) ? Number(props?.step) : 1), + 0 + ); + props.onChange(newValue); + }; + + const renderPrefix = () => { + const prefixValue = props?.populators?.prefix || ""; + if (props?.type === "numeric") { + return ( + + ); + } + if (prefixValue) { + return ( + + ); + } + return null; + }; + + const renderSuffix = () => { + const suffixValue = props?.populators?.suffix || ""; + if (props?.type === "numeric") { + return ( + + ); + } + if ( + props?.type === "text" && + !props?.populators?.customIcon && + suffixValue + ) { + return ( + + ); + } + return null; + }; + + const handleVisibility = () => { + setVisibility(!visibility); + const newType = !visibility ? "text" : "password"; + setInputType(newType); + props.onChange(props?.value); + }; + + const handleLocationClick = () => { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition( + (position) => { + const { latitude, longitude } = position.coords; + props.onChange(`${latitude}, ${longitude}`); + }, + (error) => { + console.error("Error getting location:", error); + } + ); + } else { + console.error("Geolocation is not supported"); + } + }; + + const renderIcon = () => { + const reqIcon = props?.type; + const iconFill = props?.disabled + ? "#D6D5D4" + : props?.nonEditable + ? "#b1b4b6" + : "#505A5F"; + if (reqIcon) { + if (reqIcon === "geolocation") { + return ( + + ); + } else if (reqIcon === "password" && inputType === "text" && visibility) { + return ( + + ); + } else if (reqIcon === "password") { + return ( + + ); + } else if (reqIcon === "search") { + return ( + + ); + } else { + try { + const components = require("@egovernments/digit-ui-svg-components"); + const DynamicIcon = + props?.type === "text" && + components?.[props?.populators?.customIcon]; + if (DynamicIcon) { + const svgElement = DynamicIcon({ + width: "1.5rem", + height: "1.5rem", + fill: iconFill, + className: `digit-text-input-customIcon ${ + props.disabled ? "disabled" : "" + } ${props.nonEditable ? "nonEditable" : ""}`, + }); + return svgElement; + } else { + console.log("Icon not found"); + return null; + } + } catch (error) { + console.error("Icon not found"); + return null; + } + } + } + return null; }; + const icon = renderIcon(); + + const openPicker = () => { + document.addEventListener("DOMContentLoaded", function () { + const dateInput = document.querySelector('input[type="date"]'); + const timeInput = document.querySelector('input[type="time"]'); + + const handleClick = (event) => { + try { + event.target.showPicker(); + } catch (error) { + window.alert(error); + } + }; + + if (dateInput) { + dateInput.addEventListener("click", handleClick); + } + + if (timeInput) { + timeInput.addEventListener("click", handleClick); + } + }); + }; + + const inputClassNameForMandatory = `${ + user_type ? "digit-employee-card-input-error" : "digit-card-input-error" + } ${props.disabled ? "disabled" : ""} ${props.customClass || ""} ${ + props.nonEditable ? "noneditable" : "" + } ${props.type === "numeric" ? "numeric" : ""}`; + + const inputClassName = `${ + user_type ? "digit-employee-card-input" : "digit-citizen-card-input" + } ${props.disabled ? "disabled" : ""} focus-visible ${ + props.errorStyle ? "digit-employee-card-input-error" : "" + } ${props.nonEditable ? "noneditable" : ""} ${ + props.type === "numeric" ? "numeric" : "" + }`; + + const defaultType = + props.type === "password" && inputType === "text" + ? "passwordToText" + : props.type; + + const inputContainerClass = `input-container ${ + defaultType ? defaultType : "" + } ${props.populators?.customIcon ? "withIcon" : ""}`; + return ( -
- {props.isMandatory ? ( - { - if(props?.type === "number" && props?.maxlength) { - if(event.target.value.length > props?.maxlength) { - event.target.value = event.target.value.slice(0,-1); +
+ {props.required ? ( +
+ {renderPrefix()} + { + if (props?.type === "number" && props?.maxlength) { + if (event.target.value.length > props?.maxlength) { + event.target.value = event.target.value.slice(0, -1); + } + } + if (props?.type === "numeric") { + event.target.value = event.target.value.replace( + /[^0-9]/g, + "" + ); + } + if (props?.onChange) { + props?.onChange(event); } + if (props.type === "date") { + handleDate(event); + } + }} + ref={props.inputRef} + value={props?.value} + style={{ ...props.style }} + defaultValue={props.defaultValue} + minLength={props.minlength} + maxLength={props.maxlength} + max={props.max} + pattern={ + props?.validation && props.ValidationRequired + ? props?.validation?.pattern + : props.pattern } - if (props?.onChange) { - props?.onChange(event); + min={props.min} + readOnly={props.nonEditable} + title={ + props?.validation && props.ValidationRequired + ? props?.validation?.title + : props.title } - if (props.type === "date") { - handleDate(event); + step={props.step} + autoFocus={props.autoFocus} + onBlur={props.onBlur} + autoComplete="off" + disabled={props.disabled} + onFocus={props?.onFocus} + nonEditable={props.nonEditable} + config={props.config} + populators={props.populators} + onclick={ + props.type === "date" || props.type === "time" + ? openPicker() + : null } - }} - ref={props.inputRef} - value={props.value} - style={{ ...props.style }} - defaultValue={props.defaultValue} - minLength={props.minlength} - maxLength={props.maxlength} - max={props.max} - pattern={props?.validation && props.ValidationRequired ? props?.validation?.pattern : props.pattern} - min={props.min} - readOnly={props.disable} - title={props?.validation && props.ValidationRequired ? props?.validation?.title :props.title} - step={props.step} - autoFocus={props.autoFocus} - onBlur={props.onBlur} - autoComplete="off" - disabled={props.disabled} - /> + /> + {renderSuffix()} + {props.signature && props.signatureImg} + {icon && ( + + {icon} + + )} +
) : ( - { - if(props?.type === "number" && props?.maxlength) { - if(event.target.value.length > props?.maxlength) { - event.target.value = event.target.value.slice(0,-1); +
+ {renderPrefix()} + { + if (props?.type === "number" && props?.maxlength) { + if (event.target.value.length > props?.maxlength) { + event.target.value = event.target.value.slice(0, -1); + } } + if (props?.type === "numeric") { + event.target.value = event.target.value.replace( + /[^0-9]/g, + "" + ); + } + if (props?.onChange) { + props?.onChange(event); + } + if (props.type === "date") { + handleDate(event); + } + }} + ref={props.inputRef} + value={props?.value} + style={{ ...props.style }} + defaultValue={props.defaultValue} + minLength={props.minlength} + maxLength={props.maxlength} + max={props.max} + required={ + props?.validation && props.ValidationRequired + ? props?.validation?.isRequired + : props.isRequired || + (props.type === "date" && + (props.name === "fromDate" ? data.toDate : data.fromDate)) } - if (props?.onChange) { - props?.onChange(event); + pattern={ + props?.validation && props.ValidationRequired + ? props?.validation?.pattern + : props.pattern } - if (props.type === "date") { - handleDate(event); + min={props.min} + readOnly={props.nonEditable} + title={ + props?.validation && props.ValidationRequired + ? props?.validation?.title + : props.title } - }} - ref={props.inputRef} - value={props.value} - style={{ ...props.style }} - defaultValue={props.defaultValue} - minLength={props.minlength} - maxLength={props.maxlength} - max={props.max} - required={props?.validation && props.ValidationRequired ? props?.validation?.isRequired :props.isRequired || (props.type === "date" && (props.name === "fromDate" ? data.toDate : data.fromDate))} - pattern={props?.validation && props.ValidationRequired ? props?.validation?.pattern : props.pattern} - min={props.min} - readOnly={props.disable} - title={props?.validation && props.ValidationRequired ? props?.validation?.title :props.title} - step={props.step} - autoFocus={props.autoFocus} - onBlur={props.onBlur} - onKeyPress={props.onKeyPress} - autoComplete="off" - disabled={props.disabled} - /> + step={props.step} + autoFocus={props.autoFocus} + onBlur={props.onBlur} + onKeyPress={props.onKeyPress} + autoComplete="off" + disabled={props.disabled} + onFocus={props?.onFocus} + nonEditable={props.nonEditable} + config={props.config} + populators={props.populators} + onClick={ + props.type === "date" || props.type === "time" + ? openPicker() + : null + } + /> + {renderSuffix()} + {props.signature && props.signatureImg} + {icon && ( + + {icon} + + )} +
)} - {/* {props.type === "date" && } */} - {props.signature ? props.signatureImg : null} - {props.customIcon ? props.customIcon === "geolocation" ? : null : null}
); @@ -107,16 +426,49 @@ const TextInput = (props) => { TextInput.propTypes = { userType: PropTypes.string, - isMandatory: PropTypes.bool, - name: PropTypes.string, + required: PropTypes.bool, + name: PropTypes.string.isRequired, placeholder: PropTypes.string, onChange: PropTypes.func, - ref: PropTypes.func, + inputRef: PropTypes.oneOfType([ + PropTypes.func, + PropTypes.shape({ current: PropTypes.instanceOf(Element) }), + ]), value: PropTypes.any, + className: PropTypes.string, + style: PropTypes.object, + maxLength: PropTypes.number, + minlength: PropTypes.number, + max: PropTypes.number, + pattern: PropTypes.string, + min: PropTypes.number, + disabled: PropTypes.bool, + nonEditable: PropTypes.bool, + errorStyle: PropTypes.bool, + hideSpan: PropTypes.bool, + title: PropTypes.string, + step: PropTypes.string, + autoFocus: PropTypes.bool, + onBlur: PropTypes.func, + onKeyPress: PropTypes.func, + textInputStyle: PropTypes.object, + defaultValue: PropTypes.any, + customClass: PropTypes.string, + signature: PropTypes.bool, + signatureImg: PropTypes.node, + onIconSelection: PropTypes.func, + type: PropTypes.string, + watch: PropTypes.func, + onFocus: PropTypes.func, + charCount: PropTypes.bool, + errors: PropTypes.object, + config: PropTypes.object, + error: PropTypes.string, }; TextInput.defaultProps = { - isMandatory: false, + required: false, + charCount: false, }; function DatePicker(props) { @@ -133,7 +485,7 @@ function DatePicker(props) { return ( Date: Mon, 8 Apr 2024 16:03:21 +0530 Subject: [PATCH 19/41] PFM-5996: Fixed employee side bar not working --- .../libraries/src/services/molecules/Store/service.js | 2 +- .../modules/core/src/components/TopBarSideBar/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js index 13174979b..6debb8dae 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js @@ -88,7 +88,7 @@ export const StoreService = { .flat() .reduce((unique, ele) => (unique.find((item) => item.code === ele.code) ? unique : [...unique, ele]), []); initData.tenants = MdmsRes?.tenant?.tenants - ?.filter((x) => x.pgrEnabled) + // ?.filter((x) => x.pgrEnabled) .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js index dec6eb104..acafcd34e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/index.js @@ -57,7 +57,7 @@ const TopBarSideBar = ({ showLanguageChange={showLanguageChange} /> {showDialog && } - {/* {showSidebar && ( + {showSidebar && ( - )} */} + )} ); }; From b50389f8d5ad0f0ffede9baa5e3b72e683bd5f2b Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:43:52 +0530 Subject: [PATCH 20/41] PFM-5971 Added a default function to select a default jurisdiction for divison user --- .../src/components/pageComponents/jurisdiction.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index 805bc0f00..4d74142cf 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -73,7 +73,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => { }, []); useEffect(() => { - let cities = [Digit.ULBService.getCurrentTenantId()] + let cities = userData?.user[0]?.roles?.map((role) => role.tenantId)?.filter((value, index, array) => array.indexOf(value) === index); selectboundary( data?.MdmsRes?.tenant?.tenants @@ -339,6 +339,16 @@ function Jurisdiction({ const STATE_ADMIN = Digit.UserService.hasAccess(["STATE_ADMIN"]); let isMobile = window.Digit.Utils.browser.isMobile(); const isEdit = window.location.href?.includes("hrms/edit"); + let defaultjurisdiction = () =>{ + let currentTenant = Digit.ULBService.getCurrentTenantId(); + let defaultjurisdiction; + Boundary?.map((ele)=>{ + if (ele.code === currentTenant){ + defaultjurisdiction = ele; + } + }) + return defaultjurisdiction; + } // useEffect(() => { // selectBoundaryType( @@ -595,7 +605,7 @@ function Jurisdiction({ Date: Wed, 10 Apr 2024 17:59:33 +0530 Subject: [PATCH 21/41] PFM-5998: Added Sarpanch, Secretory, Revenue Collector --- .../mgramseva/lib/utils/role_actions.dart | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/frontend/mgramseva/lib/utils/role_actions.dart b/frontend/mgramseva/lib/utils/role_actions.dart index 12c98a142..ad4a2c533 100644 --- a/frontend/mgramseva/lib/utils/role_actions.dart +++ b/frontend/mgramseva/lib/utils/role_actions.dart @@ -89,19 +89,19 @@ class RoleActionsFiltering { switch (route) { // GP Admin case Routes.HOUSEHOLD: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.CONSUMER_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.CONSUMER_SEARCH_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.CONSUMER_CREATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.HOUSEHOLD_DETAILS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.SEARCH_CONSUMER_RESULT: return [ @@ -109,35 +109,37 @@ class RoleActionsFiltering { 'BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', - 'DIV_ADMIN' + 'DIV_ADMIN', + 'SARPANCH', + 'SECRETORY' ]; case Routes.HOUSEHOLD_REGISTER: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; // Expense Processing case Routes.EXPENSE_SEARCH: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.EXPENSES_ADD: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.EXPENSE_UPDATE: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.HOUSEHOLDRECEIPTS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.MANUAL_BILL_GENERATE: - return ['BULK_DEMAND_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['BULK_DEMAND_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; // Collection Operator case Routes.CONSUMER_SEARCH: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','REVENUE_COLLECTOR','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; case Routes.BILL_GENERATE: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; case Routes.DASHBOARD: - return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN']; + return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; case Routes.REPORTS: - return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN']; + return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH''SECRETORY','REVENUE_COLLECTOR']; default: return []; } From cf33eb9b038709b08c29ca5e43c50490815c0c13 Mon Sep 17 00:00:00 2001 From: Saloni <103189799+saloni041@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:36:44 +0530 Subject: [PATCH 22/41] Update application.properties --- .../ws-calculator/src/main/resources/application.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/municipal-services/ws-calculator/src/main/resources/application.properties b/municipal-services/ws-calculator/src/main/resources/application.properties index 9b8bb7a36..c1860ade8 100644 --- a/municipal-services/ws-calculator/src/main/resources/application.properties +++ b/municipal-services/ws-calculator/src/main/resources/application.properties @@ -22,7 +22,6 @@ spring.kafka.consumer.group-id=egov-ws-calc-services spring.kafka.consumer.properties.spring.json.use.type.headers=false spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer -spring.kafka.consumer.properties.max.poll.interval.ms=600000 $KAFKA TOPIC DETAILS egov.watercalculatorservice.createdemand.topic=ws-generate-demand From 2dc3991599d2e81d338ac0771e80a6e3b25e0f71 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:19:27 +0530 Subject: [PATCH 23/41] ISTE-17 Password icon change --- .../packages/react-components/src/atoms/svgindex.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js index 22df02952..5ef4b5047 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/svgindex.js @@ -1743,18 +1743,11 @@ const WarningIcon =({ className = "", fill = "none", style = {} })=>( ( - - - - + ); const PasswordEyeDisableSvg = ({ className, fill = "white", style = {} }) => ( - - - - - + ); const ExpenditureIcon = BillsIcon; From 6d9d97f91c474e682858d28f17764096c7dc0013 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:11:03 +0530 Subject: [PATCH 24/41] ISTE-19: Updated password for profile --- .../core/src/pages/citizen/Home/UserProfile.js | 12 +++++++++--- .../pages/employee/ChangePassword/changePassword.js | 8 -------- .../core/src/pages/employee/ChangePassword/config.js | 6 ------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js index 6203cabdc..211d91ef8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js @@ -155,7 +155,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { const setUserNewPassword = (value) => { setNewPassword(value); - if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) { + if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,10})$/i).test(value)) { setErrors({ ...errors, newPassword: { type: "pattern", message: "CORE_COMMON_PROFILE_PASSWORD_INVALID" } }); } else { setErrors({ ...errors, newPassword: null }); @@ -165,7 +165,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { const setUserConfirmPassword = (value) => { setConfirmPassword(value); - if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) { + if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,10})$/i).test(value)) { setErrors({ ...errors, confirmPassword: { type: "pattern", message: "CORE_COMMON_PROFILE_PASSWORD_INVALID" } }); } else { setErrors({ ...errors, confirmPassword: null }); @@ -216,7 +216,7 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID") }); } - if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(newPassword) && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(confirmPassword)) { + if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,10})$/i).test(newPassword) && !new RegExp(/^([a-zA-Z0-9@#$%]{8,10})$/i).test(confirmPassword)) { throw JSON.stringify({ type: "error", message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID") }); } } @@ -606,6 +606,8 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { pattern="^([a-zA-Z0-9@#$%])+$" onChange={(e) => setUserCurrentPassword(e.target.value)} disable={editScreen} + maxlength={10} + /> {errors?.currentPassword && {t(errors?.currentPassword?.message)}}
@@ -625,6 +627,8 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { pattern="^([a-zA-Z0-9@#$%])+$" onChange={(e) => setUserNewPassword(e.target.value)} disable={editScreen} + maxlength={10} + /> {errors?.newPassword && {t(errors?.newPassword?.message)}}
@@ -644,6 +648,8 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { pattern="^([a-zA-Z0-9@#$%])+$" onChange={(e) => setUserConfirmPassword(e.target.value)} disable={editScreen} + maxlength={10} + /> {errors?.confirmPassword && {t(errors?.confirmPassword?.message)}}
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index f525f93b2..e2afaf06b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -77,14 +77,6 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { const config = [ { body: [ - // { - // label: t(username.label), - // type: username.type, - // populators: { - // name: username.name, - // }, - // isMandatory: true, - // }, { label: t(password.label), type: password.type, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/config.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/config.js index 487112dfd..67f19dd91 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/config.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/config.js @@ -5,12 +5,6 @@ export const config = [ submitButtonLabel: "CORE_COMMON_CHANGE_PASSWORD", }, inputs: [ - { - label: "CORE_LOGIN_USERNAME", - type: "text", - name: "userName", - error: "ERR_HRMS_INVALID_USERNAME", - }, { label: "CORE_LOGIN_NEW_PASSWORD", type: "password", From 786ac8df269c80d11a2fc7cebf55ec96d027b59c Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:21:23 +0530 Subject: [PATCH 25/41] ISTE-7,ISTE-20: Fixed Revenue Collector roles issue --- frontend/mgramseva/lib/utils/role_actions.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/mgramseva/lib/utils/role_actions.dart b/frontend/mgramseva/lib/utils/role_actions.dart index ad4a2c533..4ae9d32cb 100644 --- a/frontend/mgramseva/lib/utils/role_actions.dart +++ b/frontend/mgramseva/lib/utils/role_actions.dart @@ -89,19 +89,19 @@ class RoleActionsFiltering { switch (route) { // GP Admin case Routes.HOUSEHOLD: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_SEARCH_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_CREATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY', 'REVENUE_COLLECTOR']; case Routes.HOUSEHOLD_DETAILS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; case Routes.SEARCH_CONSUMER_RESULT: return [ @@ -112,10 +112,11 @@ class RoleActionsFiltering { 'DIV_ADMIN', 'SARPANCH', 'SECRETORY' + 'REVENUE_COLLECTOR' ]; case Routes.HOUSEHOLD_REGISTER: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; // Expense Processing case Routes.EXPENSE_SEARCH: @@ -125,7 +126,7 @@ class RoleActionsFiltering { case Routes.EXPENSE_UPDATE: return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; case Routes.HOUSEHOLDRECEIPTS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; case Routes.MANUAL_BILL_GENERATE: return ['BULK_DEMAND_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; From f610ab03401b06c029ca59cd664fc8a3b9cb36d7 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:52:54 +0530 Subject: [PATCH 26/41] ISTE-17 Changes in password component --- .../src/pages/citizen/Home/UserProfile.js | 32 +- .../react-components/src/atoms/TextInput.js | 516 +++--------------- .../packages/react-components/src/index.js | 4 +- 3 files changed, 98 insertions(+), 454 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js index 211d91ef8..57745f68b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/UserProfile.js @@ -11,6 +11,7 @@ import { BackButton, Loader, SubmitBar, + Password } from "@egovernments/digit-ui-react-components"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -274,10 +275,10 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS"), 5000); } } catch (error) { - if(error?.response?.data?.Errors[0].message){ + if (error?.response?.data?.Errors[0].message) { showToast("error", error?.response?.data?.Errors[0].message); - - }else{ + + } else { const errorObj = JSON.parse(error); showToast(errorObj.type, t(errorObj.message), 5000); } @@ -598,13 +599,10 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { style={editScreen ? { color: "#B1B4B6", width: "300px" } : { width: "300px" }} >{`${t("CORE_COMMON_PROFILE_CURRENT_PASSWORD")}`}
- setUserCurrentPassword(e.target.value)} + onChange={(value) => setUserCurrentPassword(value)} disable={editScreen} maxlength={10} @@ -619,16 +617,12 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { style={editScreen ? { color: "#B1B4B6", width: "300px" } : { width: "300px" }} >{`${t("CORE_COMMON_PROFILE_NEW_PASSWORD")}`}
- setUserNewPassword(e.target.value)} - disable={editScreen} - maxlength={10} - + value={newPassword} + isMandatory={false} + onChange={(value) => setUserNewPassword(value)} + disable={false} /> {errors?.newPassword && {t(errors?.newPassword?.message)}}
@@ -640,13 +634,13 @@ const UserProfile = ({ stateCode, userType, cityDetails }) => { style={editScreen ? { color: "#B1B4B6", width: "300px" } : { width: "300px" }} >{`${t("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")}`}
- setUserConfirmPassword(e.target.value)} + onChange={(value) => setUserConfirmPassword(value)} disable={editScreen} maxlength={10} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js index f3d099e98..97f2c6481 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextInput.js @@ -1,13 +1,10 @@ -import React, { forwardRef, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; -import { SVG } from "./SVG"; -import StringManipulator from "./StringManipulator"; +import { LocateIcon } from "./svgindex"; const TextInput = (props) => { - const user_type = window?.Digit?.SessionStorage.get("userType"); - const [date, setDate] = useState(props?.type === "date" && props?.value); - const [visibility, setVisibility] = useState(false); - const [inputType, setInputType] = useState(props?.type || "text"); + const user_type = Digit.SessionStorage.get("userType"); + const [date, setDate] = useState(props?.type==="date"&&props?.value); const data = props?.watch ? { fromDate: props?.watch("fromDate"), @@ -16,409 +13,93 @@ const TextInput = (props) => { : {}; const handleDate = (event) => { - const { value } = event?.target; - setDate(value); - props?.onChange(value); - }; - const incrementCount = () => { - const newValue = - Number(props.value) + (Number(props?.step) ? Number(props?.step) : 1); - props.onChange(newValue); - }; - - const decrementCount = () => { - const newValue = Math.max( - Number(props.value) - (Number(props?.step) ? Number(props?.step) : 1), - 0 - ); - props.onChange(newValue); - }; - - const renderPrefix = () => { - const prefixValue = props?.populators?.prefix || ""; - if (props?.type === "numeric") { - return ( - - ); - } - if (prefixValue) { - return ( - - ); - } - return null; - }; - - const renderSuffix = () => { - const suffixValue = props?.populators?.suffix || ""; - if (props?.type === "numeric") { - return ( - - ); - } - if ( - props?.type === "text" && - !props?.populators?.customIcon && - suffixValue - ) { - return ( - - ); - } - return null; - }; - - const handleVisibility = () => { - setVisibility(!visibility); - const newType = !visibility ? "text" : "password"; - setInputType(newType); - props.onChange(props?.value); - }; - - const handleLocationClick = () => { - if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition( - (position) => { - const { latitude, longitude } = position.coords; - props.onChange(`${latitude}, ${longitude}`); - }, - (error) => { - console.error("Error getting location:", error); - } - ); - } else { - console.error("Geolocation is not supported"); - } - }; - - const renderIcon = () => { - const reqIcon = props?.type; - const iconFill = props?.disabled - ? "#D6D5D4" - : props?.nonEditable - ? "#b1b4b6" - : "#505A5F"; - if (reqIcon) { - if (reqIcon === "geolocation") { - return ( - - ); - } else if (reqIcon === "password" && inputType === "text" && visibility) { - return ( - - ); - } else if (reqIcon === "password") { - return ( - - ); - } else if (reqIcon === "search") { - return ( - - ); - } else { - try { - const components = require("@egovernments/digit-ui-svg-components"); - const DynamicIcon = - props?.type === "text" && - components?.[props?.populators?.customIcon]; - if (DynamicIcon) { - const svgElement = DynamicIcon({ - width: "1.5rem", - height: "1.5rem", - fill: iconFill, - className: `digit-text-input-customIcon ${ - props.disabled ? "disabled" : "" - } ${props.nonEditable ? "nonEditable" : ""}`, - }); - return svgElement; - } else { - console.log("Icon not found"); - return null; - } - } catch (error) { - console.error("Icon not found"); - return null; - } - } - } - return null; + const { value } = event.target; + setDate(getDDMMYYYY(value)); }; - const icon = renderIcon(); - - const openPicker = () => { - document.addEventListener("DOMContentLoaded", function () { - const dateInput = document.querySelector('input[type="date"]'); - const timeInput = document.querySelector('input[type="time"]'); - - const handleClick = (event) => { - try { - event.target.showPicker(); - } catch (error) { - window.alert(error); - } - }; - - if (dateInput) { - dateInput.addEventListener("click", handleClick); - } - - if (timeInput) { - timeInput.addEventListener("click", handleClick); - } - }); - }; - - const inputClassNameForMandatory = `${ - user_type ? "digit-employee-card-input-error" : "digit-card-input-error" - } ${props.disabled ? "disabled" : ""} ${props.customClass || ""} ${ - props.nonEditable ? "noneditable" : "" - } ${props.type === "numeric" ? "numeric" : ""}`; - - const inputClassName = `${ - user_type ? "digit-employee-card-input" : "digit-citizen-card-input" - } ${props.disabled ? "disabled" : ""} focus-visible ${ - props.errorStyle ? "digit-employee-card-input-error" : "" - } ${props.nonEditable ? "noneditable" : ""} ${ - props.type === "numeric" ? "numeric" : "" - }`; - - const defaultType = - props.type === "password" && inputType === "text" - ? "passwordToText" - : props.type; - - const inputContainerClass = `input-container ${ - defaultType ? defaultType : "" - } ${props.populators?.customIcon ? "withIcon" : ""}`; - return ( -
- {props.required ? ( -
- {renderPrefix()} - { - if (props?.type === "number" && props?.maxlength) { - if (event.target.value.length > props?.maxlength) { - event.target.value = event.target.value.slice(0, -1); - } - } - if (props?.type === "numeric") { - event.target.value = event.target.value.replace( - /[^0-9]/g, - "" - ); - } - if (props?.onChange) { - props?.onChange(event); +
+ {props.isMandatory ? ( + { + if(props?.type === "number" && props?.maxlength) { + if(event.target.value.length > props?.maxlength) { + event.target.value = event.target.value.slice(0,-1); } - if (props.type === "date") { - handleDate(event); - } - }} - ref={props.inputRef} - value={props?.value} - style={{ ...props.style }} - defaultValue={props.defaultValue} - minLength={props.minlength} - maxLength={props.maxlength} - max={props.max} - pattern={ - props?.validation && props.ValidationRequired - ? props?.validation?.pattern - : props.pattern } - min={props.min} - readOnly={props.nonEditable} - title={ - props?.validation && props.ValidationRequired - ? props?.validation?.title - : props.title + if (props?.onChange) { + props?.onChange(event); } - step={props.step} - autoFocus={props.autoFocus} - onBlur={props.onBlur} - autoComplete="off" - disabled={props.disabled} - onFocus={props?.onFocus} - nonEditable={props.nonEditable} - config={props.config} - populators={props.populators} - onclick={ - props.type === "date" || props.type === "time" - ? openPicker() - : null + if (props.type === "date") { + handleDate(event); } - /> - {renderSuffix()} - {props.signature && props.signatureImg} - {icon && ( - - {icon} - - )} -
+ }} + ref={props.inputRef} + value={props.value} + style={{ ...props.style }} + defaultValue={props.defaultValue} + minLength={props.minlength} + maxLength={props.maxlength} + max={props.max} + pattern={props?.validation && props.ValidationRequired ? props?.validation?.pattern : props.pattern} + min={props.min} + readOnly={props.disable} + title={props?.validation && props.ValidationRequired ? props?.validation?.title :props.title} + step={props.step} + autoFocus={props.autoFocus} + onBlur={props.onBlur} + autoComplete="off" + disabled={props.disabled} + /> ) : ( -
- {renderPrefix()} - { - if (props?.type === "number" && props?.maxlength) { - if (event.target.value.length > props?.maxlength) { - event.target.value = event.target.value.slice(0, -1); - } + { + if(props?.type === "number" && props?.maxlength) { + if(event.target.value.length > props?.maxlength) { + event.target.value = event.target.value.slice(0,-1); } - if (props?.type === "numeric") { - event.target.value = event.target.value.replace( - /[^0-9]/g, - "" - ); - } - if (props?.onChange) { - props?.onChange(event); - } - if (props.type === "date") { - handleDate(event); - } - }} - ref={props.inputRef} - value={props?.value} - style={{ ...props.style }} - defaultValue={props.defaultValue} - minLength={props.minlength} - maxLength={props.maxlength} - max={props.max} - required={ - props?.validation && props.ValidationRequired - ? props?.validation?.isRequired - : props.isRequired || - (props.type === "date" && - (props.name === "fromDate" ? data.toDate : data.fromDate)) } - pattern={ - props?.validation && props.ValidationRequired - ? props?.validation?.pattern - : props.pattern + if (props?.onChange) { + props?.onChange(event); } - min={props.min} - readOnly={props.nonEditable} - title={ - props?.validation && props.ValidationRequired - ? props?.validation?.title - : props.title + if (props.type === "date") { + handleDate(event); } - step={props.step} - autoFocus={props.autoFocus} - onBlur={props.onBlur} - onKeyPress={props.onKeyPress} - autoComplete="off" - disabled={props.disabled} - onFocus={props?.onFocus} - nonEditable={props.nonEditable} - config={props.config} - populators={props.populators} - onClick={ - props.type === "date" || props.type === "time" - ? openPicker() - : null - } - /> - {renderSuffix()} - {props.signature && props.signatureImg} - {icon && ( - - {icon} - - )} -
+ }} + ref={props.inputRef} + value={props.value} + style={{ ...props.style }} + defaultValue={props.defaultValue} + minLength={props.minlength} + maxLength={props.maxlength} + max={props.max} + required={props?.validation && props.ValidationRequired ? props?.validation?.isRequired :props.isRequired || (props.type === "date" && (props.name === "fromDate" ? data.toDate : data.fromDate))} + pattern={props?.validation && props.ValidationRequired ? props?.validation?.pattern : props.pattern} + min={props.min} + readOnly={props.disable} + title={props?.validation && props.ValidationRequired ? props?.validation?.title :props.title} + step={props.step} + autoFocus={props.autoFocus} + onBlur={props.onBlur} + onKeyPress={props.onKeyPress} + autoComplete="off" + disabled={props.disabled} + /> )} + {/* {props.type === "date" && } */} + {props.signature ? props.signatureImg : null} + {props.customIcon ? props.customIcon === "geolocation" ? : null : null}
); @@ -426,49 +107,16 @@ const TextInput = (props) => { TextInput.propTypes = { userType: PropTypes.string, - required: PropTypes.bool, - name: PropTypes.string.isRequired, + isMandatory: PropTypes.bool, + name: PropTypes.string, placeholder: PropTypes.string, onChange: PropTypes.func, - inputRef: PropTypes.oneOfType([ - PropTypes.func, - PropTypes.shape({ current: PropTypes.instanceOf(Element) }), - ]), + ref: PropTypes.func, value: PropTypes.any, - className: PropTypes.string, - style: PropTypes.object, - maxLength: PropTypes.number, - minlength: PropTypes.number, - max: PropTypes.number, - pattern: PropTypes.string, - min: PropTypes.number, - disabled: PropTypes.bool, - nonEditable: PropTypes.bool, - errorStyle: PropTypes.bool, - hideSpan: PropTypes.bool, - title: PropTypes.string, - step: PropTypes.string, - autoFocus: PropTypes.bool, - onBlur: PropTypes.func, - onKeyPress: PropTypes.func, - textInputStyle: PropTypes.object, - defaultValue: PropTypes.any, - customClass: PropTypes.string, - signature: PropTypes.bool, - signatureImg: PropTypes.node, - onIconSelection: PropTypes.func, - type: PropTypes.string, - watch: PropTypes.func, - onFocus: PropTypes.func, - charCount: PropTypes.bool, - errors: PropTypes.object, - config: PropTypes.object, - error: PropTypes.string, }; TextInput.defaultProps = { - required: false, - charCount: false, + isMandatory: false, }; function DatePicker(props) { @@ -485,7 +133,7 @@ function DatePicker(props) { return ( Date: Fri, 19 Apr 2024 16:19:50 +0530 Subject: [PATCH 27/41] Added password not taking props --- .../packages/react-components/src/atoms/Password.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js index e48d11618..f8d9234cc 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js @@ -27,8 +27,8 @@ const Password = (props) => { ref={props.inputRef} value={props.value} style={{ ...props.style }} - minLength={props.minlength} - maxLength={props.maxlength} + minLength={props.minlength || 10} + maxLength={props.maxlength || 10} max={props.max} min={props.min} readOnly={props.disable} From c6e0ea2954892b7410c5048e89bcdbf02c81ae0c Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Mon, 22 Apr 2024 21:36:05 +0530 Subject: [PATCH 28/41] ISTE-19: Foxed minlentgh issue --- .../packages/react-components/src/atoms/Password.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js index f8d9234cc..23517fb30 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Password.js @@ -27,7 +27,7 @@ const Password = (props) => { ref={props.inputRef} value={props.value} style={{ ...props.style }} - minLength={props.minlength || 10} + minLength={props.minlength} maxLength={props.maxlength || 10} max={props.max} min={props.min} From cd0613ba6db4a7ccca3bb4c261b9e00b680cd0c2 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:59:31 +0530 Subject: [PATCH 29/41] ISTE-20: Added sarpanch,revenue collector, secretory & Updated role --- .../mgramseva/lib/utils/role_actions.dart | 32 +++++++++---------- .../packages/modules/hrms/src/pages/Inbox.js | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/frontend/mgramseva/lib/utils/role_actions.dart b/frontend/mgramseva/lib/utils/role_actions.dart index 4ae9d32cb..1ef84a73e 100644 --- a/frontend/mgramseva/lib/utils/role_actions.dart +++ b/frontend/mgramseva/lib/utils/role_actions.dart @@ -89,19 +89,19 @@ class RoleActionsFiltering { switch (route) { // GP Admin case Routes.HOUSEHOLD: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY' ,'REVENUE_COLLECTOR']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY' ,'REVENUE_COLLECTOR']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETARY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_SEARCH_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY' ,'REVENUE_COLLECTOR']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETARY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_CREATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETORY', 'REVENUE_COLLECTOR']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETARY', 'REVENUE_COLLECTOR']; case Routes.HOUSEHOLD_DETAILS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.SEARCH_CONSUMER_RESULT: return [ @@ -111,36 +111,36 @@ class RoleActionsFiltering { 'SUPERUSER', 'DIV_ADMIN', 'SARPANCH', - 'SECRETORY' + 'SECRETARY' 'REVENUE_COLLECTOR' ]; case Routes.HOUSEHOLD_REGISTER: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; // Expense Processing case Routes.EXPENSE_SEARCH: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; case Routes.EXPENSES_ADD: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; case Routes.EXPENSE_UPDATE: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; case Routes.HOUSEHOLDRECEIPTS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.MANUAL_BILL_GENERATE: - return ['BULK_DEMAND_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY']; + return ['BULK_DEMAND_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; // Collection Operator case Routes.CONSUMER_SEARCH: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','REVENUE_COLLECTOR','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','REVENUE_COLLECTOR','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.BILL_GENERATE: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.DASHBOARD: - return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH','SECRETORY','REVENUE_COLLECTOR']; + return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.REPORTS: - return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH''SECRETORY','REVENUE_COLLECTOR']; + return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH''SECRETARY','REVENUE_COLLECTOR']; default: return []; } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/Inbox.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/Inbox.js index 61aeef862..e4c098037 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/Inbox.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/Inbox.js @@ -28,7 +28,7 @@ const Inbox = ({ parentRoute, businessService = "HRMS", initialStates = {}, filt let roles = STATE_ADMIN ? { roles: "DIV_ADMIN, HRMS_ADMIN", isStateLevelSearch: true } - : { roles: "SYSTEM, GP_ADMIN, COLLECTION_OPERATOR, PROFILE_UPDATE, DASHBOAD_VIEWER", isStateLevelSearch: false }; + : { roles: "SYSTEM, GP_ADMIN, COLLECTION_OPERATOR, PROFILE_UPDATE, DASHBOAD_VIEWER, SARPANCH, REVENUE_COLLECTOR, SECRETARY", isStateLevelSearch: false }; let requestBody = { criteria: { From fc40dab79b590cd25876de56567a4fdf9e582819 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:28:48 +0530 Subject: [PATCH 30/41] ISTE-19: Fixed forgot password issue --- .../core/src/pages/employee/ChangePassword/changePassword.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js index e2afaf06b..b15022701 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/ChangePassword/changePassword.js @@ -54,6 +54,8 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { } const requestData = { ...data, + username:mobileNumber, + otpReference: otp, tenantId, type: getUserType().toUpperCase(), From 4ce98e5707aad9121da428e5ee7fbce93481c56f Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:14:45 +0530 Subject: [PATCH 31/41] ISTE-8 Modification for role dropdown --- .../hrms/src/components/pageComponents/jurisdiction.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index 24d4ed954..dda9ea449 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -234,7 +234,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => { return roleCodesToFilter.includes(role.code); }) .map((role) => { - return { code: role.code, name: role?.name ? role?.name : " ", labelKey: "ACCESSCONTROL_ROLES_ROLES_" + role.code }; + return { code: role.code, name: role?.name ? role?.name : " ", i18text: "ACCESSCONTROL_ROLES_ROLES_" + role.code }; }); } else { // Specify the role codes you want to filter @@ -243,7 +243,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => { return data?.MdmsRes?.["ws-services-masters"].WSServiceRoles?.filter((role) => { return !roleCodesToFilter.includes(role.code); })?.map((role) => { - return { code: role.code, name: role?.name ? role?.name : " ", labelKey: "ACCESSCONTROL_ROLES_ROLES_" + role.code }; + return { code: role.code, name: role?.name ? role?.name : " ", i18text: "ACCESSCONTROL_ROLES_ROLES_" + role.code }; }); } } @@ -622,7 +622,7 @@ function Jurisdiction({ selected={jurisdiction?.roles} options={getroledata(roleoption)} onSelect={selectrole} - optionsKey="labelKey" + optionsKey="i18text" showSelectAll={true} t={t} /> From 154a215760f4d042378f1af056c3da3305798ef7 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:20:28 +0530 Subject: [PATCH 32/41] ISTE-9 Addded Division user and state user type --- .../modules/core/src/components/TopBarSideBar/TopBar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js index 43adc8100..4a2d07439 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js @@ -97,6 +97,7 @@ const TopBar = ({ ); } const loggedin = userDetails?.access_token ? true : false; + console.log(userDetails,"userDetails") return (
{mobileView ? : null} @@ -107,9 +108,13 @@ const TopBar = ({

{t(cityDetails?.i18nKey).toUpperCase()}{" "} {t(`ULBGRADE_${cityDetails?.city?.ulbGrade.toUpperCase().replace(" ", "_").replace(".", "_")}`).toUpperCase()} + {` ${userDetails?.info?.roles.some(obj => obj.name === "STATE ADMIN")?` (${userDetails?.info?.name} | State User)`:` (${userDetails?.info?.name} | Division User)`}`}

) : ( - +
+ +

{` ${userDetails?.info?.roles.some(obj => obj.name === "STATE ADMIN")?`(${userDetails?.info?.name} | State User)`:`(${userDetails?.info?.name} | Division User)`}`}

+
))} {!loggedin && (

From 75bb0ce9cfbd5ceb05f4e2eb73567ac160a2d06b Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:21:43 +0530 Subject: [PATCH 33/41] ISTE-9 Addded Division user and state user type --- .../packages/modules/core/src/components/TopBarSideBar/TopBar.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js index 4a2d07439..589292b7f 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js @@ -97,7 +97,6 @@ const TopBar = ({ ); } const loggedin = userDetails?.access_token ? true : false; - console.log(userDetails,"userDetails") return (

{mobileView ? : null} From 7c2778a104792c9e8473e56ea0ff7fac5ea4e4ac Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:46:36 +0530 Subject: [PATCH 34/41] ISTE-20: Fixed count not reflecting --- .../packages/modules/hrms/src/components/hrmscard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js index 02736b550..5fe963f41 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js @@ -15,7 +15,7 @@ const HRMSCard = () => { const tenantId = Digit.ULBService.getCurrentTenantId(); let roles = STATE_ADMIN ? { roles: "DIV_ADMIN, HRMS_ADMIN", isStateLevelSearch: true } - : { roles: "SYSTEM, GP_ADMIN, COLLECTION_OPERATOR, PROFILE_UPDATE, DASHBOAD_VIEWER", isStateLevelSearch: false }; + : { roles: "SYSTEM, GP_ADMIN, COLLECTION_OPERATOR, PROFILE_UPDATE, DASHBOAD_VIEWER, SARPANCH, REVENUE_COLLECTOR, SECRETARY", isStateLevelSearch: false }; const { isLoading, isError, error, data, ...rest } = Digit.Hooks.hrms.useHRMSCount(tenantId, roles); const moduleForSomeDIVAdmin = From 2faae3365694ea999f9d69203810aa9ab14e1c25 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:55:40 +0530 Subject: [PATCH 35/41] ISTE-9 changes in top bar for type of user --- .../modules/core/src/components/TopBarSideBar/TopBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js index 589292b7f..b375c032a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js @@ -112,7 +112,7 @@ const TopBar = ({ ) : (
-

{` ${userDetails?.info?.roles.some(obj => obj.name === "STATE ADMIN")?`(${userDetails?.info?.name} | State User)`:`(${userDetails?.info?.name} | Division User)`}`}

+

{` ${userDetails?.info?.roles.some(obj => obj.name === "STATE ADMIN")?`(${userDetails?.info?.name} | State User)`:`(${userDetails?.info?.name} | Division User)`}`}

))} {!loggedin && ( From 1929fe47e5b79a947c54479cc75f6191b400d09b Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:58:11 +0530 Subject: [PATCH 36/41] ISTE-10 Validation added while creating employee --- .../components/pageComponents/jurisdiction.js | 28 ++----------------- .../modules/hrms/src/pages/createEmployee.js | 2 ++ 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index dda9ea449..79587f625 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -311,7 +311,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => {
); }; -// ------------------------------------------------------------------------------------- + function Jurisdiction({ t, formData, @@ -350,18 +350,6 @@ function Jurisdiction({ return defaultjurisdiction; } - // useEffect(() => { - // selectBoundaryType( - // data?.MdmsRes?.["egov-location"]["TenantBoundary"] - // .filter((ele) => { - // return ele?.hierarchyType?.code == hierarchylist[0]?.code; - // }) - // .map((item) => { - // return { ...item.boundary, i18text: Digit.Utils.locale.convertToLocale(item.boundary.label, "EGOV_LOCATION_BOUNDARYTYPE") }; - // }) - // ); - // }, [jurisdiction?.hierarchy, data?.MdmsRes]); - useEffect(() => { setDivision( divisions?.map((item) => { @@ -371,17 +359,6 @@ function Jurisdiction({ }, [divisions]); const tenant = Digit.ULBService.getCurrentTenantId(); - // useEffect(() => { - // console.log("ssss") - // let cities = userDetails?.roles.map((role) => role.tenantId)?.filter((value, index, array) => array.indexOf(value) === index); - // selectboundary( - // data?.MdmsRes?.tenant?.tenants - // ?.filter((city) => city.code != Digit.ULBService.getStateId() && cities?.includes(city.code)) - // ?.map((city) => { - // return { ...city, i18text: Digit.Utils.locale.getCityLocale(city.code) }; - // }) - // ); - // }, [data]); useEffect(() => { if (Boundary?.length > 0) { @@ -451,7 +428,7 @@ function Jurisdiction({ }); res?.forEach((resData) => { - resData.labelKey = "ACCESSCONTROL_ROLES_ROLES_" + resData.code; + resData.i18text = "ACCESSCONTROL_ROLES_ROLES_" + resData.code; }); if (isEdit && STATE_ADMIN) setJuristictionsData((pre) => pre.map((item) => (item.key === jurisdiction.key ? { ...item, roles: res } : item))); @@ -473,6 +450,7 @@ function Jurisdiction({ [...data].filter((value) => Object.keys(value).length !== 0) ); setjurisdictions((pre) => pre.map((item) => (item.key === jurisdiction.key ? { ...item, roles: res } : item))); + selectedboundary(jurisdiction?.boundary?jurisdiction?.boundary:defaultjurisdiction()); }; const selectDivisionBoundary = (e) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js index c259087ef..de6c904a8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js @@ -112,6 +112,8 @@ const CreateEmployee = () => { formData?.SelectEmployeeGender?.gender.code && formData?.SelectEmployeeName?.employeeName && formData?.SelectEmployeePhoneNumber?.mobileNumber && + formData?.Jurisdictions.length && + formData?.Jurisdictions.filter((juris) => juris?.roles?.length).length > 0 && checkfield && phonecheck && checkMailNameNum(formData) From 175514d3eb281260d23c34f3eea8974ea6418aa0 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:16:28 +0530 Subject: [PATCH 37/41] ISTE-8 Modification in Multiselect dropdown --- .../modules/hrms/src/components/pageComponents/Multiselect.js | 3 +-- .../packages/modules/hrms/src/pages/createEmployee.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js index 0b92d0c5a..5fc8a2b33 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js @@ -88,10 +88,9 @@ const MultiSelectDropdown = ({ }, [selected?.length]); function fnToSelectOptionThroughProvidedSelection(selected) { - return selected?.map((e) => ( { - [optionsKey]: `ACCESSCONTROL_ROLES_ROLES_${e.code}`, + [optionsKey]: e?.i18text? e.i18text : `ACCESSCONTROL_ROLES_ROLES_${e.code}`, propsData: [null, e] } )); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js index de6c904a8..4fca1bacb 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js @@ -113,7 +113,7 @@ const CreateEmployee = () => { formData?.SelectEmployeeName?.employeeName && formData?.SelectEmployeePhoneNumber?.mobileNumber && formData?.Jurisdictions.length && - formData?.Jurisdictions.filter((juris) => juris?.roles?.length).length > 0 && + (formData?.Jurisdictions.filter((juris) => juris?.roles?.length).length > 0 || formData?.Jurisdictions.filter((juris) => juris?.divisionBoundary?.length).length > 0) && checkfield && phonecheck && checkMailNameNum(formData) From 40b048f723cab744b3dce62c7c36d0d251b100aa Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Mon, 29 Apr 2024 12:30:20 +0530 Subject: [PATCH 38/41] ISTE-8 Modified Tag for Division user --- .../hrms/src/components/pageComponents/jurisdiction.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js index 79587f625..af3992ab1 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js @@ -604,10 +604,12 @@ function Jurisdiction({ showSelectAll={true} t={t} /> -
+
0 && "50px", overflowY: "scroll" }}> {jurisdiction?.roles.length > 0 && jurisdiction?.roles.map((value, index) => { - return onRemove(index, value)} />; + return ( + onRemove(index, value)} /> + ) })}
From ce1b5452da114a85ecd50ee09fe987b995890be4 Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:56:58 +0530 Subject: [PATCH 39/41] ISTE-8 Modification in all select for Multiselect --- .../hrms/src/components/pageComponents/Multiselect.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js index 5fc8a2b33..7020d3f4a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js @@ -107,6 +107,15 @@ const MultiSelectDropdown = ({ } }, [active]); + useEffect(()=>{ + if (alreadyQueuedSelectedState?.length === filteredOptions?.length){ + setIsSelected(true) + }else{ + setIsSelected(false) + + } + },[alreadyQueuedSelectedState]) + function handleOutsideClickAndSubmitSimultaneously() { setActive(false); } From 76aad439c09be4c145eb45817f742fbfa755300b Mon Sep 17 00:00:00 2001 From: chinmoy-eGov <115543497+chinmoy-eGov@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:25:19 +0530 Subject: [PATCH 40/41] ISTE-22 Modification in Change city dropdown --- .../modules/core/src/components/ChangeCity.js | 40 +++++-------------- .../src/components/TopBarSideBar/TopBar.js | 2 +- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js index 122f6e506..a21e8d69c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js @@ -10,6 +10,8 @@ const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { return str; }; + + const ChangeCity = (prop) => { const [dropDownData, setDropDownData] = useState({ label: `TENANT_TENANTS_${stringReplaceAll(Digit.SessionStorage.get("Employee.tenantId"), ".", "_")?.toUpperCase()}`, @@ -21,6 +23,12 @@ const ChangeCity = (prop) => { const isDropdown = prop.dropdown || false; let selectedCities = []; + const uuids = [prop.userDetails?.info?.uuid]; + const { data: userData, isUserDataLoading } = Digit.Hooks.useUserSearch(Digit.ULBService.getStateId(), { uuid: uuids }, {}); + // setSelectedCity(userData?.data?.user[0]?.roles) + + + const { data: data = {}, isLoading } = Digit.Hooks.hrms.useHrmsMDMS(Digit.ULBService.getCurrentTenantId(), "egov-hrms", "HRMSRolesandDesignation") || {}; @@ -43,9 +51,8 @@ const ChangeCity = (prop) => { useEffect(() => { const userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject"); - let teantsArray = [], - filteredArray = []; - userloggedValues?.info?.roles?.forEach((role) => teantsArray.push(role.tenantId)); + let teantsArray = [],filteredArray = []; + userData?.user[0].roles?.forEach((role) => teantsArray.push(role.tenantId)); let unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i); unique?.forEach((uniCode) => { @@ -69,7 +76,6 @@ const ChangeCity = (prop) => { setSelectCityData(filteredArray); }, [dropDownData, data?.MdmsRes]); - // if (isDropdown) { return (
{ selected={dropDownData} optionKey={"label"} select={handleChangeCity} - // freeze={true} - // noBorder={true} optionCardStyles={{ overflow: "revert", display: "table" }} - // customSelector={ - // - // } />
); - // } else { - // return ( - // - //
City
- //
- // {selectCityData?.map((city, index) => ( - //
- // handleChangeCity(city)} - // > - //
- // ))} - //
- //
- // ); - // } + }; export default ChangeCity; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js index b375c032a..efaa32f86 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js @@ -124,7 +124,7 @@ const TopBar = ({
{!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && ( - + )}
{showLanguageChange && }
From 5147e08c695dcec2d0a6dd37700f91059d9ae772 Mon Sep 17 00:00:00 2001 From: Anil Singha <99383116+anilsingha-eGov@users.noreply.github.com> Date: Fri, 3 May 2024 11:00:46 +0530 Subject: [PATCH 41/41] ISTE-11: Added css to hide breadcrum --- .../micro-ui/web/micro-ui-internals/example/public/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html index 3db3ee3c1..37582faef 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/frontend/micro-ui/web/micro-ui-internals/example/public/index.html @@ -36,6 +36,9 @@ margin-bottom: 24px !important; border-left: none; } + .workbench-bredcrumb { + display: none !important; + }