Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #847 from egovernments/payment-module-develop
Browse files Browse the repository at this point in the history
Payment module :: Open Search
  • Loading branch information
pradeepkumarcm-egov authored Jul 5, 2024
2 parents 99d02c8 + 789ae7a commit 5c6cc42
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://mgramseva-uat.psegs.in
REACT_APP_PROXY_ASSETS=https://mgramseva-uat.psegs.in
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsMgramsewa.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@egovernments/digit-ui-libraries":"^1.4.0",
"@egovernments/digit-ui-module-common":"^1.4.0",
"@egovernments/digit-ui-module-engagement":"^1.4.0",
"@egovernments/digit-ui-module-payment":"0.0.2",
"@egovernments/digit-ui-module-payment":"0.0.13",
"@egovernments/digit-ui-module-fsm":"^1.4.0",
"@egovernments/digit-ui-module-mcollect":"^1.4.0",
"@egovernments/digit-ui-module-noc":"^1.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@egovernments/digit-ui-module-core": "1.5.46",
"@egovernments/digit-ui-module-hrms": "1.5.27",
"@egovernments/digit-ui-module-pgr": "1.7.0",
"@egovernments/digit-ui-module-payment":"0.0.8",
"@egovernments/digit-ui-module-payment":"0.0.13",
"@egovernments/digit-ui-module-engagement": "1.5.20",
"@egovernments/digit-ui-react-components": "1.5.26",
"http-proxy-middleware": "^1.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />


<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ import _ from "lodash";
var Digit = window.Digit || {};


function anonymizeHalfString(input) {
// Calculate the midpoint of the string
const midpoint = Math.ceil(input.length / 2);

// Replace the first 50% of the string with asterisks
const anonymized = "*".repeat(midpoint) + input.substring(midpoint);

return anonymized;
}

