From 96a32242fda3ad2c085f228adaa7f4c1f8fbfb4c Mon Sep 17 00:00:00 2001 From: claudiaHash <49017601+claudiaHash@users.noreply.github.com> Date: Fri, 7 May 2021 10:53:26 +0300 Subject: [PATCH 1/2] hide Web3Feedback for private algorithms (#587) * hide Web3Feedback for private algorithms * correct private algo check * remove redundant check Co-authored-by: claudia.holhos --- src/components/organisms/AssetActions/Compute/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/AssetActions/Compute/index.tsx b/src/components/organisms/AssetActions/Compute/index.tsx index 06089e9de..848844239 100644 --- a/src/components/organisms/AssetActions/Compute/index.tsx +++ b/src/components/organisms/AssetActions/Compute/index.tsx @@ -491,7 +491,9 @@ export default function Compute({ action={} /> )} - + {type !== 'algorithm' && ( + + )} ) From f5da6e4b0bd1d901a4dcfef07ee1c31eee48f963 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Mon, 10 May 2021 12:38:24 +0300 Subject: [PATCH 2/2] Issue 560 empty search (#561) * upgrading to ocean.js 0.14.6 * Empty search gives all results * Using ocean.js 13.0 * onBlur empty search when deleting text * making empty search automatic on change * removing console log messages * including the search bar on results page * keeping searchbox visible after an empty search * refactoring If statement --- src/components/molecules/SearchBar.tsx | 22 ++++++++++++++++------ src/pages/search.tsx | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/components/molecules/SearchBar.tsx b/src/components/molecules/SearchBar.tsx index c3112493d..78e65a95e 100644 --- a/src/components/molecules/SearchBar.tsx +++ b/src/components/molecules/SearchBar.tsx @@ -17,20 +17,30 @@ export default function SearchBar({ filters?: boolean size?: 'small' | 'large' }): ReactElement { - const [value, setValue] = useState(initialValue || '') - - function handleChange(e: ChangeEvent) { - setValue(e.target.value) - } + let [value, setValue] = useState(initialValue || '') async function startSearch(e: FormEvent) { e.preventDefault() - if (value === '') return + if (value === '') value = ' ' const urlEncodedValue = encodeURIComponent(value) const url = await addExistingParamsToUrl(location, 'text') navigate(`${url}&text=${urlEncodedValue}`) } + async function emptySearch() { + const searchParams = new URLSearchParams(window.location.href) + const text = searchParams.get('text') + if (text !== ('' || undefined || null)) { + const url = await addExistingParamsToUrl(location, 'text') + navigate(`${url}&text=%20`) + } + } + + function handleChange(e: ChangeEvent) { + setValue(e.target.value) + e.target.value === '' && emptySearch() + } + return (
diff --git a/src/pages/search.tsx b/src/pages/search.tsx index d6743f445..cd6a5946c 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -20,7 +20,7 @@ export default function PageGatsbySearch(props: PageProps): ReactElement { ? `Published by ${accountTruncate(owner as string)}` : `${ totalResults !== undefined - ? searchValue + ? searchValue && searchValue !== ' ' ? totalResults === 0 ? 'No results' : totalResults +