Skip to content

Commit

Permalink
Merge pull request upyog#1408 from sriranjan-s/master
Browse files Browse the repository at this point in the history
UI build fix
  • Loading branch information
upyog-central-git authored Sep 27, 2024
2 parents ed8c112 + 2a2b990 commit c838f49
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 53 deletions.
6 changes: 3 additions & 3 deletions frontend/micro-ui/web/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ FROM upyogio/alpine-node-builder-14:yarn AS build
RUN apk update && apk upgrade
RUN apk add --no-cache git>2.30.0
RUN yarn add @upyog/digit-ui-libraries
RUN yarn add @upyog/digit-ui-module-pt
RUN yarn add @upyog/digit-ui-module-fsm
RUN yarn add @upyog/digit-ui-module-pt
RUN yarn add @upyog/digit-ui-module-tl
RUN yarn add @upyog/digit-ui-module-obps
RUN yarn add @upyog/digit-ui-module-ws
RUN yarn add @upyog/digit-ui-module-dss
RUN yarn add @upyog/digit-ui-module-mcollect
RUN yarn add @upyog/digit-ui-module-pgr
RUN yarn add @upyog/digit-ui-module-noc
RUN yarn add @upyog/digit-ui-module-engagement
RUN yarn add @upyog/digit-ui-module-hrms
RUN yarn add @upyog/digit-ui-module-core
RUN yarn add @upyog/digit-ui-module-obps
RUN yarn add @upyog/digit-ui-module-common
RUN yarn add @upyog/digit-ui-module-ws
RUN yarn add @upyog/digit-ui-module-commonpt
RUN yarn add @upyog/digit-ui-module-bills

