-
Notifications
You must be signed in to change notification settings - Fork 22
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
HLM-5156 filter lyaer in map #606
Conversation
WalkthroughWalkthroughThe recent updates encompass a variety of improvements across the micro-UI internals package. Notable changes include enhanced CSS styling, refined routing logic, new imports, SVG enhancements, unique identifier generation using Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/ToBeShifted/MapFilters.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/ToBeShifted/Schemas.json
is excluded by!**/*.json
Files selected for processing (8)
- micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss (8 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CommonComponents.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/icons/Svg.js (3 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (24 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/ToBeShifted/CheckBox.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (5 hunks)
Files not reviewed due to errors (1)
- micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss (no review received)
Files skipped from review due to trivial changes (3)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CommonComponents.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js
Additional Context Used
Path-based Instructions (4)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/ToBeShifted/CheckBox.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/icons/Svg.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (1)
Pattern
**/*.js
: check
Learnings (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (3)
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#204 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:468-481 Timestamp: 2024-03-13T07:33:45.211Z 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.
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#204 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:0-0 Timestamp: 2024-03-13T05:11:36.400Z 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.
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#214 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:14-17 Timestamp: 2024-03-15T12:20:50.090Z Learning: The `geojsonValidations` is a utility developed within the DIGIT-Frontend project, not an external dependency.
Additional comments not posted (23)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/icons/Svg.js (11)
6-8
: LGTM! The dynamic fill color is correctly handled.
31-31
: LGTM! The dynamic fill color is correctly handled.
37-42
: LGTM! The dynamic fill color is correctly handled.
48-58
: LGTM! The dynamic fill color is correctly handled.
64-75
: LGTM! The dynamic fill color is correctly handled.
80-98
: LGTM! The dynamic fill color is correctly handled.
103-121
: LGTM! The dynamic fill color is correctly handled.
127-139
: LGTM! The dynamic fill color is correctly handled.
146-151
: LGTM! The dynamic fill color is correctly handled.
156-167
: LGTM! The dynamic fill color is correctly handled.
177-186
: LGTM! The dynamic fill color is correctly handled.micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (10)
12-12
: LGTM! The new imports are necessary for the added functionalities.Also applies to: 16-16, 22-22, 37-41
134-140
: LGTM! The new state variables are necessary for managing filter options.
204-206
: LGTM! The updates to theuseEffect
hook are necessary for the new filter functionalities.
321-329
: LGTM! The newuseCallback
hook is necessary for handling outside clicks and submit actions.
332-332
: LGTM! The newuseClickOutside
hooks are necessary for handling clicks outside the specified elements.
365-374
: LGTM! The newFilterSection
component is necessary for rendering filter options.
407-439
: LGTM! The newFilterItemBuilder
component is necessary for building individual filter items.
441-496
: LGTM! The new memoizedFilterSection
component is necessary for rendering the filter section with performance optimization.
204-206
: LGTM! The updates to theextractGeoData
function are necessary for the new filter functionalities.Also applies to: 707-709
1027-1060
: LGTM! The newaddFilterProperties
function is necessary for adding filter properties to the geojson data.micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (2)
114-129
: LGTM! TheuseCallback
hook now correctly includes all necessary dependencies.
1214-1229
: LGTM! The try-catch block improves error handling for the regex test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (5)
micro-ui/web/micro-ui-internals/example/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/package.json
is excluded by!**/*.json
micro-ui/web/microplan/package.json
is excluded by!**/*.json
micro-ui/web/package.json
is excluded by!**/*.json
Files selected for processing (14)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanningHeader.js (3 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/resourceMapping.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/icons/Svg.js (3 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (4 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Hypothesis.js (3 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (25 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/RuleEngine.js (7 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/SavedMicroplans.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/services/searchSavedPlans.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (5 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (4 hunks)
Files skipped from review due to trivial changes (1)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanningHeader.js
Files skipped from review as they are similar to previous changes (5)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/icons/Svg.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js
Additional Context Used
Path-based Instructions (8)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/services/searchSavedPlans.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/resourceMapping.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/SavedMicroplans.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Hypothesis.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/RuleEngine.js (1)
Pattern
**/*.js
: check
Additional comments not posted (4)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/resourceMapping.js (1)
116-125
: SVG components used effectively for pagination.The use of
PaginationFirst
,PaginationPrevious
,PaginationNext
, andPaginationLast
enhances the user interface by providing visually consistent navigation buttons.micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Hypothesis.js (2)
217-222
: LGTM! Using UUIDs enhances the uniqueness of assumption IDs.
466-468
: Good use of UUIDs to ensure data uniqueness in autofill operations.micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/RuleEngine.js (1)
305-310
: Proper use of UUIDs to ensure each rule is uniquely identifiable.
...i/web/micro-ui-internals/packages/modules/hcm-microplanning/src/services/searchSavedPlans.js
Show resolved
Hide resolved
.../micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/SavedMicroplans.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
.../micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1 hunks)
Additional Context Used
Path-based Instructions (1)
micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
Pattern
**/*.js
: check
Additional comments not posted (1)
micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
290-292
: Ensure consistency of the new status values across the application.
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
micro-ui/web/micro-ui-internals/packages/css/package.json
is excluded by!**/*.json
Files selected for processing (9)
- micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss (8 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanCreatedScreen.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/Nagivator.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (25 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js (15 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (4 hunks)
- micro-ui/web/public/index.html (1 hunks)
Files skipped from review due to trivial changes (1)
- micro-ui/web/public/index.html
Files skipped from review as they are similar to previous changes (6)
- micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Additional Context Used
Path-based Instructions (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanCreatedScreen.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/Nagivator.js (1)
Pattern
**/*.js
: check
Additional comments not posted (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanCreatedScreen.js (1)
51-51
: Change in navigation route approved.micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/Nagivator.js (1)
76-86
: Refactoring of navigation event handling approved.Also applies to: 237-259
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Out of diff range and nitpick comments (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (1)
Line range hint
180-224
: Consider enhancing error handling by logging errors or providing more detailed user feedback.+ console.error(error); + setToastCreateMicroplan({ state: "error", message: `${t("ERROR_DATA_NOT_SAVED")} - ${error.message}` });
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/SavedMicroplans.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (8 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (8 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (5 hunks)
Files skipped from review as they are similar to previous changes (5)
- micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/SavedMicroplans.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Additional Context Used
Path-based Instructions (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (1)
Pattern
**/*.js
: check
Additional comments not posted (5)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (5)
27-27
: Ensure the new importupdateSessionUtils
is utilized correctly throughout the file.
49-61
: API call setup for fetching campaign data is correctly implemented with conditional fetching based on the presence ofid
.
63-81
: Boundary hierarchy data fetching is efficiently set up with conditional logic and response transformation.
102-102
: Session data storage logic is correctly implemented with efficient dependency management.
180-186
: Session data computation and update logic are robust, correctly handling conditional state updates.Also applies to: 213-224
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Out of diff range and nitpick comments (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (2)
Line range hint
6-50
: Consider refactoring the error handling inexcelValidations
to reduce complexity and improve maintainability. Possible approaches include breaking down the function into smaller functions or using a strategy pattern for error handling.
Line range hint
52-75
: Improve the readability of error message construction incheckForErrorInUploadedFileExcel
. Consider using template literals for constructing messages and reducing nested conditions.- const message = t("ERROR_COLUMNS_DO_NOT_MATCH_TEMPLATE", { - columns: - columnList.length > 1 - ? `${columnList.slice(0, columnList.length - 1).join(", ")} ${t("AND")} ${columnList[columnList.length - 1]}` - : `${columnList[columnList.length - 1]}`, - }); + const columnsFormatted = columnList.join(`, ${t("AND")} `); + const message = t("ERROR_COLUMNS_DO_NOT_MATCH_TEMPLATE", { columns: columnsFormatted });
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/package.json
is excluded by!**/*.json
Files selected for processing (2)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.js (1 hunks)
Files skipped from review due to trivial changes (1)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.js
Additional Context Used
Path-based Instructions (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (1)
Pattern
**/*.js
: check
Additional comments not posted (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (1)
6-6
: Added keywordisFilterPropertyOfMapSection
is not used within this file. Ensure its relevance or document its intended use.Verification successful
The keyword
isFilterPropertyOfMapSection
is used inMapping.js
to filter properties of a schema and is consistently added ingeojsonValidations.js
. The addition inexcelValidations.js
appears to be for future use or consistency.
Mapping.js
: The keyword is used to filter properties of a schema.geojsonValidations.js
: The keyword is added similarly toexcelValidations.js
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the keyword `isFilterPropertyOfMapSection` across the project. # Test: Search for the keyword usage. Expect: Occurrences in validation schemas or similar contexts. rg --type js 'isFilterPropertyOfMapSection'Length of output: 487
Script:
#!/bin/bash # Description: Verify the context and usage of the keyword `isFilterPropertyOfMapSection` in Mapping.js and geojsonValidations.js. # Test: Extract the relevant lines from Mapping.js to understand the usage. rg --type js --context 5 'isFilterPropertyOfMapSection' micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js # Test: Extract the relevant lines from geojsonValidations.js to understand the context. rg --type js --context 5 'isFilterPropertyOfMapSection' micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.jsLength of output: 1249
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
Out of diff range and nitpick comments (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
3-3
: Ensure consistent import naming.The import
commonColumn
from constants is not used in this file. If it's not needed, consider removing it to clean up the code.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanCreatedScreen.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (25 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js (17 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (9 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (5 hunks)
Files skipped from review as they are similar to previous changes (4)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanCreatedScreen.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/MicroplanPreview.js
Additional Context Used
Path-based Instructions (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
Pattern
**/*.js
: check
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Outdated
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Outside diff range and nitpick comments (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
Line range hint
197-272
: RefactorresourceMappingAndDataFilteringForExcelFiles
to improve clarity and maintainability.- const resourceMappingAndDataFilteringForExcelFiles = (schemaData, hierarchy, selectedFileType, fileDataToStore, t, translatedData = true) => { + const resourceMappingAndDataFilteringForExcelFiles = ({ schemaData, hierarchy, selectedFileType, fileDataToStore, translateFunction: t, translatedData = true }) => {Consider using object destructuring in the function parameters for better scalability and readability. This change makes it easier to pass and manage multiple parameters.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (24 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js (10 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/index.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (7 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (5 hunks)
Files skipped from review due to trivial changes (1)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/index.js
Files skipped from review as they are similar to previous changes (2)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js
Additional Context Used
Path-based Instructions (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
Pattern
**/*.js
: check
Learnings (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (1)
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#606 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js:303-303 Timestamp: 2024-05-21T05:47:32.847Z Learning: Error handling for promises in the `fetchFiles` function of `updateSessionUtils.js` is managed as per user's confirmation.
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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: CHILL
Files selected for processing (2)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (7 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (5 hunks)
Additional Context Used
Path-based Instructions (2)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
Pattern
**/*.js
: check
Learnings (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (5)
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#606 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js:303-303 Timestamp: 2024-05-21T05:47:32.847Z Learning: Error handling for promises in the `fetchFiles` function of `updateSessionUtils.js` is managed as per user's confirmation.
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#214 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:14-17 Timestamp: 2024-03-15T12:20:50.090Z Learning: The `geojsonValidations` is a utility developed within the DIGIT-Frontend project, not an external dependency.
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#478 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js:219-229 Timestamp: 2024-05-07T05:27:30.727Z Learning: The `addGeojsonToMap` function in `Mapping.js` does not cause runtime errors with invalid files because such files do not load, as observed by user siddhant-nawale-egov.
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#204 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:0-0 Timestamp: 2024-03-13T05:11:36.400Z 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.
User: siddhant-nawale-egov PR: egovernments/DIGIT-Frontend#204 File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:468-481 Timestamp: 2024-03-13T07:33:45.211Z 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.
Additional comments not posted (3)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (2)
164-190
: Refactor error handling inhandleExcel
to avoid early returns.- if (!file) { - console.error("Excel file is undefined"); - return upload; - } + if (!file) { + throw new Error("Excel file is undefined"); + }Similar to the previous comment, consider throwing an error when the file is undefined to ensure that such cases are handled appropriately and not just logged.
Likely invalid or redundant comment.
144-159
: Refactor error handling inhandleGeoJson
to avoid early returns.- if (!file) { - console.error(`${shapefileOrigin ? "Shapefile" : "Geojson"} file is undefined`); - return upload; - } + if (!file) { + throw new Error(`${shapefileOrigin ? "Shapefile" : "Geojson"} file is undefined`); + }Consider throwing an error instead of logging and returning the unchanged
upload
object. This approach ensures that the error is not silently ignored and can be handled or logged by the calling function.Likely invalid or redundant comment.
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)
164-164
: Refactor data handling to ensure integrity and prevent potential data loss.- const data = { filestoreId: item.filestoreId, inputFileType: item.fileType, templateIdentifier: item.section, id: item.fileId }; + const data = { filestoreId: item.filestoreId, inputFileType: item.fileType, templateIdentifier: item.section, id: item.fileId, valid: item.isValid };This change adds a
valid
property to ensure that only valid files are processed, enhancing data integrity.Likely invalid or redundant comment.
...ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js
Show resolved
Hide resolved
There was a problem hiding this 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: CHILL
Files ignored due to path filters (1)
micro-ui/web/micro-ui-internals/packages/css/package.json
is excluded by!**/*.json
Files selected for processing (10)
- micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss (8 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/constants.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/index.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/useGenerateIdCampaign.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (23 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.js (1 hunks)
- micro-ui/web/public/index.html (1 hunks)
Files skipped from review due to trivial changes (1)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/constants.js
Files skipped from review as they are similar to previous changes (6)
- micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
- micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.js
- micro-ui/web/public/index.html
Additional Context Used
Path-based Instructions (3)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/index.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/useGenerateIdCampaign.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (1)
Pattern
**/*.js
: check
Additional comments not posted (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/index.js (1)
8-8
: Import ofuseGenerateIdCampaign
looks good.
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/index.js
Show resolved
Hide resolved
...web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/useGenerateIdCampaign.js
Show resolved
Hide resolved
...o-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.js (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/excelValidations.js
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/geojsonValidations.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/package.json
is excluded by!**/*.json
Files selected for processing (1)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanningHeader.js (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanningHeader.js
No description provided.