Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
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 @@ -12,7 +12,7 @@
<title>DIGIT</title>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.9.0/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.2.3/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.3.19/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.3.20/dist/index.css" />
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.51/dist/index.css" /> -->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.2.0/dist/index.css" /> -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1768,15 +1768,23 @@ export const UICustomizations = {
return value ? <span>{t(`${value}`)}</span> : <span>{t("NA")}</span>;

case "CS_COMPLAINT_DETAILS_CURRENT_STATUS":
return value && value?.length>0
? <span>{t(`WF_INBOX_${value}`)}</span>: <span>{t("NA")}</span>;
return value && value?.length > 0 ? <span>{t(`WF_INBOX_${value}`)}</span> : <span>{t("NA")}</span>;

case "WF_INBOX_HEADER_CURRENT_OWNER":
return value ? <span>{value}</span> : <span>{t("NA")}</span>;
return <span>{value?.assignes?.[0]?.name || t("NA")}</span>; // simplified and tightened

case "WF_INBOX_HEADER_CREATED_DATE":
const dateLabel = value ? Digit.DateUtils.ConvertEpochToDate(value) : "NA";
return <Tag label={t(dateLabel)} showIcon={false} type={value ? "success" : "error"} />;
if (!value || value <= 0) {
return <Tag label={t("ES_COMMON_NA")} showIcon={false} type="error" />;
}
const createdDate = new Date(value);
const createdDay = createdDate.getDate();
const createdMonthKeys = ["JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"];
const createdMonth = t(`PGR_INBOX_${createdMonthKeys[createdDate.getMonth()]}`);
const createdYear = createdDate.getFullYear().toString().slice(-2);
const createdDateLabel = `${createdDay} ${createdMonth} ${createdYear}`;
return <Tag label={createdDateLabel} showIcon={false} type="success" />;

default:
return t("ES_COMMON_NA");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
"version": "0.3.19",
"version": "0.3.20",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <jagan.kumar@egov.org.in>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1382,4 +1382,19 @@ tbody {
margin-top: 0.5rem;
margin-bottom: 0;
}
}

.selector-button-border{
display: flex;
align-items: center;
justify-content: center;
}

.tag-container .tag .text {
cursor: default;
}
}

