Skip to content

Commit

Permalink
Develop Code sync up ( #788 )
Browse files Browse the repository at this point in the history
Develop Code sync up
  • Loading branch information
anilsingha-eGov authored May 7, 2024
2 parents 149382b + 9c606c8 commit 68241d7
Show file tree
Hide file tree
Showing 30 changed files with 2,049 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class _ChangePasswordState extends State<ChangePassword> {
passwordDetails.currentpasswordCtrl,
obscureText: true,
isRequired: true,
maxLength: 10,
maxLines: 1,
onChange: (value) => saveInput(value),
key: Keys.changePassword.CURRENT_PASSWORD_KEY,
Expand All @@ -94,6 +95,7 @@ class _ChangePasswordState extends State<ChangePassword> {
passwordDetails.newpasswordCtrl,
obscureText: true,
isRequired: true,
maxLength: 10,
maxLines: 1,
validator: (val) => Validators.passwordComparision(
val, ApplicationLocalizations.of(context).translate(i18.password.NEW_PASSWORD_ENTER)),
Expand All @@ -105,6 +107,7 @@ class _ChangePasswordState extends State<ChangePassword> {
passwordDetails.confirmpasswordCtrl,
obscureText: true,
isRequired: true,
maxLength: 10,
maxLines: 1,
validator: (val) => Validators.passwordComparision(
val,
Expand Down
3 changes: 3 additions & 0 deletions frontend/mgramseva/lib/utils/constants/i18_key_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 {
Expand Down
35 changes: 19 additions & 16 deletions frontend/mgramseva/lib/utils/role_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,55 +89,58 @@ 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 [
'GP_ADMIN',
'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 [];
}
Expand Down
17 changes: 17 additions & 0 deletions frontend/mgramseva/lib/widgets/password_hint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
])
],
)),
Expand Down
21 changes: 16 additions & 5 deletions frontend/micro-ui/web/micro-ui-internals/example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,30 @@
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
<script src="%REACT_APP_GLOBAL%"></script>
<style type="text/css">
#logo-img-container{
#logo-img-container {
display: none;
}
.selector-button-primary > h2{

.selector-button-primary>h2 {
margin: 0
}
.menu-wrap > div > p {

.menu-wrap>div>p {
margin: 0
}
.selector-button-primary-disabled > h2 {

.selector-button-primary-disabled>h2 {
margin: 0;
}
</style>

.employeeForgotPassword .employee-card-input {
margin-bottom: 24px !important;
border-left: none;
}
.workbench-bredcrumb {
display: none !important;
}
</style>
</head>

<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`,
Expand All @@ -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") || {};

Expand All @@ -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) => {
Expand All @@ -69,7 +76,6 @@ const ChangeCity = (prop) => {
setSelectCityData(filteredArray);
}, [dropDownData, data?.MdmsRes]);

// if (isDropdown) {
return (
<div style={prop?.mobileView ? { color: "#767676" } : {}}>
<Dropdown
Expand All @@ -79,35 +85,11 @@ const ChangeCity = (prop) => {
selected={dropDownData}
optionKey={"label"}
select={handleChangeCity}
// freeze={true}
// noBorder={true}
optionCardStyles={{ overflow: "revert", display: "table" }}
// customSelector={
// <label className="cp">
// {prop?.t(`TENANT_TENANTS_${stringReplaceAll(Digit.SessionStorage.get("Employee.tenantId"), ".", "_")?.toUpperCase()}`)}
// </label>
// }
/>
</div>
);
// } else {
// return (
// <React.Fragment>
// <div style={{ marginBottom: "5px" }}>City</div>
// <div className="language-selector" style={{display: "flex", flexWrap: "wrap"}}>
// {selectCityData?.map((city, index) => (
// <div className="language-button-container" key={index}>
// <CustomButton
// selected={city.value === Digit.SessionStorage.get("Employee.tenantId")}
// text={city.label}
// onClick={() => handleChangeCity(city)}
// ></CustomButton>
// </div>
// ))}
// </div>
// </React.Fragment>
// );
// }

};

export default ChangeCity;
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ const TopBar = ({
<p className="ulb" style={mobileView ? { fontSize: "14px", display: "inline-block" } : {}}>
{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)`}`}
</p>
) : (
<img className="state" src={logoUrl} />
<div style={{display:"flex"}}>
<img className="state" src={logoUrl} />
<p style={{margin:"0px 5px", fontWeight: "bold"}}>{` ${userDetails?.info?.roles.some(obj => obj.name === "STATE ADMIN")?`(${userDetails?.info?.name} | State User)`:`(${userDetails?.info?.name} | Division User)`}`} </p>
</div>
))}
{!loggedin && (
<p className="ulb" style={mobileView ? { fontSize: "14px", display: "inline-block" } : {}}>
Expand All @@ -120,7 +124,7 @@ const TopBar = ({
<div className={mobileView ? "right" : "flex-right right w-80 column-gap-15"} style={!loggedin ? { width: "80%" } : {}}>
<div className="left">
{!window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && (
<ChangeCity dropdown={true} t={t} />
<ChangeCity dropdown={true} t={t} userDetails={userDetails}/>
)}
</div>
<div className="left">{showLanguageChange && <ChangeLanguage dropdown={true} />}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const TopBarSideBar = ({
showLanguageChange={showLanguageChange}
/>
{showDialog && <LogoutDialog onSelect={handleOnSubmit} onCancel={handleOnCancel} onDismiss={handleOnCancel}></LogoutDialog>}
{/* {showSidebar && (
{showSidebar && (
<SideBar
t={t}
CITIZEN={CITIZEN}
Expand All @@ -69,7 +69,7 @@ const TopBarSideBar = ({
linkData={linkData}
islinkDataLoading={islinkDataLoading}
/>
)} */}
)}
</React.Fragment>
);
};
Expand Down
Loading

0 comments on commit 68241d7

Please sign in to comment.