const businessServiceMap = {

Expand Down Expand Up @@ -443,7 +452,8 @@ export const UICustomizations = {
// consumerCode,
tenantId,
businessService,
textSearch:consumerCode
connectionNumber:consumerCode,
isOpenPaymentSearch:true
}
data.params = finalParams
// data.params.textSearch = finalParams.consumerCode
Expand Down Expand Up @@ -515,6 +525,10 @@ export const UICustomizations = {
return <div>
{ value ? t(Digit.Utils.locale.getTransformedLocale(`OP_PROPERTY_TYPE_${value}`)) : t("ES_COMMON_NA")}
</div>
case "OP_PAYER_NAME":
return <div>
{value ? anonymizeHalfString(value) : t("ES_COMMON_NA")}
</div>


default:
Expand Down Expand Up @@ -572,5 +586,18 @@ export const UICustomizations = {
},
};
},
customValidationCheck: (data) => {

//checking both to and from date are present
const { consumerCode } = data;
if(!consumerCode) return false;
if(consumerCode.length < 10 || consumerCode.length > 25){
return { warning: true, label: "ES_COMMON_ENTER_VALID_CONSUMER_CODE" };
}
// if ((createdFrom === "" && createdTo !== "") || (createdFrom !== "" && createdTo === ""))
// return { warning: true, label: "ES_COMMON_ENTER_DATE_RANGE" };

return false;
}
}
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.5.50",
"version": "1.5.52",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ const TopBar = ({
const urlsToDisableNotificationIcon = (pathname) =>
!!Digit.UserService?.getUser()?.access_token
? false
: [`/${window?.contextPath}/citizen/select-language`, `/${window?.contextPath}/citizen/select-location`].includes(pathname);

: [`/${window?.contextPath}/citizen/select-language`, `/${window?.contextPath}/citizen/select-location`,`/mgramseva-web/citizen/payment`].includes(pathname);
if (CITIZEN) {
return (
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-payment",
"version": "0.0.8",
"version": "0.0.13",
"description": "Open Payments",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand All @@ -18,7 +18,7 @@
"react-router-dom": "5.3.0"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.2-beta.4",
"@egovernments/digit-ui-react-components": "1.8.2-beta.9",
"@egovernments/digit-ui-components": "0.0.2-beta.1",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const OpenView = () => {

const requestCriteriaForConnectionSearch = {
url: "/ws-services/wc/_search?",
params: { ...queryParams, textSearch: queryParams.consumerCode },
params: { tenantId:queryParams.tenantId,businessService:queryParams.businessService, connectionNumber: queryParams.consumerCode,isOpenPaymentSearch:true },
body: {},
options: {
userService: false,
Expand Down Expand Up @@ -221,15 +221,15 @@ const OpenView = () => {
text={connection?.connectionHolders?.[0]?.name ? anonymizeHalfString(connection?.connectionHolders?.[0]?.name) : t("ES_COMMON_NA")}
rowContainerStyle={{ border: "none" }}
/>
<Row
{/* <Row
label={t("OP_CONSUMER_PHNO")}
text={
connection?.connectionHolders?.[0]?.mobileNumber
? anonymizeHalfString(connection?.connectionHolders?.[0]?.mobileNumber)
: t("ES_COMMON_NA")
}
rowContainerStyle={{ border: "none" }}
/>
/> */}
<Row
label={t("OP_CONNECTION_TYPE")}
text={
Expand All @@ -247,8 +247,8 @@ const OpenView = () => {
<Row
label={t("OP_APPLICATION_STATUS")}
text={
connection?.applicationStatus
? t(Digit.Utils.locale.getTransformedLocale(`OP_APPLICATION_STATUS_${connection?.applicationStatus}`))
connection?.status
? t(Digit.Utils.locale.getTransformedLocale(`OP_APPLICATION_STATUS_${connection?.status}`))
: t("ES_COMMON_NA")
}
rowContainerStyle={{ border: "none" }}
Expand All @@ -272,6 +272,7 @@ const OpenView = () => {
labelStyle={{ fontWeight: "bold" }}
textStyle={{ fontWeight: "bold" }}
text={t("ES_PAYMENT_AMOUNT")}
rowContainerStyle={{ border: "none" }}
/>
{/* <hr style={{ width: "40%" }} className="underline" /> */}
{bill?.billDetails?.[0]?.billAccountDetails
Expand All @@ -283,6 +284,7 @@ const OpenView = () => {
textStyle={{ textAlign: "right", maxWidth: "100px" }}
label={t(`TAX_HC_${amountDetails.taxHeadCode}`)}
text={"₹ " + amountDetails.amount?.toFixed(2)}
rowContainerStyle={{ border: "none" }}
/>
))}

Expand All @@ -292,6 +294,7 @@ const OpenView = () => {
textStyle={{ textAlign: "right", maxWidth: "100px" }}
label={t("COMMON_ARREARS")}
text={"₹ " + arrears?.toFixed?.(2) || Number(0).toFixed(2)}
rowContainerStyle={{ border: "none" }}
/>
) : null}

Expand All @@ -301,6 +304,7 @@ const OpenView = () => {
labelStyle={{ fontWeight: "bold" }}
textStyle={{ fontWeight: "bold", textAlign: "right", maxWidth: "100px" }}
text={"₹ " + Number(bill?.totalAmount).toFixed(2)}
rowContainerStyle={{ border: "none" }}
/>
</>
) : (
Expand Down Expand Up @@ -329,13 +333,14 @@ const OpenView = () => {
// labelStyle={{ fontWeight: "bold" }}
// textStyle={{ fontWeight: "bold" }}
text={payment?.transactionDate ? Digit.DateUtils.ConvertEpochToDate(payment?.transactionDate) : t("ES_COMMON_NA")}
rowContainerStyle={{ border: "none" }}
/>
<Row
{/* <Row
label={t("OP_TXN_NO")}
labelStyle={{ fontWeight: "bold" }}
textStyle={{ fontWeight: "bold" }}
text={payment?.transactionNumber ? payment?.transactionNumber : t("ES_COMMON_NA")}
/>
/> */}
</StatusTable>
</Card>
);
Expand All @@ -352,6 +357,7 @@ const OpenView = () => {
onClose={() => {
setShowToast(null);
}}
isDleteBtn={true}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const convertEpochToDate = (dateEpoch) => {
);
const { data: generatePdfKey } = Digit.Hooks.useCommonMDMS(newTenantId, "common-masters", "ReceiptKey", {
select: (data) =>
data["common-masters"]?.uiCommonPay?.filter(({ code }) => business_service?.includes(code))[0]?.receiptKey || "consolidatedreceipt",
data["common-masters"]?.uiCommonPay?.filter(({ code }) => business_service?.includes(code))[0]?.receiptKey || "ws-receipt",
retry: false,
staleTime: Infinity,
refetchOnWindowFocus: false,
Expand Down Expand Up @@ -673,6 +673,9 @@ export const convertEpochToDate = (dateEpoch) => {
{t("CS_DOWNLOAD_RECEIPT")}
</div>
) : null}
{business_service?.includes("WS") ? <Link to={`/mgramseva-web/citizen/payment/open-search?businessService=WS`}>
<SubmitBar style={{"marginTop":"1rem"}} label={t("CORE_COMMON_GO_TO_HOME")} />
</Link>:null}
{business_service?.includes("SW") ? (
<div className="link" style={isMobile ? { marginTop: "8px", width: "100%", textAlign: "center" } : { marginTop: "8px" }} onClick={printReciept}>
{t("CS_DOWNLOAD_RECEIPT")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,16 @@ export const OpenSearchConfig = {
"consumerCode": ""
},
"fields": [
{
"label": "CONNECTION_ID",
"type": "text",
"isMandatory": false,
"disable": false,
"populators": {
"name": "consumerCode",
"style":{
"marginBottom":"0px"
}
},
},
{
label: "SELECT_TENANT",
type: "apidropdown",
isMandatory: false,
disable: false,
populators: {
"optionsCustomStyle": {
"top": "2.3rem"
"top": "2.3rem",
"overflow":"auto",
"maxHeight":"400px"
},
name: "tenantId",
optionsKey: "updatedCode",
Expand All @@ -55,6 +45,22 @@ export const OpenSearchConfig = {
customfn: "populateReqCriteria",
},
},
{
"label": "CONNECTION_ID",
"type": "text",
"isMandatory": false,
"disable": false,
"populators": {
"name": "consumerCode",
"style":{
"marginBottom":"0px"
},
"placeholder":"WS/7141/2024-25/****",
// "validation":{
// "maxLength":"1"
// }
},
},
]
},
"label": "",
Expand All @@ -77,7 +83,7 @@ export const OpenSearchConfig = {
{
"label": "OP_PAYER_NAME",
"jsonPath": "connectionHolders[0].name",
// "additionalCustomization": true
"additionalCustomization": true
},
{
"label": "OP_APPLICATION_TYPE",
Expand Down Expand Up @@ -116,7 +122,7 @@ export const OpenSearchConfig = {
// },
{
"label": "OP_APPLICATION_STATUS",
"jsonPath": "applicationStatus",
"jsonPath": "status",
"additionalCustomization": true
},
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ import { Link, useHistory } from "react-router-dom";
import _ from "lodash";
import React from "react";

function anonymizeHalfString(input) {
// Calculate the midpoint of the string
const midpoint = Math.ceil(input.length / 2);

// Replace the first 50% of the string with asterisks
const anonymized = "*".repeat(midpoint) + input.substring(midpoint);

return anonymized;
}

export const UICustomizations = {
OpenPaymentSearch:{
preProcess: (data, additionalDetails) => {
Expand All @@ -21,7 +31,8 @@ export const UICustomizations = {
// consumerCode,
tenantId,
businessService,
textSearch:consumerCode
connectionNumber:consumerCode,
isOpenPaymentSearch:true
}
data.params = finalParams
// data.params.textSearch = finalParams.consumerCode
Expand Down Expand Up @@ -93,6 +104,10 @@ export const UICustomizations = {
return <div>
{ value ? t(Digit.Utils.locale.getTransformedLocale(`OP_PROPERTY_TYPE_${value}`)) : t("ES_COMMON_NA")}
</div>
case "OP_PAYER_NAME":
return <div>
{value ? anonymizeHalfString(value) : t("ES_COMMON_NA")}
</div>


default:
Expand Down Expand Up @@ -150,5 +165,18 @@ export const UICustomizations = {
},
};
},
customValidationCheck: (data) => {

//checking both to and from date are present
const { consumerCode } = data;
if(!consumerCode) return false;
if(consumerCode.length < 10 || consumerCode.length > 25){
return { warning: true, label: "ES_COMMON_ENTER_VALID_CONSUMER_CODE" };
}
// if ((createdFrom === "" && createdTo !== "") || (createdFrom !== "" && createdTo === ""))
// return { warning: true, label: "ES_COMMON_ENTER_DATE_RANGE" };

return false;
}
}
};
4 changes: 2 additions & 2 deletions frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"@egovernments/digit-ui-libraries": "1.5.7",
"@egovernments/digit-ui-module-dss": "1.5.34",
"@egovernments/digit-ui-module-core": "1.5.46",
"@egovernments/digit-ui-css": "1.5.50",
"@egovernments/digit-ui-css": "1.5.52",
"@egovernments/digit-ui-module-hrms": "1.5.27",
"@egovernments/digit-ui-module-pgr": "1.7.0",
"@egovernments/digit-ui-module-engagement": "1.5.20",
"@egovernments/digit-ui-module-payment":"0.0.8",
"@egovernments/digit-ui-module-payment":"0.0.13",
"@egovernments/digit-ui-react-components": "1.5.26",
"babel-loader": "8.1.0",
"clean-webpack-plugin": "4.0.0",
Expand Down
2 changes: 2 additions & 0 deletions frontend/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>mSeva</title>
Expand Down
Loading

0 comments on commit 5c6cc42

Please sign in to comment.