Skip to content

Commit

Permalink
Merge pull request #950 from sriranjan-s/Dev-2.0
Browse files Browse the repository at this point in the history
adding packages for auto publishing
  • Loading branch information
sriranjan-s authored Feb 29, 2024
2 parents 3b60341 + 0b35c13 commit 2b2e85a
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@upyog/digit-ui-module-pt":"1.7.0-beta.3",
"@egovernments/digit-ui-module-receipts":"^1.4.0",
"@upyog/digit-ui-module-tl":"1.7.0-beta.6",
"@upyog/digit-ui-module-ws":"^1.7.0-beta.8",
"@upyog/digit-ui-module-ws":"^1.7.0-beta.9",
"@upyog-niua/upyog-ui-module-ptr":"1.0.5",
"@egovernments/digit-ui-module-commonpt":"^1.4.0",
"http-proxy-middleware": "^1.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@upyog/digit-ui-module-pt": "^1.7.0-beta.3",
"@egovernments/digit-ui-module-receipts": "^1.7.0-beta.2",
"@upyog/digit-ui-module-tl": "^1.7.0-beta.6",
"@upyog/digit-ui-module-ws": "^1.7.0-beta.8",
"@upyog/digit-ui-module-ws": "^1.7.0-beta.9",
"@egovernments/digit-ui-module-bills": "^1.7.0-beta.2",
"@egovernments/digit-ui-module-commonpt": "^1.7.0-beta.3",
"@upyog-niua/upyog-ui-module-ptr":"1.0.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-ws",
"version": "1.7.0-beta.8",
"version": "1.7.0-beta.9",
"description": "",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import * as XLSX from "xlsx";
const BulkBillSearch = ({ tenantId, onSubmit, data, count, resultOk, businessService, isLoading }) => {
const [showToast, setShowToast] = useState(null);
const [showModal, setModalReject] = useState(null);
const [showModalResult, setShowModalResult] = useState(null)
const [uploadedFile, setUploadedFile] = useState(() => null);
const [file, setFile] = useState("")
const [meterReadingData, setMeterReadingData] = useState([])
const [rejectedReading, setRejectedReading] = useState([])
const [bulkReadingStatus, setBulkReadingStatus] = useState([])
const [isLoadingBulkMeterReading, setIsLoadingBulkMeterReading] =useState(false)
function selectfile(e) {
e.preventDefault()
Expand Down Expand Up @@ -92,11 +94,14 @@ const BulkBillSearch = ({ tenantId, onSubmit, data, count, resultOk, businessSer
},
onSuccess: async (data, variables) => {
setIsLoadingBulkMeterReading(false)
console.log("data",data)
setShowModalResult(true)
setBulkReadingStatus(data.meterReadings)
setShowToast({ key: "success", label: "WS_METER_READING_ADDED_SUCCESFULLY" });
setTimeout(closeToast, 3000);
setTimeout(() => {
window.location.reload();
}, 5000);
// setTimeout(() => {
// window.location.reload();
// }, 5000);
},
});
}
Expand All @@ -116,6 +121,9 @@ const BulkBillSearch = ({ tenantId, onSubmit, data, count, resultOk, businessSer
const closeModal = () => {
setModalReject(false)
}
const closeModalStatus = () => {
setShowModalResult(false)
}
const setModal = () => {
setModalReject(false)
handleBulkSubmit()
Expand Down Expand Up @@ -278,6 +286,86 @@ const BulkBillSearch = ({ tenantId, onSubmit, data, count, resultOk, businessSer

],
);
const columns2 = useMemo(
() => [

{
Header: t("BILLING_CYCLE"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(row.original?.["billingPeriod"]);
},
},
{
Header: t("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),
disableSortBy: true,
accessor: "connectionNo",
Cell: ({ row }) => {
return (
<div>
{row.original["connectionNo"] ? (
<span>
{row.original["connectionNo"] || "NA"}

</span>
) : (
<span>{t("NA")}</span>
)}
</div>
);
},
},
{
Header: t("LAST_READING"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(row.original?.["lastReading"]);
},

},
{
Header: t("METER_READING_DATE"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(convertEpochToDate(row.original?.["lastReadingDate"]));
},

},
{
Header: t("METER_STATUS"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(row.original?.["meterStatus"]);
},

},
{
Header: t("CURRECT_READING"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(row.original?.["currentReading"]);
},

},
{
Header: t("CURRECT_READING_DATE"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(convertEpochToDate(row.original?.["currentReadingDate"]));
},

},
{
Header: t("CURRECT_STATUS"),
disableSortBy: true,
Cell: ({ row }) => {
return GetCell(row.original?.["status"]);
},

}

],
);
return (
<>
<Header styles={{ fontSize: "32px" }}>
Expand Down Expand Up @@ -389,6 +477,48 @@ const BulkBillSearch = ({ tenantId, onSubmit, data, count, resultOk, businessSer
/>


</Card>
</div>
</Modal>}
{showModalResult && <Modal
headerBarMain={<Heading label={t("WS_BULK_READING_STATUS")} />}
headerBarEnd={<CloseBtn onClick={closeModalStatus} />}
formId="modal-action"
popupStyles={{ width: "auto" }}
> <div style={{ width: "100%" }}>

<Card>
<div><CardText>{t("Bulk Meter Reading Status")}</CardText></div>
<div className="sideContent" style={{ float: "right", padding: "10px 30px" }}>
<span className="table-search-wrapper" style={{ cursor: "pointer" }}>
<DownloadBtn className="mrlg cursorPointer" onClick={(e) => handleExcelDownload(e, bulkReadingStatus)} />
</span>
</div>
<Table
t={t}
data={bulkReadingStatus}
totalRecords={bulkReadingStatus?.length}
columns={columns2}
getCellProps={(cellInfo) => {
return {
style: {
minWidth: cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") ? "240px" : "",
padding: "20px 18px",
fontSize: "16px",
},
};
}}
onPageSizeChange={onPageSizeChange}
currentPage={getValues("offset") / getValues("limit")}
onNextPage={nextPage}
onPrevPage={previousPage}
pageSizeLimit={getValues("limit")}
onSort={onSort}
disableSort={true}
sortParams={[{ id: getValues("sortBy"), desc: getValues("sortOrder") === "DESC" ? true : false }]}
/>


</Card>
</div>
</Modal>}
Expand Down
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@upyog/digit-ui-module-pt": "1.7.0-beta.3",
"@egovernments/digit-ui-module-receipts": "1.7.0-beta.2",
"@upyog/digit-ui-module-tl": "1.7.0-beta.6",
"@upyog/digit-ui-module-ws": "1.7.0-beta.8",
"@upyog/digit-ui-module-ws": "1.7.0-beta.9",
"@egovernments/digit-ui-react-components": "1.7.0-beta.2",
"@upyog-niua/upyog-ui-module-ptr": "1.0.5",
"babel-loader": "8.1.0",
Expand Down

0 comments on commit 2b2e85a

Please sign in to comment.