.pgr-inbox-wrapper .digit-inbox-search-links-header {
position: relative;
right: 2.3rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ const UploadedFileComponent = ({ config, onSelect }) => {
const user = Digit.UserService.getUser();
const timestamp = new Date().getTime();

// Fetch max file size from MDMS v2
const { isLoading: isMaxFileSizeLoading, data: maxFileSizeData } = Digit.Hooks.useCustomMDMS(
tenantId,
"PGR",
[{ name: "MaxFileSize" }],
{
select: (data) => {
// Extract maxFileSize from MDMS v2 response
const maxFileSize = data?.PGR?.MaxFileSize?.[0]?.maxFileSize;
return maxFileSize ? parseInt(maxFileSize) : 5242880; // Default to 5MB if not found
},
},
{
schemaCode: "PGR.MaxFileSize",
limit: 10,
offset: 0
}
);

const maxFileSize = maxFileSizeData || 5242880; // Default to 5MB (5242880 bytes)
const maxFileSizeMB = (maxFileSize / 1048576).toFixed(0); // Convert bytes to MB for display

useEffect(() => {
(async () => {
setError(null);
Expand All @@ -25,8 +47,8 @@ const UploadedFileComponent = ({ config, onSelect }) => {
return;
}

if (file.size >= 5242880) {
setError(`${t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")} (${t("MAX_FILE_SIZE")}: 5 MB)`);
if (file.size >= maxFileSize) {
setError(`${t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")} (${t("MAX_FILE_SIZE")}: ${maxFileSizeMB} MB)`);
} else {
try {
// Convert JPEG/JPG to PDF before uploading
Expand Down Expand Up @@ -61,7 +83,7 @@ const UploadedFileComponent = ({ config, onSelect }) => {
}
}
})();
}, [file]);
}, [file, maxFileSize]);

function selectFile(e) {
setFile(e.target.files[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export const CreateComplaintConfig = {
disable: false,
populators: {
name: "ComplainantName",
error: "CORE_COMMON_REQUIRED_ERRMSG",
error: "CORE_COMMON_APPLICANT_NAME_INVALID",
validation: {
required: true,
pattern: /^[A-Za-z0-9-_]+$/i,
error: "CORE_COMMON_REQUIRED_ERRMSG"
pattern: /^[A-Za-z0-9\s\-_]+$/i,
error: "CORE_COMMON_APPLICANT_NAME_INVALID"
}
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const PGRSearchInboxConfig = () => {
minReqFields: 1,
defaultValues: {
complaintNumber: "",
mobileNumber: ""
mobileNumber: "",
range: ""
},
fields: [
{
Expand Down Expand Up @@ -106,7 +107,7 @@ const PGRSearchInboxConfig = () => {
},
{
label: "WF_INBOX_HEADER_CURRENT_OWNER",
jsonPath: "ProcessInstance.assigner.name",
jsonPath: "ProcessInstance",
additionalCustomization: true,
key: "assignee",
},
Expand Down Expand Up @@ -134,11 +135,7 @@ const PGRSearchInboxConfig = () => {
hyperlink: true,
},
],
label: "CS_COMMON_HOME_COMPLAINTS",
logoIcon: {
component: "ReceiptInboxIcon",
customClass: "inbox-search-icon--projects"
}
label: "CS_COMMON_HOME_COMPLAINTS"
},
children: {},
show: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,23 @@ export const UICustomizations = {
return value ? <span>{t(`${value}`)}</span> : <span>{t("NA")}</span>;

case "CS_COMPLAINT_DETAILS_CURRENT_STATUS":
return value && value?.length>0
? <span>{t(`WF_INBOX_${value}`)}</span>: <span>{t("NA")}</span>;
return value && value?.length > 0 ? <span>{t(`WF_INBOX_${value}`)}</span> : <span>{t("NA")}</span>;

case "WF_INBOX_HEADER_CURRENT_OWNER":
return value ? <span>{value}</span> : <span>{t("NA")}</span>;
return <span>{value?.assignes?.[0]?.name || t("NA")}</span>; // simplified and tightened

case "WF_INBOX_HEADER_CREATED_DATE":
const dateLabel = Number.isFinite(value) && value > 0 ? new Date(value).toLocaleDateString() : t("ES_COMMON_NA");
return <Tag label={dateLabel} showIcon={false} type={dateLabel === t("ES_COMMON_NA") ? "error" : "success"} />;
if (!value || value <= 0) {
return <Tag label={t("ES_COMMON_NA")} showIcon={false} type="error" />;
}
const createdDate = new Date(value);
const createdDay = createdDate.getDate();
const createdMonthKeys = ["JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"];
const createdMonth = t(`PGR_INBOX_${createdMonthKeys[createdDate.getMonth()]}`);
const createdYear = createdDate.getFullYear().toString().slice(-2);
const createdDateLabel = `${createdDay} ${createdMonth} ${createdYear}`;
return <Tag label={createdDateLabel} showIcon={false} type="success" />;

default:
return t("ES_COMMON_NA");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ const CreateComplaintForm = ({

const user = Digit.UserService.getUser();

// Get state tenant ID for localization
const stateTenantId = Digit.ULBService.getStateId();

// Get current language for localization
const language = Digit.StoreData.getCurrentLanguage();

// Get selected hierarchy from session storage
const [selectedHierarchy, setSelectedHierarchy] = useState(
Digit.SessionStorage.get("HIERARCHY_TYPE_SELECTED") || null
);

// Construct module code for localization fetch
const moduleCode = selectedHierarchy
? [`boundary-${selectedHierarchy?.hierarchyType?.toLowerCase()}`]
: [];

// Fetch localization data for the selected hierarchy
// This loads boundary localizations from the module: hcm-boundary-{hierarchyType}
const { isLoading: isLocalizationLoading } = Digit.Services.useStore({
stateCode: stateTenantId,
moduleCode,
language,
modulePrefix: "hcm",
config: { enabled: !!selectedHierarchy && moduleCode.length > 0 },
});

// Hook for creating a complaint
const { mutate: CreateComplaintMutation } = Digit.Hooks.pgr.useCreateComplaint(tenantId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ const PGRDetails = () => {
}
}, [toast?.show]);

// Reload assignment_status when modal closes
useEffect(() => {
if (!openModal) {
pgrSearchRevalidate();
}
}, [openModal]);

const handleToastClose = () => {
setToast({ show: false, label: "", type: "" });
};
Expand Down Expand Up @@ -325,6 +332,7 @@ const PGRDetails = () => {
// Display loader until required data loads
if (isLoading || isMDMSLoading || isWorkflowLoading) return <Loader />;


return (
<React.Fragment>
{/* Header */}
Expand Down Expand Up @@ -368,8 +376,8 @@ const PGRDetails = () => {
{
inline: true,
label: t("CS_COMPLAINT_DETAILS_CURRENT_STATUS"),
value: pgrData?.ServiceWrappers?.[0]?.workflow?.assignes?.length > 0
? t("WF_INBOX_ASSIGNED") : t("WF_INBOX_PENDING_ASSIGNMENT")
value: pgrData?.ServiceWrappers?.[0]?.service?.applicationStatus
? t(`WF_INBOX_${pgrData?.ServiceWrappers?.[0]?.service?.applicationStatus}`) : t("WF_INBOX_PENDING_ASSIGNMENT")
},
{
inline: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const PGRSearchInbox = () => {
{
<HeaderComponent
className="digit-inbox-search-composer-header"
styles={{ marginBottom: "1.5rem" }}
styles={{ marginBottom: "1.5rem",position:"relative",right:"0.5rem" }}
>
{t("PGR_SEARCH_RESULTS_HEADING")}
</HeaderComponent>
Expand Down
2 changes: 1 addition & 1 deletion health/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.9.0/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.2.3/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.3.19/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.3.20/dist/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT HCM</title>
Expand Down