Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo issue fixes #1797

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const PopInboxTable = ({ ...props }) => {
title={t(`${row.boundaryCode}`)}
variation="link"
size={"medium"}
style={{}}
style={{ minWidth: "unset" }}
/>
),
// selector:(row, index)=>row.boundaryCode,
Expand All @@ -48,7 +48,7 @@ const PopInboxTable = ({ ...props }) => {
if (boundaryCodeA > boundaryCodeB) return 1;
return 0;
},
width: "180px"
width: "180px",
},
...(
(props?.censusData?.[0]?.additionalFields || [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ const EditVillagePopulationPopUp = ({ onClose, census, onSuccess }) => {
}));
};

const nonEditableFields = census.additionalFields.filter(field => !field.editable);
const editableFields = census.additionalFields.filter(field => field.editable);
const nonEditableFields = census.additionalFields
.filter(field => !field.editable)
.sort((a, b) => a.order - b.order);

const editableFields = census.additionalFields
.filter(field => field.editable)
.sort((a, b) => a.order - b.order);


return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ const TimelinePopUpWrapper = ({ onClose, businessId, heading }) => {
label: t(instance?.action),
variant: 'completed',
subElements: [Digit.Utils.microplanv1.epochToDateTime(instance?.auditDetails?.lastModifiedTime),
instance?.assignes?.length > 0
? `${instance.assignes[0]?.name} - ${instance.assignes[0]?.roles?.[0]?.name || 'NA'}`
: 'NA',
t(`${instance.comment}`)
instance?.assignes?.length > 0 &&
`${instance.assignes[0]?.name} - ${instance.assignes[0]?.roles?.[0]?.name || 'NA'}`,
instance.comment && t(`${instance.comment}`)
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
],
showConnector: true
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,23 @@ const VillageView = () => {
variation="secondary"
/>}
</div>
{Object.entries(data?.additionalFields || []).map(([key, fieldData]) => (
<React.Fragment key={fieldData.id || key}>
<ViewCardFieldPair
className=""
inline
label={t(`HCM_MICROPLAN_${fieldData.key || key}_LABEL`)}
style={{}}
value={fieldData.value || t("ES_COMMON_NA")}
/>
{/* Only show the divider if it's not the last item */}
{key !== Object.keys(data?.additionalFields).slice(-1)[0] && (
<Divider className="" variant="small" />
)}
</React.Fragment>
))}
{Object.values(data?.additionalFields || [])
.sort((a, b) => a.order - b.order)
.map((fieldData, index, array) => (
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
<React.Fragment key={fieldData.id || index}>
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
<ViewCardFieldPair
className=""
inline
label={t(`HCM_MICROPLAN_${fieldData.key}_LABEL`)}
style={{}}
value={fieldData.value || t("ES_COMMON_NA")}
/>
{/* Only show the divider if it's not the last item */}
{index !== array.length - 1 && (
<Divider className="" variant="small" />
)}
rachana-egov marked this conversation as resolved.
Show resolved Hide resolved
</React.Fragment>
))}
</Card>

{showEditVillagePopulationPopup && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,11 @@ function epochToDateTime(epoch) {
// Create a new Date object using the epoch time
const date = new Date(epoch);


const year = date.getFullYear();

const month = String(date.getMonth() + 1).padStart(2, "0"); // Months are 0-based, so add 1
const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
const month = monthNames[date.getMonth()]; // Get month name
const day = String(date.getDate()).padStart(2, "0");


// Extract time components
let hours = date.getHours();
const minutes = String(date.getMinutes()).padStart(2, "0");
Expand All @@ -459,7 +457,7 @@ function epochToDateTime(epoch) {
const formattedHours = String(hours).padStart(2, "0");

// Format date and time as "DD MMM YYYY, HH:MM AM/PM"
const formattedDateTime = `${day} ${month} ${year} ${formattedHours}:${minutes} ${ampm}`;
const formattedDateTime = `${day} ${month} ${year}, ${formattedHours}:${minutes} ${ampm}`;

// Return the formatted date and time
return formattedDateTime;
Expand Down