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

#6083 #6090 #6061 #6059 Prescription hotfixes x4 #6104

Open
wants to merge 5 commits into
base: V2.5.0-RC
Choose a base branch
from

Conversation

CarlosNZ
Copy link
Contributor

@CarlosNZ CarlosNZ commented Jan 16, 2025

Fixes #6083 #6090 #6061 #6059

(There's one more dispensing hotfix (#6078), but that'll require a bit more thinking about, so will do separately.)

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Four small fixes for the above issues.

I've done each in a different commit, so you can review them individually if you like:

#6083 e249b56
#6090 d6767fb
#6061 9b825cd
#6059 3953898

I've also mentioned the issue # in my review comments below.

πŸ’Œ Any notes for the reviewer?

See review comments for more details

πŸ§ͺ Testing

These are all really tiny, so please just refer to the original issues and confirm behaviour is fixed when doing the "How to reproduce" steps.

@github-actions github-actions bot added this to the V2.5.0-RC4 milestone Jan 16, 2025
@github-actions github-actions bot added bug Something is borken Team Piwakawaka James, Chris, Carl Severity: Hotfix Extreme user impact. Can't finalise invoices. Needs patch release and installation immediately. feature: dispensing labels Jan 16, 2025
Copy link

Bundle size difference

Comparing this PR to main

Old size New size Diff
5.15 MB 5.15 MB 165 B (0.00%)

Comment on lines +50 to +54
accessor: ({ rowData }) =>
NumUtils.round(
(rowData.numberOfPacks ?? 0) * (rowData.packSize ?? 1),
3
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#6059 Fix for expando columns -- just missed one place where this calculation was needed again (didn't look at the Expando columns originally)

@@ -138,6 +138,7 @@ export const PrescriptionLineEditView = () => {
);
}
setIsDirty(false);
setAllDraftLines({});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #6061. Problem was the item ended up in the allDraftLines array twice -- once indexed by "new" and once indexed by its ID. Best to just start with a fresh object after a save (same as when you first load the page).

@@ -54,8 +57,9 @@ export const usePrescriptionLineEditRows = (rows: DraftStockOutLine[]) => {
}, [allocatableRows, wrongPackSizeRows, onHoldRows, noStockRows]);

const disabledRows = useMemo(() => {
if (isDisabled) return orderedRows;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #6083

If the prescription is verified, it is disabled, so we make sure all rows are disabled.

Unfortunately adds another prop that must be passed down through about 3 levels πŸ™„

Comment on lines -409 to +411
decimalLimit={2}
min={0}
// We're not allowing non-integer values (decimalLimit=0), as you can only
// issue whole units
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #6090. Remove decimalLimit prop which forces an integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is borken feature: dispensing Severity: Hotfix Extreme user impact. Can't finalise invoices. Needs patch release and installation immediately. Team Piwakawaka James, Chris, Carl
Projects
None yet
1 participant