Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

HLM-5156 filter lyaer in map #606

Merged
merged 20 commits into from
May 22, 2024
Merged

HLM-5156 filter lyaer in map #606

merged 20 commits into from
May 22, 2024

Conversation

siddhant-nawale-egov
Copy link
Contributor

No description provided.

Copy link
Contributor

coderabbitai bot commented May 16, 2024

Walkthrough

Walkthrough

The 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 uuidv4, and improved session data management. These alterations aim to boost user interface consistency, functionality, and data handling within the micro-UI framework.

Changes

File/Path Change Summary
.../css/src/components/microplanning.scss
.../hcm-microplanning/src/components/CommonComponents.js
.../hcm-microplanning/src/configs/UICustomizations.js
Added and updated CSS styles, imports, and status values.
.../hcm-microplanning/src/components/MicroplanCreatedScreen.js
.../hcm-microplanning/src/pages/employee/SavedMicroplans.js
Modified routing logic for redirection and props renaming.
.../hcm-microplanning/src/icons/Svg.js
.../hcm-microplanning/src/pages/employee/Mapping.js
Updated SVG attributes and added marker functions. Modified imports and introduced new exports for components and functions.
.../hcm-microplanning/src/pages/employee/CreateMicroplan.js
.../hcm-microplanning/src/pages/employee/RuleEngine.js
Added logic for fetching data, handling session data, and unique ID generation.
.../hcm-microplanning/src/pages/employee/Hypothesis.js
.../hcm-microplanning/src/pages/employee/Upload.js
Imported uuidv4 for unique IDs and updated functions and dependencies.
.../hcm-microplanning/src/services/searchSavedPlans.js
.../hcm-microplanning/src/configs/constants.js
Added a check for empty data and defined colors for mapping.
.../hcm-microplanning/src/hooks/index.js
.../hcm-microplanning/src/hooks/useGenerateIdCampaign.js
Added import for custom hook and introduced new hook for ID generation.
.../public/index.html
.../hcm-microplanning/src/utils/updateSessionUtils.js
Updated CSS version and enhanced session data handling.

In the realm of code, changes bloom,
With styles and routes, our app finds room.
IDs unique, like stars in the sky,
Data flows smoothly, oh my!
Bugs now fixed, functionalities bright,
Micro-UI shines, a developer's delight.
🐰✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2b8086f and df1025d.
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: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/icons/Svg.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Mapping.js (1)

Pattern **/*.js: check

micro-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 the useEffect hook are necessary for the new filter functionalities.


321-329: LGTM! The new useCallback hook is necessary for handling outside clicks and submit actions.


332-332: LGTM! The new useClickOutside hooks are necessary for handling clicks outside the specified elements.


365-374: LGTM! The new FilterSection component is necessary for rendering filter options.


407-439: LGTM! The new FilterItemBuilder component is necessary for building individual filter items.


441-496: LGTM! The new memoized FilterSection component is necessary for rendering the filter section with performance optimization.


204-206: LGTM! The updates to the extractGeoData function are necessary for the new filter functionalities.

Also applies to: 707-709


1027-1060: LGTM! The new addFilterProperties 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! The useCallback hook now correctly includes all necessary dependencies.


1214-1229: LGTM! The try-catch block improves error handling for the regex test.

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: 5

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between df1025d and 354494e.
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: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/resourceMapping.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/SavedMicroplans.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/updateSessionUtils.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/CreateMicroplan.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Hypothesis.js (1)

Pattern **/*.js: check

micro-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, and PaginationLast 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.

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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 354494e and 8fd9092.
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.

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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8fd9092 and abc3b3e.
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: check

micro-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

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: 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

Commits Files that changed from the base of the PR and between abc3b3e and a1e93c4.
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 import updateSessionUtils 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 of id.


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

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: 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 in excelValidations 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 in checkForErrorInUploadedFileExcel. 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

Commits Files that changed from the base of the PR and between a1e93c4 and 49186cc.
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 keyword isFilterPropertyOfMapSection is not used within this file. Ensure its relevance or document its intended use.

Verification successful

The keyword isFilterPropertyOfMapSection is used in Mapping.js to filter properties of a schema and is consistently added in geojsonValidations.js. The addition in excelValidations.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 to excelValidations.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.js

Length of output: 1249

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: 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

Commits Files that changed from the base of the PR and between 49186cc and 2f67fd5.
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: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js (1)

Pattern **/*.js: check

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: 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: Refactor resourceMappingAndDataFilteringForExcelFiles 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

Commits Files that changed from the base of the PR and between 2f67fd5 and 9283b11.
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: check

micro-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.

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: CHILL

Commits Files that changed from the base of the PR and between 9283b11 and 9ca5def.
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: check

micro-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 in handleExcel 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 in handleGeoJson 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.

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: CHILL

Commits Files that changed from the base of the PR and between 9ca5def and 96bf165.
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: check

micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/useGenerateIdCampaign.js (1)

Pattern **/*.js: check

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/hooks/index.js (1)

8-8: Import of useGenerateIdCampaign looks good.

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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 96bf165 and b96cdff.
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

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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between b96cdff and 09c713d.
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

@nipunarora-eGov nipunarora-eGov merged commit 9bb40e9 into microplan May 22, 2024
2 checks passed
@nipunarora-eGov nipunarora-eGov deleted the HLM-5156 branch May 22, 2024 04: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.

2 participants