Skip to content

Conversation

@mohan-13
Copy link
Member

JIRABN-84

Description

This PR applies part of the changes for BN-84. This introduces the Zustand package which is used for central state management. The state management is introduced for the DiagnosisForm component. All the props for the form has been removed and the state management happens with Zustand store. This also address the adding an Inline error when certainty is not selected for diagnosis


Key Features

  • Adds Zustand library for State Management
  • DiagnosisForm Component is refactored to use store instead of props based states.
  • Inline error for Certainty is handled using store.

Implementation Details

  • State Management
    This PR introduces global state management for DiagnosisForm and ConsultationPad using Zustand library.

  • Internationalisation

    • Added a new label which can be used when required dropdowns does not have a value selected. A key with en translation containing Please select a value has been added.
  • Limitations

    • As a follow up PR, the InlineError for duplicate diagnosis will be refactored to disable the result from the combo box.
    • Also, Consultaion Pad tests will need to be refactored to remove redundant tests.

Screenshots

Feature / State Screenshot
Example: Before Refactoring image
Example: After Refactoring image

Note: Please ensure sensitive information is not included in screenshots.



Important

Checklist

  • Code adheres to project linting and formatting standards.
  • New components added to Storybook.
  • Tests written and passing (unit + integration).
  • Labels and text support i18n.
  • Follows accessibility and responsive design guidelines.
  • PR reviewed by at least one other developer.

Reviewer(s)

@bahnew/developers
Kindly review the proposed changes when convenient. Your feedback is appreciated.


@mohan-13 mohan-13 changed the title Bn 84 BN-84 | Use Zustand Store for DiagnosesForm May 29, 2025
@mohan-13 mohan-13 merged commit 5a496c0 into main May 29, 2025
2 checks passed
@mohan-13 mohan-13 deleted the BN-84 branch May 29, 2025 07:46
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