Skip to content

Conversation

@abishekTa-egov
Copy link
Contributor

@abishekTa-egov abishekTa-egov commented Nov 12, 2025

PGR revamp changes

Summary by CodeRabbit

  • New Features

    • Added date-range filtering to complaint search.
    • Dynamic maximum file upload size configurable via central settings.
    • Localization-aware loading for complaint form content.
  • Bug Fixes

    • Complaint status sourcing updated for more accurate display.
    • Name field validation now allows spaces.
    • Improved file upload validation, corrupt-file messaging, and dynamic size error text.
    • Consistent date formatting with clearer tags for missing/invalid dates.
  • Style

    • Updated health stylesheet to latest patch and refined header, tag, and selector styling.

@abishekTa-egov abishekTa-egov requested a review from a team as a code owner November 12, 2025 13:05
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

📝 Walkthrough

Walkthrough

Bumped health CSS CDN; made date tag rendering stricter with explicit validation/formatting; made upload max size MDMS-driven with improved corruption detection; allowed spaces in complainant names; added date-range search and changed assignee path; switched displayed status source to service.applicationStatus; added localization loading; small styling/header tweaks.

Changes

Cohort / File(s) Summary
CDN Version Updates
health/micro-ui/web/micro-ui-internals/example/public/index.html, health/micro-ui/web/public/index.html
Bumped @egovernments/digit-ui-health-css CDN from 0.3.19 to 0.3.20.
Date & Tag Formatting
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js, health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
Replace epoch helper with explicit epoch validation and locale-aware "day Month yy" formatting; valid dates render Tag type success, invalid/zero/negative render NA with error type.
File Upload Enhancement
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
Load MaxFileSize from MDMS (Digit.Hooks.useCustomMDMS) with 5 MB fallback; use dynamic maxFileSize/maxFileSizeMB in validation/messages; extend effect deps; add improved image→PDF corruption detection and error paths.
Complaint Validation
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js
Allow spaces in ComplainantName by expanding regex to /^[A-Za-z0-9\s\-_]+$/i; switch error key to CORE_COMMON_APPLICANT_NAME_INVALID.
Search & Inbox Config
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js
Add date-range search field (name: "range") and default; change assignee resolution path to use ProcessInstance; remove logoIcon from Home Complaints link.
Status Source Update
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
Derive CURRENT_STATUS from ServiceWrappers[0].service.applicationStatus with fallback WF_INBOX_PENDING_ASSIGNMENT; add effect to revalidate pgrSearch when modal closes.
Create Complaint Localization
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
Load tenant and language, read selected hierarchy from sessionStorage, build moduleCode for boundary localization, and subscribe to localization store (isLocalizationLoading).
Styling Changes
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
Add .selector-button-border, set .tag-container .tag .text { cursor: default; }, and adjust .pgr-inbox-wrapper .digit-inbox-search-links-header position.
Header Positioning
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js
Add position: relative and right: 0.5rem to HeaderComponent inline styles (presentation-only).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant UI as PGR UI
    participant MDMS as MDMS
    participant Backend as Backend
    participant Formatter as Formatter

    rect rgb(245,255,245)
    Note over MDMS,UI: Dynamic max file size resolution
    MDMS->>UI: MaxFileSize (or null)
    UI->>UI: set maxFileSize (fallback 5 MB)
    UI->>UI: validate file type → validate size using maxFileSize
    UI->>UI: show error using maxFileSizeMB if violated
    end

    rect rgb(235,245,255)
    Note over Backend,Formatter: Epoch → Tag rendering
    Backend->>UI: provide epochTime
    UI->>Formatter: validate & format epochTime
    Formatter->>UI: "day Month yy" (success) or "NA" (error)
    UI->>UI: render Tag with appropriate type
    end

    rect rgb(255,250,230)
    Note over Backend,UI: Status resolution change
    Backend->>UI: provide ServiceWrappers
    UI->>UI: derive status from service.applicationStatus or fallback
    UI->>UI: render status label
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Attention points:
    • Epoch/date parsing edge cases (timezone, zero/negative) in UICustomizations/UIcustomizations.
    • MDMS fallback behavior, effect dependency update, and dynamic-size messaging in UploadFileComponent.
    • New image→PDF corruption branches and error propagation.
    • Change of status source to service.applicationStatus and downstream expectations.
    • Localization subscription and reliance on sessionStorage in createComplaintForm.