Expand Down
12 changes: 6 additions & 6 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
},
"devDependencies": {
"@upyog/digit-ui-module-bills": "1.8.0",
"@upyog/digit-ui-module-common": "1.8.0",
"@upyog/digit-ui-module-common": "1.8.1",
"@upyog/digit-ui-module-engagement": "1.8.0",
"@upyog/digit-ui-module-fsm": "1.8.4",
"@upyog/digit-ui-module-mcollect": "1.8.0",
"@upyog/digit-ui-module-noc": "1.8.0",
"@upyog/digit-ui-module-obps": "1.8.3",
"@upyog/digit-ui-module-obps": "1.8.4",
"@upyog/digit-ui-module-pgr": "1.8.0",
"@upyog/digit-ui-module-pt": "1.8.5",
"@upyog/digit-ui-module-pt": "1.8.9",
"@upyog/digit-ui-module-receipts": "1.8.0",
"@upyog/digit-ui-module-tl": "1.8.3",
"@upyog/digit-ui-module-ws": "1.8.5",
"@upyog/digit-ui-module-ws": "1.8.9",
"@upyog/digit-ui-module-commonpt": "1.8.0",
"http-proxy-middleware": "^1.0.5",
"http-proxy-middleware": "1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-i18next": "11.16.2",
"react-router-dom": "5.3.0",
"react-scripts": "^4.0.1"
"react-scripts": "4.0.1"
},
"browserslist": [
">0.2%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@egovernments/digit-ui.css": "link:.."
},
"devDependencies": {
"http-server": "^0.12.3"
"http-server": "0.12.3"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog-niua/upyog-css",
"version": "1.8.1",
"version": "1.8.11",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down Expand Up @@ -45,7 +45,7 @@
"postcss-prefixer": "2.1.3",
"postcss-preset-env": "6.7.1",
"postcss-scss": "3.0.5",
"sass": "^1.26.11"
"sass": "1.26.11"
},
"files": [
"dist/index.min.css",
Expand All @@ -62,4 +62,4 @@
"digit-ui",
"css"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-common",
"version": "1.8.0",
"version": "1.8.1",
"license": "MIT",
"description": "Digit Common Payment Module",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const convertEpochToDate = (dateEpoch) => {
let assessmentYear="",assessmentYearForReceipt="";
let count=0;
let toDate,fromDate;
if(payments.Payments[0].paymentDetails[0].businessService=="PT"){
if(payments?.Payments?.[0]?.paymentDetails?.[0].businessService=="PT" || payments?.Payments?.[0].paymentDetails[0].businessService=="PT.MUTATION"){

payments.Payments[0].paymentDetails[0].bill.billDetails.map(element => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import ErrorComponent from "./ErrorComponent";

const Redircter = () => {
console.log("Redircter")
const path = Digit.UserService.getType() === "employee" ? "/digit-ui/employee/user/error" : "/digit-ui/citizen/error";
if (
window.location.href.includes("employee/user/error") ||
Expand All @@ -22,12 +23,14 @@ class ErrorBoundary extends React.Component {
}

static getDerivedStateFromError(error) {
console.log("getDerivedStateFromError",error)
// Update state so the next render will show the fallback UI.
return { error: error?.message, hasError: true, errorStack: error?.stack };
}

componentDidCatch(error, errorInfo) {
// Catch errors in any components below and re-render with error message
console.log("componentDidCatch",error)
this.setState({ error: error?.message, hasError: true, errorStack: error?.stack });
// You can also log error messages to an error reporting service here
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-dss",
"version": "1.8.2",
"version": "1.8.9",
"license": "MIT",
"description": "Digit Dashboard Module",
"main": "dist/index.js",
Expand Down Expand Up @@ -33,6 +33,6 @@
"react-simple-maps": "2.0.0",
"react-time-picker": "4.2.1",
"react-tooltip": "4.1.2",
"recharts": "^2.0.9"
"recharts": "2.0.9"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,28 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination,
addlFilter: filterStack[filterStack.length - 1]?.addlFilter,
moduleLevel: value?.moduleLevel || moduleCode,
});
const addMissingFinancialYears = (data) => {
// Get the current year and calculate the last three financial years dynamically
const currentYear = new Date().getFullYear();
const lastThreeYears = [
`${currentYear - 1}-${currentYear}`, // 2023-2024
`${currentYear - 2}-${currentYear - 1}`, // 2022-2023
`${currentYear}-${currentYear + 1}` // 2024-2025
];

// Iterate over the data array
data.forEach(item => {
lastThreeYears.forEach(year => {
// Check if the year is missing in the object, if so, add it with value 0
if (!item[year]) {
item[year] = 0;
}
});
});

return data;
};

useEffect(() => {
const { id } = data;
setChartKey(id);
Expand All @@ -85,7 +107,6 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination,
}
let prevData = lyData?.plots?.[currentIndex]?.value;
let insight = null;
console.log("cellValuecellValue",cellValue)
//Commented since it was causing mismatch data for the Capacity FSM: SM-1282
// if (row?.name === "CapacityUtilization" && chartKey !== "fsmVehicleLogReportByVehicleNo") {
// const { range } = value;
Expand All @@ -106,7 +127,6 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination,
// prevData = calculateFSTPCapacityUtilization(prevData, tankCapcity?.value);

// }
console.log("ddddddddd",row)
if (
(row?.symbol === "number" || row?.symbol === "percentage" || row?.symbol === "amount") &&
row?.name !== "CitizenAverageRating" &&
Expand All @@ -130,26 +150,8 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination,
}, {});
});
}, [response, lastYearResponse]);
function addMissingFinancialYears(data) {
// Get the current year and calculate the last three financial years dynamically
const currentYear = new Date().getFullYear();
const lastThreeYears = [
`${currentYear - 1}-${currentYear}`, // 2023-2024
`${currentYear - 2}-${currentYear - 1}`, // 2022-2023
`${currentYear }-${currentYear + 1}` // 2021-2022
];
// Iterate over the data array
data.forEach(item => {
lastThreeYears.forEach(year => {
// Check if the year is missing in the object, if so, add it with value 0
if (!item[year]) {
item[year] = 0;
}
});
});


return data;
}
useEffect(() => {
if (tableData) {
if(window.location.href.includes("national-propertytax") && tableData?.[0]?.State =="Jharkhand")
Expand Down Expand Up @@ -185,6 +187,7 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination,
}
}, [tableData]);


const filterValue = useCallback((rows, id, filterValue = "") => {
return rows.filter((row) => {
const res = Object.keys(row?.values).find((key) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-obps",
"version": "1.8.3",
"version": "1.8.4",
"description": "",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand All @@ -26,7 +26,7 @@
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0",
"uuid": "^9.0.1"
"uuid": "9.0.1"
},
"author": "",
"license": "MIT"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-pt",
"version": "1.8.5",
"version": "1.8.9",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@upyog/digit-ui-module-ws",
"version": "1.8.5",
"version": "1.8.9",
"description": "",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand All @@ -26,7 +26,7 @@
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0",
"xlsx": "^0.18.5"
"xlsx": "0.17.5"
},
"author": "",
"license": "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const WSRoadCuttingDetails = ({ config, onSelect, userType, formData, setError,
const isEditScreen = pathname.includes("/modify-application/" )

const stateCode = Digit.ULBService.getStateId();
const { isMdmsLoading, data: mdmsData } = Digit.Hooks.ws.useMDMS(stateCode, "sw-services-calculation", ["RoadType"]);
const { isMdmsLoading, data: mdmsData } = Digit.Hooks.ws.useMDMS(stateCode, window.location.href.includes("sewerage")?"sw-services-calculation":"ws-services-calculation", ["RoadType"]);

const [roadCuttingDetails, setRoadCuttingDetails] = useState(formData?.roadCuttingDetails || [createRoadCuttingDetails()]);
const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" });
Expand Down Expand Up @@ -94,7 +94,7 @@ const RoadCuttForm = (_props) => {
const { errors } = localFormState;

const roadCuttingTypeMenu = useMemo(() => {
const RoadTypes = mdmsData?.["sw-services-calculation"]?.RoadType || [];
const RoadTypes = window.location.href.includes("sewerage")?mdmsData?.["sw-services-calculation"]?.RoadType : mdmsData?.["ws-services-calculation"]?.RoadType || [];
const filteredRoadTypes = RoadTypes.filter(data => data?.isActive === true); // Filter out road types with isActive: true
filteredRoadTypes.forEach(data => data.i18nKey = `WS_ROADTYPE_${stringReplaceAll(data?.code?.toUpperCase(), " ", "_")}`);
return filteredRoadTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,4 +757,4 @@ let serviceType = data && data?.WaterConnection?.[0] ? "WATER" : "SEWERAGE";
);
};

export default WSApplicationDetails;
export default WSApplicationDetails;
12 changes: 6 additions & 6 deletions frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@
"@upyog-niua/upyog-css": "1.0.10",
"@upyog/digit-ui-libraries": "1.8.0",
"@upyog/digit-ui-module-bills": "1.8.0",
"@upyog/digit-ui-module-common": "1.8.0",
"@upyog/digit-ui-module-common": "1.8.1",
"@upyog/digit-ui-module-core": "1.8.0",
"@upyog/digit-ui-module-engagement": "1.8.0",
"@upyog/digit-ui-module-dss": "1.8.2",
"@upyog/digit-ui-module-dss": "1.8.9",
"@upyog/digit-ui-module-fsm": "1.8.4",
"@upyog/digit-ui-module-hrms": "1.8.0",
"@upyog/digit-ui-module-mcollect": "1.8.0",
"@upyog/digit-ui-module-commonpt":"1.8.0",
"@upyog/digit-ui-module-obps": "1.8.3",
"@upyog/digit-ui-module-obps": "1.8.4",
"@upyog/digit-ui-module-noc": "1.8.0",
"@upyog/digit-ui-module-pgr": "1.8.0",
"@upyog/digit-ui-module-pt": "1.8.5",
"@upyog/digit-ui-module-pt": "1.8.9",
"@upyog/digit-ui-module-receipts": "1.8.0",
"@upyog/digit-ui-module-tl": "1.8.3",
"@upyog/digit-ui-module-ws": "1.8.5",
"@upyog/digit-ui-module-ws": "1.8.9",
"@upyog/digit-ui-react-components": "1.8.0",
"babel-loader": "8.1.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-router-dom": "5.3.0",
"react-scripts": "4.0.1",
"web-vitals": "1.1.2",
"terser-brunch": "^4.1.0"
"terser-brunch": "4.1.0"
},
"devDependencies": {
"http-proxy-middleware": "1.3.1"
Expand Down
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/browser-icon.png">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" rel='stylesheet' type='text/css'>
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css"/> -->
<link rel="stylesheet" href="https://unpkg.com/@upyog-niua/[email protected].1/dist/index.css"/>
<link rel="stylesheet" href="https://unpkg.com/@upyog-niua/[email protected].11/dist/index.css"/>
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="#00bcd1"/>
Expand Down

0 comments on commit c838f49

Please sign in to comment.