From 65ffa99d96e7b443e3d74ec20bbd321fd66aa76d Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Thu, 3 Sep 2020 18:16:13 +0200 Subject: Update NetworkMap update networkmap Issue-ID: CCSDK-2713 Signed-off-by: Aijana Schumann Change-Id: I97b0950a4d7f98fdb9044c1e05dfa8dfca34efaf --- sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx') diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx index 0c7607bb7..c825e5ae0 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx @@ -79,11 +79,13 @@ const SearchBar: React.FunctionComponent = (props) =>{ const linkResult = fetch(`${URL_API}/link/${props.searchterm}`); Promise.all([ siteResult, linkResult]).then((result)=>{ - const suceededResults = result.filter(el=> el!==undefined); + const suceededResults = result.filter(el=> el.ok); if(suceededResults.length==0){ setAnchorEl(divRef.current); setErrorMessage("No element found.") + // hide message after 3 sec + window.setTimeout(()=>{setAnchorEl(null)}, 3000); }else{ suceededResults[0].json().then(result =>{ @@ -115,7 +117,7 @@ const SearchBar: React.FunctionComponent = (props) =>{ disabled={!reachabe} className={classes.input} placeholder="Find sites or links by name" - inputProps={{ 'aria-label': 'search sites or links' }} + inputProps={{ 'aria-label': 'networkmap-searchbar' }} value={props.searchterm} onChange={e=> props.setSearchTerm(e.currentTarget.value)} /> -- cgit 1.2.3-korg