summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-09-03 18:16:13 +0200
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-09-03 18:16:13 +0200
commit65ffa99d96e7b443e3d74ec20bbd321fd66aa76d (patch)
tree1c60e54fec94f80c96fb8a30c3dfbaf47ebe7573 /sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
parent6a81f77f1f13332dd1784aeae9a27c322c8e556b (diff)
Update NetworkMap
update networkmap Issue-ID: CCSDK-2713 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com> Change-Id: I97b0950a4d7f98fdb9044c1e05dfa8dfca34efaf
Diffstat (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx')
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx6
1 files changed, 4 insertions, 2 deletions
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<searchBarProps> = (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<searchBarProps> = (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)}
/>