summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2021-02-18 10:55:11 +0100
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2021-02-18 10:55:11 +0100
commitf333557c8bf0a74eb7b88d6294dea2a420b1ec61 (patch)
tree696dabd7e02e97f53ff936e54543a31944696c3d /sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
parent5cf15b27796b68b3edbfc1e59f258dee1e10b2b9 (diff)
Update NetworkMap and LinkCalculator
Update NetworkMap and LinkCalculator to use the topology-server-v2 API, minior bugfixes for NetworkMap Issue-ID: CCSDK-3172 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com> Change-Id: Ia5690c5039d7a9431443bc131fe398cc79d08287
Diffstat (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx')
-rw-r--r--sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
index c825e5ae0..2e698158d 100644
--- a/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
+++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/searchBar.tsx
@@ -22,7 +22,7 @@ import SearchIcon from '@material-ui/icons/Search';
import { URL_API } from '../config';
import { isSite } from '../utils/utils';
-import { site } from '../model/site';
+import { Site } from '../model/site';
import { link } from '../model/link';
import { SelectSiteAction, SelectLinkAction } from '../actions/detailsAction';
import { HighlightLinkAction, HighlightSiteAction, ZoomToSearchResultAction } from '../actions/mapActions';
@@ -74,9 +74,9 @@ const SearchBar: React.FunctionComponent<searchBarProps> = (props) =>{
setAnchorEl(null);
if(props.searchterm.length>0){
- const siteResult = fetch(`${URL_API}/site/${props.searchterm}`)
+ const siteResult = fetch(`${URL_API}/sites/name/${props.searchterm}`)
- const linkResult = fetch(`${URL_API}/link/${props.searchterm}`);
+ const linkResult = fetch(`${URL_API}/links/${props.searchterm}`);
Promise.all([ siteResult, linkResult]).then((result)=>{
const suceededResults = result.filter(el=> el.ok);
@@ -92,7 +92,7 @@ const SearchBar: React.FunctionComponent<searchBarProps> = (props) =>{
if(isSite(result)){
props.selectSite(result);
props.highlightSite(result);
- props.zoomToSearchResult(result.geoLocation.lat, result.geoLocation.lon);
+ props.zoomToSearchResult(result.location.lat, result.location.lon);
}else{
props.selectLink(result);
props.highlightLink(result);
@@ -149,10 +149,10 @@ type searchBarProps = Connect<typeof mapStateToProps, typeof mapDispatchToProps>
const mapDispatchToProps = (dispatcher: IDispatcher) => ({
- selectSite:(site: site)=> dispatcher.dispatch(new SelectSiteAction(site)),
+ selectSite:(site: Site)=> dispatcher.dispatch(new SelectSiteAction(site)),
selectLink:(link: link) => dispatcher.dispatch(new SelectLinkAction(link)),
highlightLink:(link: link)=> dispatcher.dispatch(new HighlightLinkAction(link)),
- highlightSite: (site: site) => dispatcher.dispatch(new HighlightSiteAction(site)),
+ highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)),
setSearchTerm: (value: string) => dispatcher.dispatch(new SetSearchValueAction(value)),
zoomToSearchResult: (lat: number, lon: number) => dispatcher.dispatch(new ZoomToSearchResultAction(lat, lon)),
});;