-
Notifications
You must be signed in to change notification settings - Fork 13
AMM-1564 Dispense Screen changes #71
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
Conversation
WalkthroughThe changes shift the disabling of input fields from the template layer to the TypeScript logic in both batch and prescription drug forms. Instead of using Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Template
participant Component TS
participant FormGroup
User->>Template: Loads form
Template->>Component TS: Calls form group initializer
Component TS->>FormGroup: Initializes controls (with disabled states)
FormGroup->>Template: Provides control states
User->>Template: Attempts to interact with inputs
Template->>FormGroup: Forwards input if enabled
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. π§ ESLint
npm error Exit handler never called! β¨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration 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
π§Ή Nitpick comments (1)
src/app/app-modules/core/components/rx-batch-view/rx-batch-view.component.ts (1)
168-171: Simplify the ternary operator and approve the centralized form control approach.The approach of centralizing disabled state in form controls is excellent. However, line 170 contains an unnecessary ternary operator that can be simplified.
Apply this diff to simplify the ternary operator:
- quantity: [{ value: batch.quantity, disabled: selection === 1 ? true : false }], + quantity: [{ value: batch.quantity, disabled: selection === 1 }],π§° Tools
πͺ Biome (1.9.4)
[error] 170-170: 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: CHILL
Plan: Pro
π Files selected for processing (4)
src/app/app-modules/core/components/rx-batch-view/rx-batch-view.component.html(0 hunks)src/app/app-modules/core/components/rx-batch-view/rx-batch-view.component.ts(1 hunks)src/app/app-modules/rx/rx-item-dispense/rx-item-dispense.component.html(0 hunks)src/app/app-modules/rx/shared/utility/prescribed-drug.utility.ts(1 hunks)
π€ Files with no reviewable changes (2)
- src/app/app-modules/core/components/rx-batch-view/rx-batch-view.component.html
- src/app/app-modules/rx/rx-item-dispense/rx-item-dispense.component.html
π§° Additional context used
πͺ Biome (1.9.4)
src/app/app-modules/core/components/rx-batch-view/rx-batch-view.component.ts
[error] 170-170: 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)
β° Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build
π Additional comments (1)
src/app/app-modules/rx/shared/utility/prescribed-drug.utility.ts (1)
47-66: LGTM! Excellent centralization of form control state management.The implementation correctly centralizes disabled state management in the form controls. The selective enabling of
genericDrugName,drugStrength, anddrugIDwhile disabling other fields shows thoughtful consideration of the user interface requirements.



π Description
JIRA ID: AMM-1564
Added disabled in formGroup
β Type of Change
βΉοΈ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.
Summary by CodeRabbit