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(); } 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/utils/role_actions.dart b/frontend/mgramseva/lib/utils/role_actions.dart index 12c98a142..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']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_UPDATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN']; + 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']; + return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN','SARPANCH','SECRETARY' ,'REVENUE_COLLECTOR']; case Routes.CONSUMER_CREATE: - return ['GP_ADMIN', 'SUPERUSER', 'COLLECTION_OPERATOR', 'DIV_ADMIN']; + 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']; + return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.SEARCH_CONSUMER_RESULT: return [ @@ -109,35 +109,38 @@ class RoleActionsFiltering { 'BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', - 'DIV_ADMIN' + 'DIV_ADMIN', + 'SARPANCH', + 'SECRETARY' + 'REVENUE_COLLECTOR' ]; case Routes.HOUSEHOLD_REGISTER: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; // Expense Processing case Routes.EXPENSE_SEARCH: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; case Routes.EXPENSES_ADD: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; case Routes.EXPENSE_UPDATE: - return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN']; + return ['EXPENSE_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; case Routes.HOUSEHOLDRECEIPTS: - return ['BULK_DEMAND_PROCESSING', 'COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + 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']; + return ['BULK_DEMAND_PROCESSING', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY']; // Collection Operator case Routes.CONSUMER_SEARCH: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','REVENUE_COLLECTOR','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.BILL_GENERATE: - return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN']; + return ['COLLECTION_OPERATOR', 'SUPERUSER', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.DASHBOARD: - return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN']; + return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH','SECRETARY','REVENUE_COLLECTOR']; case Routes.REPORTS: - return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN']; + return ['SUPERUSER', 'DASHBOARD_VIEWER', 'GP_ADMIN', 'DIV_ADMIN','SARPANCH''SECRETARY','REVENUE_COLLECTOR']; default: return []; } 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("") ]) ], )), 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 609ecaa54..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 @@ -16,19 +16,30 @@ + + .employeeForgotPassword .employee-card-input { + margin-bottom: 24px !important; + border-left: none; + } + .workbench-bredcrumb { + display: none !important; + } + 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/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 43adc8100..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 @@ -107,9 +107,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 && (

