diff --git a/src/Common/hooks/useAppHistory.ts b/src/Common/hooks/useAppHistory.ts
index 893b1a06cfd..70ad92692de 100644
--- a/src/Common/hooks/useAppHistory.ts
+++ b/src/Common/hooks/useAppHistory.ts
@@ -10,14 +10,12 @@ export default function useAppHistory() {
const resetHistory = useContext(ResetHistoryContext);
const goBack = (fallbackUrl?: string) => {
- if (history.length > 1)
- // Navigate to history present in the app navigation history stack.
- return navigate(history[1]);
-
if (fallbackUrl)
- // Otherwise, use provided fallback url if provided.
+ // use provided fallback url if provided.
return navigate(fallbackUrl);
-
+ if (history.length > 1)
+ // Otherwise, navigate to history present in the app navigation history stack.
+ return navigate(history[1]);
// Otherwise, fallback to browser's go back behaviour.
window.history.back();
};
diff --git a/src/Components/Assets/AssetFilter.tsx b/src/Components/Assets/AssetFilter.tsx
index b0a870d0e31..299d67e5ab0 100644
--- a/src/Components/Assets/AssetFilter.tsx
+++ b/src/Components/Assets/AssetFilter.tsx
@@ -108,9 +108,9 @@ function AssetFilter(props: any) {
const applyFilter = () => {
const data = {
facility: facilityId,
- asset_type: asset_type,
- asset_class: asset_class,
- status: asset_status,
+ asset_type: asset_type ?? "",
+ asset_class: asset_class ?? "",
+ status: asset_status ?? "",
location: locationId,
};
onChange(data);
diff --git a/src/Components/Assets/AssetManage.tsx b/src/Components/Assets/AssetManage.tsx
index 825cee1c848..25f879ddd09 100644
--- a/src/Components/Assets/AssetManage.tsx
+++ b/src/Components/Assets/AssetManage.tsx
@@ -29,7 +29,7 @@ import { useTranslation } from "react-i18next";
const PageTitle = lazy(() => import("../Common/PageTitle"));
const Loading = lazy(() => import("../Common/Loading"));
import * as Notification from "../../Utils/Notifications.js";
-import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor";
+import AuthorizeFor, { NonReadOnlyUsers } from "../../Utils/AuthorizeFor";
import Uptime from "../Common/Uptime";
import useAuthUser from "../../Common/hooks/useAuthUser";
import dayjs from "dayjs";
@@ -452,7 +452,7 @@ const AssetManage = (props: AssetManageProps) => {
}
id="configure-asset"
data-testid="asset-configure-button"
- authorizeFor={NonReadOnlyUsers}
+ authorizeFor={AuthorizeFor(["DistrictAdmin", "StateAdmin"])}
>