- {t("DSS_SHOW_MORE")} + {window.location.href.includes("fsm") ? "" : t("DSS_SHOW_MORE")}
)} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomTable.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomTable.js index 4bc820f921b..5d548808b42 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomTable.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomTable.js @@ -85,24 +85,26 @@ const CustomTable = ({ data = {}, onSearch, setChartData, setChartDenomination, } let prevData = lyData?.plots?.[currentIndex]?.value; let insight = null; - if (row?.name === "CapacityUtilization" && chartKey !== "fsmVehicleLogReportByVehicleNo") { - const { range } = value; - const { startDate, endDate } = range; - const numberOfDays = differenceInCalendarDays(endDate, startDate) + 1; - const ulbs = dssTenants - .filter((tenant) => tenant?.city?.ddrName === rows?.headerName || tenant?.code === rows?.headerName) - .map((tenant) => tenant?.code); - const totalCapacity = fstpMdmsData - ?.filter((plant) => ulbs.find((ulb) => plant?.ULBS?.includes(ulb))) - .reduce((acc, plant) => acc + Number(plant?.PlantOperationalCapacityKLD), 0); - cellValue = calculateFSTPCapacityUtilization(cellValue, totalCapacity, numberOfDays); - prevData = calculateFSTPCapacityUtilization(prevData, totalCapacity, numberOfDays); - } - if (row?.name === "CapacityUtilization" && chartKey === "fsmVehicleLogReportByVehicleNo") { - const tankCapcity = rows?.plots.find((plot) => plot?.name === "TankCapacity"); - cellValue = calculateFSTPCapacityUtilization(cellValue, tankCapcity?.value); - prevData = calculateFSTPCapacityUtilization(prevData, tankCapcity?.value); - } + //Commented since it was causing mismatch data for the Capacity FSM: SM-1282 + // if (row?.name === "CapacityUtilization" && chartKey !== "fsmVehicleLogReportByVehicleNo") { + // const { range } = value; + // const { startDate, endDate } = range; + // const numberOfDays = differenceInCalendarDays(endDate, startDate) + 1; + // const ulbs = dssTenants + // .filter((tenant) => tenant?.city?.ddrName === rows?.headerName || tenant?.code === rows?.headerName) + // .map((tenant) => tenant?.code); + // const totalCapacity = fstpMdmsData + // ?.filter((plant) => ulbs.find((ulb) => plant?.ULBS?.includes(ulb))) + // .reduce((acc, plant) => acc + Number(plant?.PlantOperationalCapacityKLD), 0); + // cellValue = calculateFSTPCapacityUtilization(cellValue, totalCapacity, numberOfDays); + // prevData = calculateFSTPCapacityUtilization(prevData, totalCapacity, numberOfDays); + // } + // if (row?.name === "CapacityUtilization" && chartKey === "fsmVehicleLogReportByVehicleNo") { + // const tankCapcity = rows?.plots.find((plot) => plot?.name === "TankCapacity"); + // cellValue = calculateFSTPCapacityUtilization(cellValue, tankCapcity?.value); + // prevData = calculateFSTPCapacityUtilization(prevData, tankCapcity?.value); + + // } if ( (row?.symbol === "number" || row?.symbol === "percentage" || row?.symbol === "amount") && row?.name !== "CitizenAverageRating" && @@ -448,6 +450,11 @@ else { )} )} + {filterStack?.length > 2 && data?.showOptionalInfo && ( + + {t(data?.optionalInfo)} + + )} {!tableColumns || !tableData ? (
// {`${monthNames[month-1]} ${year} ${day}`}
@@ -179,20 +179,20 @@ const displayResult = (ques,ans,type,resCount=0,t) => {
}
}
-const SurveyResultsView = ({surveyInfo,responsesInfoMutation}) => {
+const SurveyResultsView = ({surveyInfo,selecedSurveyresults}) => {
const { t } = useTranslation();
const [data,setData]=useState(null);
const [userInfo,setUserInfo] = useState({})
const tenant = Digit.ULBService.getCurrentTenantId();
useEffect( async() => {
- if(responsesInfoMutation.isSuccess){
- const dp = bindQuesWithAns(surveyInfo?.questions,responsesInfoMutation.data.answers)
+ if(selecedSurveyresults?.answers?.length){
+ const dp = bindQuesWithAns(surveyInfo?.questions,selecedSurveyresults.answers)
setData(dp)
- const ue = await getUserData(responsesInfoMutation.data.answers,tenant.split(".")[0])
+ const ue = await getUserData(selecedSurveyresults.answers,tenant.split(".")[0])
setUserInfo(ue);
}
- },[responsesInfoMutation])
+ },[selecedSurveyresults])
// const dp = bindQuesWithAns(surveyInfo?.questions,responsesInfoMutation.data.answers);
// setData(dp)
@@ -201,7 +201,7 @@ const SurveyResultsView = ({surveyInfo,responsesInfoMutation}) => {
const generateExcelObj = (ques,ans) => {
const countResponses = parseInt(ans.length/ques.length)
- const dp = bindQuesWithAns(surveyInfo?.questions, responsesInfoMutation.data.answers)
+ const dp = bindQuesWithAns(surveyInfo?.questions, selecedSurveyresults.answers)
const result = []
//now in a loop fill all the sampleObj (3 times) and use it to download report
@@ -232,11 +232,11 @@ const SurveyResultsView = ({surveyInfo,responsesInfoMutation}) => {
}
const handleReportDownload = () => {
- const result = generateExcelObj(surveyInfo?.questions, responsesInfoMutation.data.answers)
- return Digit.Download.Excel(result, responsesInfoMutation.data.title);
+ const result = generateExcelObj(surveyInfo?.questions, selecedSurveyresults.answers)
+ return Digit.Download.Excel(result, selecedSurveyresults.Service[0].referenceId);
}
- if(!data) return