fix: align frontend types and tests for react 19 (#339)
This commit is contained in:
@@ -6,7 +6,7 @@ import { ConfirmModal, MedicationAvatar } from "../components";
|
||||
import { useAuth } from "../components/Auth";
|
||||
import { useAppContext } from "../context";
|
||||
import { useModalHistory } from "../hooks";
|
||||
import { getMedDisplayName } from "../types";
|
||||
import { type Coverage, getMedDisplayName } from "../types";
|
||||
import { formatNumber, getExpiryClass, getSystemLocale } from "../utils/formatters";
|
||||
import { expandDoseIds, getStockStatus, isDoseDismissed } from "../utils/schedule";
|
||||
import {
|
||||
|
||||
@@ -719,6 +719,7 @@ export function MedicationsPage() {
|
||||
setReadOnlyView(true);
|
||||
startEdit(med, openEditModal);
|
||||
setViewMode("form");
|
||||
scrollToTopForDesktopEdit();
|
||||
};
|
||||
setUnsavedConfirmSource(showEditModal ? "mobile-edit" : "desktop-form");
|
||||
setShowUnsavedConfirm(true);
|
||||
@@ -729,6 +730,7 @@ export function MedicationsPage() {
|
||||
setActiveTab("general");
|
||||
startEdit(med, openEditModal);
|
||||
setViewMode("form");
|
||||
scrollToTopForDesktopEdit();
|
||||
}
|
||||
|
||||
function handleNewEntryClick() {
|
||||
@@ -792,6 +794,7 @@ export function MedicationsPage() {
|
||||
setActiveTab("general");
|
||||
startEdit(medicationToEdit, openEditModal);
|
||||
setViewMode("form");
|
||||
scrollToTopForDesktopEdit();
|
||||
setPendingEditTransition(false);
|
||||
window.dispatchEvent(new Event("medassist:edit-transition-ready"));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Coverage } from "../types";
|
||||
import type { Coverage, PackageType } from "../types";
|
||||
import { getMedTotal as getMedTotalFromTypes } from "../types";
|
||||
import { splitCurrentBlisterStock } from "../utils/stock";
|
||||
|
||||
@@ -43,9 +43,12 @@ export function getMedTotal(med: {
|
||||
pillsPerBlister: number;
|
||||
looseTablets: number;
|
||||
stockAdjustment?: number | null;
|
||||
packageType?: string;
|
||||
packageType?: PackageType;
|
||||
}): number {
|
||||
return getMedTotalFromTypes(med);
|
||||
return getMedTotalFromTypes({
|
||||
...med,
|
||||
stockAdjustment: med.stockAdjustment ?? undefined,
|
||||
});
|
||||
}
|
||||
|
||||
export function getReminderStatusData(
|
||||
|
||||
Reference in New Issue
Block a user