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

Bugfix/hcmpre 1583 #2021

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Bugfix/hcmpre 1583 #2021

merged 3 commits into from
Dec 13, 2024

Conversation

abishekTa-egov
Copy link
Contributor

@abishekTa-egov abishekTa-egov commented Dec 13, 2024

Pagination issue fix

Summary by CodeRabbit

  • New Features

    • Enhanced tab change functionality in the MicroplanSearch and MyMicroplans components for improved reactivity.
  • Bug Fixes

    • Resolved issues with component re-rendering on tab changes, ensuring a smoother user experience.

@abishekTa-egov abishekTa-egov requested a review from a team as a code owner December 13, 2024 10:19
Copy link
Contributor

coderabbitai bot commented Dec 13, 2024

📝 Walkthrough

Walkthrough

The changes involve modifications to the MicroplanSearch and MyMicroplans components, specifically in the MicroplanSearch.js and MyMicroplans.js files. Both components now include a new state variable key, initialized to 0, which is used to trigger re-renders upon tab changes. The onTabChange function has been updated to increment this key state, ensuring that the React.Fragment component receives a fresh key prop. This adjustment enhances the reactivity of the components during tab interactions while preserving their existing structures.

Changes

File Change Summary
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js Added state variable key for re-rendering on tab change and modified onTabChange to increment key.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MyMicroplans.js Added state variable key for re-rendering on tab change and modified onTabChange to increment key.

Possibly related PRs

  • side bar with correct order  #1394: Changes in the MyMicroplans component involve similar modifications to state management and re-rendering logic as seen in the MicroplanSearch component.
  • Vertical stepper implemenetation #1441: The UploadData component updates its state management and rendering logic, which parallels the changes made in the MicroplanSearch component regarding state variables and reactivity.
  • added new hook for microplans search screen #1587: The introduction of a new hook for managing saved microplans relates to the overall functionality of the MicroplanSearch component, which also deals with state and reactivity.
  • Added action bar for pop inbox screen #1622: The SetupMicroplan component's modifications to state management and event handling are relevant to the changes made in MicroplanSearch, particularly in how state is utilized for rendering.
  • Tab issue #1674: The updates in the PlanInbox component regarding state management and UI responsiveness are similar to the changes in MicroplanSearch, focusing on dynamic updates based on user interactions.
  • Plan Inbox patch fix #1847: The enhancements in the PlanInbox component's state management and dynamic rendering are closely related to the reactivity improvements made in the MicroplanSearch component.
  • Employee search fix #1892: The FacilityPopup component's updates to state management and user interactions reflect similar patterns found in the MicroplanSearch component's changes.
  • KPI card fix, and css change #1903: The CSS changes and fixes related to the KPI card may indirectly relate to the overall UI improvements seen in the MicroplanSearch component, focusing on user experience enhancements.

Suggested reviewers

  • nipunarora-eGov
  • nabeelmd-eGov

🐇 In the meadow, where rabbits play,
A new key springs forth, brightening the day.
With each tab we hop, a fresh view in sight,
Re-rendering joy, oh what a delight!
So let’s celebrate, with a twitch and a cheer,
For changes so merry, we hold dear! 🌼


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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: 2

🧹 Outside diff range comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js (1)

Line range hint 40-46: Review InboxSearchComposer configuration

The pagination issue might be better addressed through proper configuration of the InboxSearchComposer component rather than forcing re-renders.

Consider:

  1. Reviewing InboxSearchComposer's pagination props and ensuring they're properly configured
  2. Implementing proper state management for search results and pagination at the InboxSearchComposer level
  3. Ensuring the tabData and config changes properly trigger necessary state resets in InboxSearchComposer

Would you like me to help investigate the InboxSearchComposer component's API to identify the correct pagination configuration?

🧰 Tools
🪛 Biome (1.9.4)

[error] 17-17: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)


[error] 27-27: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12a37dc and 3444c61.

📒 Files selected for processing (2)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MyMicroplans.js (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js (1)

Pattern **/*.js: check

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

Pattern **/*.js: check

🪛 Biome (1.9.4)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MicroplanSearch.js

[error] 27-27: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

🔇 Additional comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/MyMicroplans.js (1)

Line range hint 28-29: Review commented out configuration code

The commented out line setConfig(TabSearchconfig?.TabSearchconfig?.[n]) might be relevant to the pagination issue. This could affect how the search configuration is applied across different tabs.

Let's check how this configuration is used in the codebase:

@nipunarora-eGov nipunarora-eGov merged commit 201a0ce into console Dec 13, 2024
3 of 4 checks passed
@nipunarora-eGov nipunarora-eGov deleted the BUGFIX/HCMPRE-1583 branch December 13, 2024 10:26
Swathi-eGov added a commit that referenced this pull request Dec 13, 2024
nipunarora-eGov pushed a commit that referenced this pull request Dec 13, 2024
* Revert "Bugfix/hcmpre 1583 (#2021)"

This reverts commit 201a0ce.

* BUGFIX/HCMPRE-1634 Revert ing"updated core version (#2020)"

* BUGFIX/HCMPRE-1583 fixes

---------

Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org>
nipunarora-eGov added a commit that referenced this pull request Dec 16, 2024
* Update MicroplanSearch.js

* Pagination issues

---------

Co-authored-by: Nipun Arora <aroranipun1@gmail.com>
nipunarora-eGov pushed a commit that referenced this pull request Dec 16, 2024
* Revert "Bugfix/hcmpre 1583 (#2021)"

This reverts commit 201a0ce.

* BUGFIX/HCMPRE-1634 Revert ing"updated core version (#2020)"

* BUGFIX/HCMPRE-1583 fixes

---------

Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org>
jagankumar-egov added a commit that referenced this pull request Dec 16, 2024
* Update UserManagement.js (#2017)

Co-authored-by: Nipun Arora <aroranipun1@gmail.com>

* updated core version (#2020)

* Bugfix/hcmpre 1583 (#2021)

* Update MicroplanSearch.js

* Pagination issues

---------

Co-authored-by: Nipun Arora <aroranipun1@gmail.com>

* BUGFIX/HCMPRE-1634: fix for versions (#2024)

* Revert "Bugfix/hcmpre 1583 (#2021)"

This reverts commit 201a0ce.

* BUGFIX/HCMPRE-1634 Revert ing"updated core version (#2020)"

* BUGFIX/HCMPRE-1583 fixes

---------

Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org>

* FEATURE/HCMPRE-1634:Fixed all the version updates (#2026)

FEATURE/HCMPRE-1634: Fixed all the version updates

* Update package.json

---------

Co-authored-by: Swathi-eGov <137176788+Swathi-eGov@users.noreply.github.com>
Co-authored-by: Nipun Arora <aroranipun1@gmail.com>
Co-authored-by: abishekTa-egov <abishek.t@egovernments.org>
Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org>
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