Possibly related PRs

Suggested reviewers

  • jagankumar-egov

Poem

🐇 A nibble on code, a gentle new beat,
Dates hop to rows and tags stand neat,
Files learn their limits from a distant tree,
Names stretch with spaces, ranges roam free,
Inbox and forms — tidy, polite.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and does not follow the provided template structure with JIRA ID, Module, or detailed description sections. Expand the description to include JIRA ID (HCMPRE-1022), affected modules (PGR), and detailed explanation of the revamp changes across configuration, UI, and file handling.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title mentions PGR revamp but lacks specificity about the actual changes made across multiple files. Consider being more specific about the primary changes, such as 'PGR: Add dynamic file size validation and date formatting improvements' or similar.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch FEATURE/HCMPRE-1022

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js (1)

73-81: Consider adding validation for the date range field.

The new date range search field lacks validation constraints. Consider adding validation to ensure:

  • Start date is before end date
  • Date range is within reasonable limits
  • Proper error messaging for invalid ranges
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bec7759 and 552f759.

⛔ Files ignored due to path filters (1)
  • health/micro-ui/web/micro-ui-internals/packages/css/package.json is excluded by !**/*.json
📒 Files selected for processing (10)
  • health/micro-ui/web/micro-ui-internals/example/public/index.html (1 hunks)
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js (3 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js (3 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js (1 hunks)
  • health/micro-ui/web/public/index.html (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

check

Files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧠 Learnings (18)
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-08-19T07:07:45.217Z
Learnt from: syedkaifegov
Repo: egovernments/DIGIT-Frontend PR: 3012
File: micro-ui/web/micro-ui-internals/packages/css/src/index.scss:692-696
Timestamp: 2025-08-19T07:07:45.217Z
Learning: CSS changes for .employee-app-wrapper.sandbox are specific to Urban repo's sandbox branch implementation, not related to sandbox-login-page components found in the main codebase.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
📚 Learning: 2025-06-26T10:24:08.628Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss:1642-1662
Timestamp: 2025-06-26T10:24:08.628Z
Learning: In the sandbox SCSS file, tab styling with margin-bottom and border changes that cause layout shifts are intentional design requirements per updated UI specifications, not bugs to be fixed.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
📚 Learning: 2025-06-26T10:17:02.717Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Otp/index.js:0-0
Timestamp: 2025-06-26T10:17:02.717Z
Learning: In the DIGIT Frontend project, banner images and similar configuration data should be managed through MDMS (Master Data Management Service) rather than hardcoded arrays or separate config files, as indicated by the user Hari-egov.

Applied to files:

  • health/micro-ui/web/public/index.html
📚 Learning: 2025-02-05T10:26:52.452Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UICustomizations.js:22-130
Timestamp: 2025-02-05T10:26:52.452Z
Learning: UI customizations in DIGIT-Frontend should not be restructured at this time as a new methodology for formcomposer will be implemented in the future.

Applied to files:

  • health/micro-ui/web/public/index.html
  • health/micro-ui/web/micro-ui-internals/example/public/index.html
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-02-05T10:01:29.668Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js:72-78
Timestamp: 2025-02-05T10:01:29.668Z
Learning: In the employee login form, defaultValues are dynamically generated from config[0].body based on populators.defaultValue, so spreading the entire defaultValues object is required rather than cherry-picking specific fields.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js
📚 Learning: 2024-06-10T19:25:42.992Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 204
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:468-481
Timestamp: 2024-06-10T19:25:42.992Z
Learning: The error message in the `checkForErrorInUploadedFile` function within `Upload.js` is being localized and improved for better user experience, as clarified by the user.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-10-08T20:11:12.539Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 204
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:0-0
Timestamp: 2024-10-08T20:11:12.539Z
Learning: A more detailed message for file parsing errors in the `Upload.js` file is displayed elsewhere in the code, as clarified by the user.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-11-28T11:34:27.480Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1925
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserUpload.js:267-269
Timestamp: 2024-11-28T11:34:27.480Z
Learning: In the `downloadTemplate` function of `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserUpload.js`, the scenario where `state?.hierarchyType` is undefined will not occur.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-06-14T14:10:20.359Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js:3-39
Timestamp: 2024-06-14T14:10:20.359Z
Learning: The `CustomScaleControl` component in the `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js` file should not include a "loading map" message as there is another component handling this functionality to avoid redundancy.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-06-15T11:05:03.278Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/Module.js:13-40
Timestamp: 2024-06-15T11:05:03.278Z
Learning: Error handling for the `Digit.Services.useStore` method is managed internally and does not require explicit external error checks.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2025-06-26T10:16:36.004Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/css/src/components/Carousel.scss:0-0
Timestamp: 2025-06-26T10:16:36.004Z
Learning: In the DIGIT-Frontend codebase, signup-container CSS classes cannot be namespaced under parent classes due to existing style constraints and requirements.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/public/index.html
📚 Learning: 2025-01-02T04:41:15.957Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2089
File: micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js:111-111
Timestamp: 2025-01-02T04:41:15.957Z
Learning: In micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js, always use "mdms[0].uniqueIdentifier" for the jsonPath instead of differentiating between "SOR" and other masters.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-07-15T06:49:28.898Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2788
File: micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js:43-74
Timestamp: 2025-07-15T06:49:28.898Z
Learning: In the HRMS module (micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js), the current error handling approach in the `fetchDetailsForSelectedOption` function is considered sufficient by the team. Enhanced error handling with user notifications and fallback behavior is not required for the boundary service API call.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2024-10-17T11:59:00.327Z
Learnt from: Ramkrishna-egov
Repo: egovernments/DIGIT-Frontend PR: 1545
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/ActivityCard.js:1-1
Timestamp: 2024-10-17T11:59:00.327Z
Learning: In `ActivityCard.js`, `React.Fragment` is used in the code.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧬 Code graph analysis (3)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)
  • formatDate (122-143)
  • dateLabel (144-144)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js (3)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/hooks/boundary/useFetchAllHierarchies.js (1)
  • Digit (21-30)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/Module.js (1)
  • tenantId (20-20)
micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/ComplaintDetails.js (2)
  • tenantId (226-226)
  • file (94-94)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (6)
  • formatDate (1778-1799)
  • date (125-125)
  • day (155-155)
  • month (154-154)
  • year (153-153)
  • dateLabel (1800-1800)
🪛 Biome (2.1.2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js

[error] 1778-1800: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 1800-1801: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)

health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js

[error] 122-143: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 144-144: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)

🔇 Additional comments (13)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js (3)

18-37: Verify MDMS data type and consider showing loading state.

The parseInt on line 26 could return NaN if maxFileSize is not a numeric string. While the fallback logic on line 36 will handle NaN correctly (since NaN || 5242880 evaluates to 5242880), it's safer to add explicit validation.

Additionally, isMaxFileSizeLoading is extracted but never used. While the current behavior (allowing uploads with a 5MB default during MDMS load) is acceptable, consider whether you want to disable uploads or show a loading indicator until the actual limit is fetched.

select: (data) => {
  const maxFileSize = data?.PGR?.MaxFileSize?.[0]?.maxFileSize;
  const parsed = parseInt(maxFileSize);
  // Add validation to ensure parsed value is a valid number
  return (parsed && !isNaN(parsed) && parsed > 0) ? parsed : 5242880;
},

39-86: LGTM! Dynamic file size validation implemented correctly.

The validation logic properly uses the dynamic maxFileSize for size checks and displays the appropriate limit in error messages. The addition of maxFileSize to the dependencies array ensures the effect re-runs when the MDMS-fetched limit changes. The enhanced error handling for corrupted files (lines 77-81) with specific error messages improves user experience.


93-130: LGTM! Enhanced corruption detection improves error handling.

The consistent use of the "corrupt:" prefix in error messages (lines 117, 122, 127) allows the useEffect to differentiate between file corruption and generic upload failures, providing users with more specific feedback through localized error messages.

health/micro-ui/web/micro-ui-internals/example/public/index.html (1)

15-15: LGTM: CSS version update.

The health CSS CDN version bump from 0.3.19 to 0.3.20 is consistent with the PR's styling updates.

health/micro-ui/web/public/index.html (1)

13-13: LGTM: Consistent CSS version update.

The health CSS version is correctly updated to 0.3.20, matching the version in the example environment.

health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss (2)

1397-1400: Verify if multiple header positioning adjustments indicate a deeper layout issue.

The .pgr-inbox-wrapper .digit-inbox-search-links-header rule applies right: 2.3rem, while PGRInbox.js line 147 applies right: "0.5rem" inline. Multiple positioning adjustments in different places may indicate the root cause of misalignment hasn't been addressed.

Consider consolidating positioning logic in one place or investigating whether the layout structure needs refactoring.


1386-1394: LGTM: UI refinements for PGR components.

The flexbox centering for .selector-button-border and cursor change for tag text are appropriate UI improvements.

health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js (1)

147-147: Header positioning adjustment—ensure consistency with CSS rules.

The inline right: "0.5rem" is added here, while the SCSS file at line 1397-1400 applies right: 2.3rem to .pgr-inbox-wrapper .digit-inbox-search-links-header. Ensure these adjustments work together and don't conflict.

health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js (2)

47-48: LGTM: Date range field addition and link simplification.

The date range search field with corresponding defaultValue is a good UX enhancement. Removing the logoIcon simplifies the link configuration.

Also applies to: 138-138


110-110: No changes required; review comment is based on incorrect assumptions.

The review comment assumes a breaking change from ProcessInstance.assigner.name to ProcessInstance, but the actual codebase consistently uses assignes (a plural array property). The consuming code in UIcustomizations.js line 119 correctly accesses value?.assignes?.[0]?.name, which aligns with how ProcessInstance objects are structured throughout the codebase (Workflow.js, TimeLineWrapper.js, PGRDetails.js, and utils/index.js). The assigner property (singular) exists separately for different contexts. The jsonPath change to pass the entire ProcessInstance object enables proper extraction of assignee information via the existing property chain.

Likely an incorrect or invalid review comment.

health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)

119-119: LGTM: Simplified assignee display logic.

The updated logic value?.assignes?.[0]?.name || t("NA") correctly handles the new ProcessInstance object structure from the config change and is more concise than the previous implementation.


122-143: Excellent date formatting implementation.

The formatDate helper validates epoch timestamps (numeric and positive), formats dates as "day Month yy", and gracefully handles invalid values by returning "ES_COMMON_NA". This provides consistent, user-friendly date display.

health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (1)

372-373: LGTM: Cleaner status derivation logic.

The updated approach uses service.applicationStatus directly instead of inferring status from the assignees array. This is more straightforward and aligns with the status handling improvements in UIcustomizations.js.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (2)

1777-1802: Block scope is correctly implemented.

The switch case declarations are now properly wrapped in a block, preventing variable leakage to other cases. This addresses the previous static analysis issue.


1778-1799: Duplicated formatDate function (see UIcustomizations.js review).

This formatDate function is identical to the one in health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (lines 122-143). Please refer to the review comment on that file for the recommended refactoring to extract this into a shared utility module.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 552f759 and f6f16ab.

📒 Files selected for processing (2)
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

check

Files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🧠 Learnings (4)
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
🧬 Code graph analysis (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (6)
  • formatDate (1778-1799)
  • date (125-125)
  • day (155-155)
  • month (154-154)
  • year (153-153)
  • dateLabel (1800-1800)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)
  • formatDate (122-143)
  • dateLabel (144-144)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build application arm64
  • GitHub Check: Build application amd64
🔇 Additional comments (4)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (4)

116-116: Minor formatting improvement approved.

The spacing adjustment improves readability without altering functionality.


121-146: Block scope is correctly implemented.

The switch case declarations are now properly wrapped in a block, preventing variable leakage to other cases. This addresses the previous static analysis issue.


118-119: Review comment is incorrect.

The property assignes is not a typo. The codebase consistently uses assignes as the actual field name in the ProcessInstance data structure, as confirmed by the jsonPath configuration ("ProcessInstance.assignes") and usage throughout multiple files (WorkflowTimeline, useInboxData, ApplicationDetailsContent, TimeLineWrapper, etc.). The code change is correct.

Likely an incorrect or invalid review comment.


122-143: Extract the duplicated formatDate function into a shared utility.

The formatDate function is duplicated in health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (lines 1778-1799). This violates the DRY principle and makes maintenance harder.

Consider extracting this function into a shared utility module, e.g., utils/dateFormatters.js:

// utils/dateFormatters.js
export const formatDate = (epochTime, t) => {
  if (!Number.isFinite(epochTime) || epochTime <= 0) return t("ES_COMMON_NA");
  const date = new Date(epochTime);
  const day = date.getDate();
  const monthNames = [
    "January", "February", "March", "April", "May", "June",
    "July", "August", "September", "October", "November", "December",
  ];
  const month = monthNames[date.getMonth()];
  const year = date.getFullYear().toString().slice(-2);
  return `${day} ${month} ${year}`;
};

Then import and use it in both files:

+import { formatDate } from '../utils/dateFormatters';
...
 case "WF_INBOX_HEADER_CREATED_DATE": {
-  const formatDate = (epochTime) => {
-    if (!Number.isFinite(epochTime) || epochTime <= 0) return t("ES_COMMON_NA");
-    const date = new Date(epochTime);
-    const day = date.getDate();
-    const monthNames = [
-      "January", "February", "March", "April", "May", "June",
-      "July", "August", "September", "October", "November", "December",
-    ];
-    const month = monthNames[date.getMonth()];
-    const year = date.getFullYear().toString().slice(-2);
-    return `${day} ${month} ${year}`;
-  };
-  const dateLabel = formatDate(value);
+  const dateLabel = formatDate(value, t);
   return <Tag label={dateLabel} showIcon={false} type={dateLabel === t("ES_COMMON_NA") ? "error" : "success"} />;
 }
⛔ Skipped due to learnings
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2488
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js:152-152
Timestamp: 2025-06-04T04:08:48.234Z
Learning: In the employee login component (micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js), prefer using a `defaultTenant` variable to store `Digit.ULBService.getStateId()` instead of calling the function multiple times inline in the `defaultValue` object. This improves code readability and avoids function call duplication.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6f16ab and 6dda0f2.

📒 Files selected for processing (2)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

check

Files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧠 Learnings (9)
📚 Learning: 2025-02-05T10:05:37.433Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js:14-14
Timestamp: 2025-02-05T10:05:37.433Z
Learning: In PGR's useComplaintSubType hook, the translation function 't' must be included in the useEffect dependency array to ensure complaint types are updated when the language changes.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2025-07-15T06:50:54.535Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2788
File: micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js:157-162
Timestamp: 2025-07-15T06:50:54.535Z
Learning: In the HRMS module (micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js), localization is already working correctly when using `ele.hierarchyType` directly in the `gethierarchylistdata()` function. The suggested locale conversion using `Digit.Utils.locale.convertToLocale(ele.hierarchyType, 'EGOV_LOCATION_BOUNDARYTYPE')` is not needed as the current implementation already provides proper localization.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2024-06-14T14:10:20.359Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js:3-39
Timestamp: 2024-06-14T14:10:20.359Z
Learning: The `CustomScaleControl` component in the `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js` file should not include a "loading map" message as there is another component handling this functionality to avoid redundancy.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2025-06-04T04:08:48.234Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2488
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js:152-152
Timestamp: 2025-06-04T04:08:48.234Z
Learning: In the employee login component (micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js), prefer using a `defaultTenant` variable to store `Digit.ULBService.getStateId()` instead of calling the function multiple times inline in the `defaultValue` object. This improves code readability and avoids function call duplication.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2024-06-15T11:05:03.278Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/Module.js:13-40
Timestamp: 2024-06-15T11:05:03.278Z
Learning: Error handling for the `Digit.Services.useStore` method is managed internally and does not require explicit external error checks.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2025-02-05T10:18:29.947Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/new-inbox.js:34-47
Timestamp: 2025-02-05T10:18:29.947Z
Learning: In the DIGIT-Frontend codebase, translations within FormComposer are handled internally by the component itself, so the translation function 't' does not need to be added to useMemo dependency arrays even when used within the memoized function that generates form configurations.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-01-02T04:41:15.957Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2089
File: micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js:111-111
Timestamp: 2025-01-02T04:41:15.957Z
Learning: In micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js, always use "mdms[0].uniqueIdentifier" for the jsonPath instead of differentiating between "SOR" and other masters.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧬 Code graph analysis (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js (5)
  • stateTenantId (40-40)
  • language (43-43)
  • selectedHierarchy (53-55)
  • moduleCode (58-60)
  • isLocalizationLoading (64-70)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/HierarchySelection.js (3)
  • language (18-18)
  • selectedHierarchy (24-26)
  • moduleCode (41-43)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js (1)
  • openModal (14-14)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (2)

335-335: Formatting-only change.

This blank line has no functional impact.


379-380: No issues found with applicationStatus field availability.

The field is part of the service object schema, initialized with "CREATED" status when complaints are created (confirmed in mock data at utils/index.js:175), and referenced consistently in search configurations. The code defensively handles missing values with optional chaining and a fallback to "WF_INBOX_PENDING_ASSIGNMENT", which is appropriate. The field comes directly from the backend API response and does not require frontend transformation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)

121-132: Wrap switch case declarations in a block to prevent scope leakage.

The declarations (createdDate, createdDay, createdMonthKeys, createdMonth, createdYear, createdDateLabel) are not wrapped in a block, allowing other switch cases to erroneously access them. This is a code correctness issue flagged by static analysis.

Apply this fix:

         case "WF_INBOX_HEADER_CREATED_DATE":
+          {
           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:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 153ba08 and 1ac68f9.

📒 Files selected for processing (1)
  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

check

Files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
🧠 Learnings (7)
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-06-14T14:10:20.359Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js:3-39
Timestamp: 2024-06-14T14:10:20.359Z
Learning: The `CustomScaleControl` component in the `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js` file should not include a "loading map" message as there is another component handling this functionality to avoid redundancy.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2025-02-05T10:26:52.452Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UICustomizations.js:22-130
Timestamp: 2025-02-05T10:26:52.452Z
Learning: UI customizations in DIGIT-Frontend should not be restructured at this time as a new methodology for formcomposer will be implemented in the future.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2025-06-26T10:21:42.619Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/ProductDetails/ProductDetailsComponentUpdated.js:279-280
Timestamp: 2025-06-26T10:21:42.619Z
Learning: In the sandbox ProductDetailsComponentUpdated.js component, string concatenation is intentionally used for translation keys (e.g., `t(`${module}` + "_SECTION1_ROLE_1")`) instead of template literals for easier config identification and to make the key structure more explicit.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
🧬 Code graph analysis (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (6)
  • createdDate (1781-1781)
  • createdDay (1782-1782)
  • createdMonthKeys (1783-1783)
  • createdMonth (1784-1784)
  • createdYear (1785-1785)
  • createdDateLabel (1786-1786)
🪛 Biome (2.1.2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js

[error] 125-125: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 126-126: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 127-127: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 128-128: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 129-129: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 130-130: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)

⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build application amd64
  • GitHub Check: Build application arm64
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)

115-116: LGTM! Proper null/empty check added.

The tightened condition correctly validates that the value exists and has content before rendering the status label.


118-119: LGTM! Clean optional chaining for assignee access.

The simplified logic safely accesses the first assignee's name with proper fallback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d26710 and fd61e2e.

📒 Files selected for processing (1)
  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

check

Files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🧠 Learnings (5)
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2025-06-26T10:21:42.619Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/ProductDetails/ProductDetailsComponentUpdated.js:279-280
Timestamp: 2025-06-26T10:21:42.619Z
Learning: In the sandbox ProductDetailsComponentUpdated.js component, string concatenation is intentionally used for translation keys (e.g., `t(`${module}` + "_SECTION1_ROLE_1")`) instead of template literals for easier config identification and to make the key structure more explicit.

Applied to files:

  • health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🪛 Biome (2.1.2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js

[error] 1780-1781: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 1781-1782: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 1782-1783: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 1783-1784: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 1784-1785: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 1785-1786: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Safe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)

⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build application amd64
  • GitHub Check: Build application arm64
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)

1770-1774: Improved null-safety and simplified logic.

The changes to both cases are good improvements:

  • Line 1771: The simplified condition value && value?.length > 0 is cleaner and maintains the same intent
  • Line 1774: Using optional chaining value?.assignes?.[0]?.name is more defensive and prevents potential runtime errors if the data structure is missing

@jagankumar-egov jagankumar-egov merged commit 6611ba5 into master Nov 14, 2025
11 checks passed
@jagankumar-egov jagankumar-egov deleted the FEATURE/HCMPRE-1022 branch November 14, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants