From 26c8d9951cac5231fae5aa90b1df5cd3bbe511a3 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 19 May 2022 07:59:08 -0500 Subject: disable repeat search and download buttons when disconnected --- src/web/src/components/Search/Detail/SearchDetail.js | 4 +++- src/web/src/components/Search/Detail/SearchDetailHeader.js | 4 ++-- src/web/src/components/Search/Response.js | 2 +- src/web/src/components/Search/Searches.js | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/web/src/components/Search/Detail/SearchDetail.js b/src/web/src/components/Search/Detail/SearchDetail.js index 880d5cd0..9c66d4e0 100644 --- a/src/web/src/components/Search/Detail/SearchDetail.js +++ b/src/web/src/components/Search/Detail/SearchDetail.js @@ -21,7 +21,7 @@ const sortDropdownOptions = [ { key: 'queueLength', text: 'Queue Depth (Least to Most)', value: 'queueLength' } ]; -const SearchDetail = ({ search, creating, stopping, removing, onCreate, onStop, onRemove }) => { +const SearchDetail = ({ search, creating, stopping, removing, disabled, onCreate, onStop, onRemove }) => { const { id, state, isComplete, fileCount, lockedFileCount, responseCount } = search; const [loading, setLoading] = useState(false); @@ -132,6 +132,7 @@ const SearchDetail = ({ search, creating, stopping, removing, onCreate, onStop, removing={removing} stopping={stopping} creating={creating} + disabled={disabled} search={search} onCreate={create} onStop={onStop} @@ -195,6 +196,7 @@ const SearchDetail = ({ search, creating, stopping, removing, onCreate, onStop, setHiddenResults([...hiddenResults, r.username])} isInitiallyFolded={foldResults} /> diff --git a/src/web/src/components/Search/Detail/SearchDetailHeader.js b/src/web/src/components/Search/Detail/SearchDetailHeader.js index d31f8a49..8eaf111c 100644 --- a/src/web/src/components/Search/Detail/SearchDetailHeader.js +++ b/src/web/src/components/Search/Detail/SearchDetailHeader.js @@ -9,7 +9,7 @@ import { } from 'semantic-ui-react'; import SearchStatusIcon from '../SearchStatusIcon'; -const SearchDetailHeader = ({ search, loading, loaded, creating, removing, stopping, onCreate, onStop, onRemove }) => { +const SearchDetailHeader = ({ search, loading, loaded, creating, removing, stopping, disabled, onCreate, onStop, onRemove }) => { const isSmallScreen = useMediaQuery({ query: '(max-width: 899px)' }); const isTinyScreen = useMediaQuery({ query: '(max-width: 684px)'}); @@ -26,7 +26,7 @@ const SearchDetailHeader = ({ search, loading, loaded, creating, removing, stopp const RefreshButton = () => loaded &&