From 5f203d5135a65e7ba9b1cd72843db4c8f744bc31 Mon Sep 17 00:00:00 2001 From: erinz2020 Date: Thu, 12 Dec 2024 20:00:07 +0000 Subject: [PATCH 1/7] configurable encounter search page --- frontend/src/AuthenticatedSwitch.jsx | 2 ++ frontend/src/FrontDesk.jsx | 2 ++ .../src/components/AuthenticatedAppHeader.jsx | 2 ++ frontend/src/components/header/Menu.jsx | 12 ++++++++++-- frontend/src/constants/navMenu.js | 19 ++++++++++++++++++- .../java/org/ecocean/api/SiteSettings.java | 4 ++++ .../bundles/commonConfiguration.properties | 3 +++ src/main/webapp/header.jsp | 4 +++- 8 files changed, 44 insertions(+), 4 deletions(-) diff --git a/frontend/src/AuthenticatedSwitch.jsx b/frontend/src/AuthenticatedSwitch.jsx index eb864a797c..bcdff0f5fc 100644 --- a/frontend/src/AuthenticatedSwitch.jsx +++ b/frontend/src/AuthenticatedSwitch.jsx @@ -19,6 +19,7 @@ export default function AuthenticatedSwitch({ showAlert, setShowAlert, showclassicsubmit, + showClassicEncounterSearch, }) { const { data } = useGetMe(); const username = data?.username; @@ -44,6 +45,7 @@ export default function AuthenticatedSwitch({ showAlert={showAlert} setShowAlert={setShowAlert} showclassicsubmit={showclassicsubmit} + showClassicEncounterSearch={showClassicEncounterSearch} /> diff --git a/frontend/src/FrontDesk.jsx b/frontend/src/FrontDesk.jsx index 10094e2a51..4a7d9ed69d 100644 --- a/frontend/src/FrontDesk.jsx +++ b/frontend/src/FrontDesk.jsx @@ -28,6 +28,7 @@ export default function FrontDesk() { const [loading, setLoading] = useState(true); const { data } = useGetSiteSettings(); const showclassicsubmit = data?.showClassicSubmit; + const showClassicEncounterSearch = data?.showClassicEncounterSearch; const checkLoginStatus = () => { axios @@ -93,6 +94,7 @@ export default function FrontDesk() { showAlert={showAlert} setShowAlert={setShowAlert} showclassicsubmit={showclassicsubmit} + showClassicEncounterSearch={showClassicEncounterSearch} /> ); diff --git a/frontend/src/components/AuthenticatedAppHeader.jsx b/frontend/src/components/AuthenticatedAppHeader.jsx index 70860a11fd..c00671eb96 100644 --- a/frontend/src/components/AuthenticatedAppHeader.jsx +++ b/frontend/src/components/AuthenticatedAppHeader.jsx @@ -13,6 +13,7 @@ export default function AuthenticatedAppHeader({ username, avatar, showclassicsubmit, + showClassicEncounterSearch, }) { const { visible } = useContext(FooterVisibilityContext); @@ -74,6 +75,7 @@ export default function AuthenticatedAppHeader({ - {authenticatedMenu(username, showclassicsubmit).map((item, idx) => ( + {authenticatedMenu( + username, + showclassicsubmit, + showClassicEncounterSearch, + ).map((item, idx) => (