@@ -120,7 +124,7 @@ const TopBar = ({

{!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && ( - + )}
{showLanguageChange && }
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 && ( - )} */} + )} ); }; 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..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"; @@ -155,7 +156,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 +166,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 +217,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") }); } } @@ -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,14 +599,13 @@ 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} + /> {errors?.currentPassword && {t(errors?.currentPassword?.message)}}
@@ -617,14 +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} + value={newPassword} + isMandatory={false} + onChange={(value) => setUserNewPassword(value)} + disable={false} /> {errors?.newPassword && {t(errors?.newPassword?.message)}}
@@ -636,14 +634,16 @@ 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} + /> {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 c67853708..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 @@ -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"; @@ -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(); @@ -55,6 +54,8 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { } const requestData = { ...data, + username:mobileNumber, + otpReference: otp, tenantId, type: getUserType().toUpperCase(), @@ -72,23 +73,20 @@ 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: 10, + } }, isMandatory: true, }, @@ -97,19 +95,22 @@ const ChangePasswordComponent = ({ config: propsConfig, t }) => { type: confirmPassword.type, populators: { name: confirmPassword.name, + validation:{ + maxlength: 10, + } }, isMandatory: true, }, ], }, - ]; + ]; return (
- { {t("CORE_OTP_RESEND")}
*/} - + {showToast && }
{ const [showToast, setShowToast] = useState(null); const getUserType = () => Digit.UserService.getType(); + const tenantId = Digit.ULBService.getCurrentTenantId(); + useEffect(() => { if (!user) { Digit.UserService.setType("employee"); @@ -26,22 +28,18 @@ const ForgotPassword = ({ config: propsConfig, t }) => { setShowToast(null); }; - const onForgotPassword = async (data) => { - if (!data.city) { - alert("Please Select City!"); - return; - } + const onForgotPassword = async (data) => { 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); @@ -58,13 +56,14 @@ const ForgotPassword = ({ config: propsConfig, t }) => { body: [ { label: t(userId.label), - type: userId.type, + type: "mobileNumber", populators: { name: userId.name, componentInFront: "+91", }, isMandatory: true, - } + }, + ], }, ]; @@ -77,7 +76,7 @@ const ForgotPassword = ({ config: propsConfig, t }) => {
- { className="employeeForgotPassword" >
- + {showToast && }
{ let config = [{ body: propsConfig?.inputs }]; + 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: 10, }; - } + } return isLoading || isStoreLoading ? ( ) : ( @@ -117,7 +118,7 @@ const Login = ({ config: propsConfig, t, isDisabled }) => {
- + ( {link && link?.includes("https") ? ( + label.includes("Dashboard")? + {label} + : {label} 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 = 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..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 @@ -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] } )); @@ -108,6 +107,15 @@ const MultiSelectDropdown = ({ } }, [active]); + useEffect(()=>{ + if (alreadyQueuedSelectedState?.length === filteredOptions?.length){ + setIsSelected(true) + }else{ + setIsSelected(false) + + } + },[alreadyQueuedSelectedState]) + function handleOutsideClickAndSubmitSimultaneously() { setActive(false); } 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..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 @@ -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 }; }); } } @@ -311,7 +311,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => {
); }; -// ------------------------------------------------------------------------------------- + function Jurisdiction({ t, formData, @@ -339,18 +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"); - - // 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]); + let defaultjurisdiction = () =>{ + let currentTenant = Digit.ULBService.getCurrentTenantId(); + let defaultjurisdiction; + Boundary?.map((ele)=>{ + if (ele.code === currentTenant){ + defaultjurisdiction = ele; + } + }) + return defaultjurisdiction; + } useEffect(() => { setDivision( @@ -361,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) { @@ -441,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))); @@ -463,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) => { @@ -595,7 +583,7 @@ function Jurisdiction({ -
+
0 && "50px", overflowY: "scroll" }}> {jurisdiction?.roles.length > 0 && jurisdiction?.roles.map((value, index) => { - return onRemove(index, value)} />; + return ( + onRemove(index, value)} /> + ) })}
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: { 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..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 @@ -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 || formData?.Jurisdictions.filter((juris) => juris?.divisionBoundary?.length).length > 0) && checkfield && phonecheck && checkMailNameNum(formData) 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 9686908db..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 @@ -64,4 +64,4 @@ MobileNumber.defaultProps = { isMandatory: false, }; -export default MobileNumber; +export default MobileNumber; \ No newline at end of file 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..23517fb30 --- /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/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 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..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 @@ -149,4 +149,4 @@ function getDDMMYYYY(date) { return new Date(date).toLocaleString("en-In").split(",")[0]; } -export default TextInput; +export default TextInput; \ 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..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 @@ -1741,6 +1741,15 @@ const WarningIcon =({ className = "", fill = "none", style = {} })=>( ) + +const PasswordEyeEnableSvg = ({ className, fill = "white", style = {} }) => ( + +); + +const PasswordEyeDisableSvg = ({ className, fill = "white", style = {} }) => ( + +); + const ExpenditureIcon = BillsIcon; export { @@ -1893,5 +1902,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 && ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js index a7638d7ef..4bd1330af 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js @@ -220,6 +220,7 @@ import WhatsNewCard from "./atoms/WhatsNewCard"; import EventCalendarView from "./atoms/EventCalendarView"; import InboxLinks from "./atoms/InboxLinks"; import PopupHeadingLabel from "./atoms/PopupHeadingLabel"; +import Password from "./atoms/Password"; import { FormComposer } from "./hoc/FormComposer"; import { FormComposer as FormComposerV2 } from "./hoc/FormComposerV2"; @@ -552,5 +553,6 @@ export { ExpenditureIcon, PaymentIcon, HistoryIcon, - WarningIcon + WarningIcon, + Password }; 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 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