From f333557c8bf0a74eb7b88d6294dea2a420b1ec61 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Thu, 18 Feb 2021 10:55:11 +0100 Subject: 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 Change-Id: Ia5690c5039d7a9431443bc131fe398cc79d08287 --- .../src/components/details/details.tsx | 17 ++- .../src/components/details/linkDetails.tsx | 2 +- .../src/components/details/siteDetails.tsx | 121 ++++++++++++++++----- .../apps/networkMapApp/src/components/map.tsx | 48 ++++---- .../apps/networkMapApp/src/components/mapPopup.tsx | 12 +- .../networkMapApp/src/components/searchBar.tsx | 12 +- 6 files changed, 135 insertions(+), 77 deletions(-) (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/components') diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx index 081276b5c..2540b20a7 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx @@ -20,7 +20,7 @@ import * as React from 'react' import connect, { IDispatcher, Connect } from '../../../../../framework/src/flux/connect'; -import { site, Device } from '../../model/site'; +import { Site, Device } from '../../model/site'; import Typography from '@material-ui/core/Typography'; import { link } from '../../model/link'; import { Breadcrumbs, Link, Paper } from '@material-ui/core'; @@ -76,7 +76,7 @@ const Details: React.FunctionComponent = (props) => { }, [props.data]) const onLinkClick = async (id: string) => { - const result = await fetch(`${URL_API}/link/${id}`); + const result = await fetch(`${URL_API}/links/${id}`); if(result.ok){ const resultAsJson = await result.json(); const link = resultAsJson as link; @@ -102,10 +102,9 @@ const Details: React.FunctionComponent = (props) => { e.preventDefault(); } - const createDetailPanel = (data: site | link) => { - + const createDetailPanel = (data: Site | link) => { if (isSite(data)) { - return + return } else { return } @@ -120,7 +119,7 @@ const Details: React.FunctionComponent = (props) => { const loadDetailsData = (id: string) =>{ - fetch(`${URL_API}/link/${id}`) + fetch(`${URL_API}/links/${id}`) .then(res => { if (res.ok) return res.json() @@ -135,7 +134,7 @@ const Details: React.FunctionComponent = (props) => { }) .catch(error => { - fetch(`${URL_API}/site/${id}`) + fetch(`${URL_API}/sites/name/${id}`) .then(res => { if (res.ok) return res.json() @@ -188,13 +187,13 @@ const mapStateToProps = (state: IApplicationStoreState) => ({ }); 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)), clearDetails: () => dispatcher.dispatch(new ClearDetailsAction()), addHistory: (newEntry: HistoryEntry) => dispatcher.dispatch(new AddToHistoryAction(newEntry)), clearHistory: () => dispatcher.dispatch(new ClearHistoryAction()), highlightLink: (link: link) => dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: site) => dispatcher.dispatch(new HighlightSiteAction(site)), + highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), loadDevices: async (networkElements: Device[]) => { await dispatcher.dispatch(CheckDeviceList(networkElements)) }, navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path, "test3")), undoMapSelection: () => dispatcher.dispatch(new RemoveHighlightingAction()) diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx index 81f9bba90..b2c724636 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx @@ -77,7 +77,7 @@ const LinkDetails: React.FunctionComponent = (props) => { {name:"Site Name", val1: props.link.siteA, val2: props.link.siteB}, {name:"Latitude", val1: LatLonToDMS(props.link.locationA.lat), val2: LatLonToDMS(props.link.locationB.lat)}, {name:"Longitude", val1: LatLonToDMS(props.link.locationA.lon, true), val2: LatLonToDMS(props.link.locationB.lon, true)}, - {name:"Azimuth in °", val1: props.link.azimuthA.toFixed(2), val2: props.link.azimuthB.toFixed(2)} + props.link.azimuthA!= null && props.link.azimuthB != null && {name:"Azimuth in °", val1: props.link.azimuthA.toFixed(2), val2: props.link.azimuthB.toFixed(2)} ]; return (
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx index 5e617be2d..3aa35c348 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx @@ -23,19 +23,28 @@ import { TextField, Tabs, Tab, Typography, AppBar, Button, Tooltip } from '@mate import MaterialTable, { ColumnModel, ColumnType, MaterialTableCtorType } from "../../../../../framework/src/components/material-table"; -import { site, Device } from '../../model/site'; +import { Site, Device, Address } from '../../model/site'; import DenseTable from '../denseTable'; import { LatLonToDMS } from '../../utils/mapUtils'; +import { CheckDeviceList, InitializeLoadedDevicesAction } from '../../actions/detailsAction'; +import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; +import connect, { Connect, IDispatcher } from '../../../../../framework/src/flux/connect'; +import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -type minLinks = { name: string, azimuth: string} - -const FaultAlarmNotificationTable = MaterialTable as MaterialTableCtorType; +type linkRow = { name: string, azimuth?: string} +type deviceRow = { id: string;type: string,name: string,manufacturer: string,owner: string,status?: string,port: number[]} type panelId="links" | "nodes"; -type props = { site: site, updatedDevices: Device[]|null, navigate(applicationName: string, path?: string):void, onLinkClick(id: string): void, loadDevices(devices:Device[]): void }; +type siteDetailProps = { + site: Site, + onLinkClick(id: string): void, +} & props; + +type props = Connect; + -const SiteDetails: React.FunctionComponent = (props) => { +const SiteDetails: React.FunctionComponent = (props) => { const [value, setValue] = React.useState("links"); const [height, setHeight] = React.useState(330); @@ -59,21 +68,51 @@ const SiteDetails: React.FunctionComponent = (props) => { // on update React.useEffect(()=>{ - - props.loadDevices(props.site.devices); + + if(props.site.devices!== null && props.site.devices.length>0){ + props.initializeDevices(props.site.devices); + props.loadDevices(props.site.devices); + } + handleResize(); - }, [props.site]) + }, [props.site]); const onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: panelId) => { setValue(newValue); } - const linkRows: minLinks[] = props.site.links.map(link=> + //prepare link table + + let hasAzimuth = false; + const linkRows: linkRow[] = props.site.links.map(link=> { - return {name: link.name, azimuth: link.azimuthB.toFixed(2) } + if(link.azimuthB!==null){ + hasAzimuth=true; + return {name: link.name, azimuth: link.azimuthB.toFixed(2) } + + }else{ + return {name: link.name } + } + }); + + const linkTableHeader = hasAzimuth ? ["Link Name", "Azimuth in °"] : ["Link Name"]; + + //prepare device table + const deviceRows : deviceRow[] = props.updatedDevices.map(device=>{ + return{ + id: device.id, + name: device.name, + type: device.type, + status: device.status, + manufacturer: device.manufacturer, + owner: device.owner, + port: device.port + } + }); + const adressString = props.site.address == null ? null : buildAdress(props.site.address); return (
@@ -88,20 +127,20 @@ const SiteDetails: React.FunctionComponent = (props) => { } { - props.site.address !== undefined && props.site.address.length > 0 && - + adressString !== null && + } { - props.site.heighAGLInMeters !== undefined && props.site.heighAGLInMeters > 0 && - + props.site.heightAmslInMeters !== undefined && props.site.heightAmslInMeters > 0 && + } { - props.site.antennaHeightAGLInMeters !== undefined && props.site.antennaHeightAGLInMeters > 0 && - + props.site.antennaHeightAmslInMeters !== undefined && props.site.antennaHeightAmslInMeters > 0 && + } - - + + @@ -119,13 +158,8 @@ const SiteDetails: React.FunctionComponent = (props) => { { props.site.links.length > 0 && - - /** - * - * */ - - - } + + } @@ -134,19 +168,46 @@ const SiteDetails: React.FunctionComponent = (props) => { value === "nodes" && <> { - props.site.devices.length === 0 && + props.site.devices === null && No nodes available. } { - props.site.devices.length>0 && props.updatedDevices !== null && - + props.site.devices?.length>0 && props.updatedDevices !== null && + } }
) +} + +const buildAdress = (adress: Address) =>{ + switch(adress.country){ + case "de": + return `${adress.streetAndNr}, ${adress.zipCode!== null? adress.zipCode : ''} ${adress.city}` + + case "us": + return `${adress.streetAndNr}, ${adress.city} ${adress.zipCode!== null? adress.zipCode : ''}` + + default: + console.log("address formatting for country {"+adress.country+"} not recognized, defaulting."); + return `${adress.streetAndNr}, ${adress.zipCode!== null? adress.zipCode : ''} ${adress.city}` + } + + } -export default SiteDetails; \ No newline at end of file +const mapStateToProps = (state: IApplicationStoreState) => ({ + updatedDevices: state.network.details.checkedDevices +}); + +const mapDispatchToProps = (dispatcher: IDispatcher) => ({ + initializeDevices: (devices: Device[]) => {dispatcher.dispatch(new InitializeLoadedDevicesAction(devices))}, + loadDevices: async (networkElements: Device[]) => { await dispatcher.dispatch(CheckDeviceList(networkElements)) }, + navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path, "test3")), + +}) + +export default connect(mapStateToProps, mapDispatchToProps)(SiteDetails); \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/map.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/map.tsx index e2935f6b7..855e5cedf 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/map.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/map.tsx @@ -21,7 +21,7 @@ import * as mapboxgl from 'mapbox-gl'; import { RouteComponentProps, withRouter } from 'react-router-dom'; -import { site } from '../model/site'; +import { Site } from '../model/site'; import { SelectSiteAction, ClearHistoryAction, SelectLinkAction } from '../actions/detailsAction'; import { OSM_STYLE, URL_API, URL_BASEPATH, URL_TILE_API } from '../config'; import { link } from '../model/link'; @@ -36,13 +36,10 @@ import SearchBar from './searchBar'; import { verifyResponse, IsTileServerReachableAction, handleConnectionError, setTileServerReachableAction } from '../actions/connectivityAction'; import ConnectionInfo from './connectionInfo' import { showIconLayers, addBaseLayers, addBaseSources, addIconLayers } from '../utils/mapLayers'; -import lamp from '../../icons/lamp.png'; -import apartment from '../../icons/apartment.png'; -import datacenter from '../../icons/datacenter.png'; -import factory from '../../icons/factory.png'; import Statistics from './statistics'; import IconSwitch from './iconSwitch'; import { addImages } from '../services/mapImagesService'; +import { PopupElement } from '../model/popupElements'; type coordinates = { lat: number, lon: number, zoom: number } @@ -86,7 +83,7 @@ class Map extends React.Component { console.error("tileserver " + URL_TILE_API + " can't be reached."); }); - fetch(URL_API + "/info") + fetch(URL_API + "/info/count/all") .then(result => verifyResponse(result)) .catch(error => this.props.handleConnectionError(error)); } @@ -132,7 +129,7 @@ class Map extends React.Component { const boundingBox = increaseBoundingBox(map); - fetch(`${URL_API}/links/geoJson/${boundingBox.west},${boundingBox.south},${boundingBox.east},${boundingBox.north}`) + fetch(`${URL_API}/links/geojson/${boundingBox.west},${boundingBox.south},${boundingBox.east},${boundingBox.north}`) .then(result => verifyResponse(result)) .then(result => result.json()) .then(features => { @@ -143,7 +140,7 @@ class Map extends React.Component { .catch(error => this.props.handleConnectionError(error)); - fetch(`${URL_API}/sites/geoJson/${boundingBox.west},${boundingBox.south},${boundingBox.east},${boundingBox.north}`) + fetch(`${URL_API}/sites/geojson/${boundingBox.west},${boundingBox.south},${boundingBox.east},${boundingBox.north}`) .then(result => verifyResponse(result)) .then(result => result.json()) .then(features => { @@ -439,8 +436,8 @@ class Map extends React.Component { if (lastBoundingBox == null) { lastBoundingBox = bbox; - await this.draw('lines', `${URL_API}/links/geoJson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); - await this.draw('points', `${URL_API}/sites/geoJson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); + await this.draw('lines', `${URL_API}/links/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); + await this.draw('points', `${URL_API}/sites/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); } else { // new bbox is bigger than old one @@ -451,8 +448,8 @@ class Map extends React.Component { //calculate new boundingBox const increasedBoundingBox = increaseBoundingBox(map); - await this.draw('lines', `${URL_API}/links/geoJson/${increasedBoundingBox.west},${increasedBoundingBox.south},${increasedBoundingBox.east},${increasedBoundingBox.north}`); - await this.draw('points', `${URL_API}/sites/geoJson/${increasedBoundingBox.west},${increasedBoundingBox.south},${increasedBoundingBox.east},${increasedBoundingBox.north}`); + await this.draw('lines', `${URL_API}/links/geojson/${increasedBoundingBox.west},${increasedBoundingBox.south},${increasedBoundingBox.east},${increasedBoundingBox.north}`); + await this.draw('points', `${URL_API}/sites/geojson/${increasedBoundingBox.west},${increasedBoundingBox.south},${increasedBoundingBox.east},${increasedBoundingBox.north}`); } else if (lastBoundingBox.contains(bbox.getNorthEast()) && lastBoundingBox.contains(bbox.getSouthWest())) { // last one contains new one // bbox is contained in last one, do nothing @@ -462,8 +459,8 @@ class Map extends React.Component { lastBoundingBox.extend(bbox); - await this.draw('lines', `${URL_API}/links/geoJson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); - await this.draw('points', `${URL_API}/sites/geoJson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); + await this.draw('lines', `${URL_API}/links/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); + await this.draw('points', `${URL_API}/sites/geojson/${lastBoundingBox.getWest()},${lastBoundingBox.getSouth()},${lastBoundingBox.getEast()},${lastBoundingBox.getNorth()}`); } } @@ -481,18 +478,18 @@ class Map extends React.Component { showSitePopup = (sites: mapboxgl.MapboxGeoJSONFeature[], top: number, left: number) => { if (sites.length > 1) { - const ids = sites.map(feature => feature.properties!.id); + const elements: PopupElement[] = sites.map(feature => {return {name: feature.properties!.name, id: feature.properties!.id}}); this.props.setPopupPosition(top, left); - this.props.selectMultipleSites(ids); + this.props.selectMultipleSites(elements); //name, id object container this.setState({ isPopupOpen: true }); } else { const id = sites[0].properties!.id; - fetch(`${URL_API}/site/${id}`) + fetch(`${URL_API}/sites/${id}`) .then(result => verifyResponse(result)) - .then(res => res.json() as Promise) + .then(res => res.json() as Promise) .then(result => { this.props.selectSite(result); this.props.highlightSite(result); @@ -506,15 +503,16 @@ class Map extends React.Component { if (links.length > 1) { - const ids = links.map(feature => feature.properties!.id as string); + const elements: PopupElement[] = links.map(feature => {return {name: feature.properties!.name, id: feature.properties!.id}}); + this.props.setPopupPosition(top, left); - this.props.selectMultipleLinks(ids); + this.props.selectMultipleLinks(elements); this.setState({ isPopupOpen: true }); } else { var id = links[0].properties!.id; - fetch(`${URL_API}/link/${id}`) + fetch(`${URL_API}/links/${id}`) .then(result => verifyResponse(result)) .then(res => res.json() as Promise) .then(result => { @@ -578,14 +576,14 @@ const mapStateToProps = (state: IApplicationStoreState) => ({ }); 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)), clearDetailsHistory: () => dispatcher.dispatch(new ClearHistoryAction()), - selectMultipleLinks: (ids: string[]) => dispatcher.dispatch(new SelectMultipleLinksAction(ids)), - selectMultipleSites: (ids: string[]) => dispatcher.dispatch(new SelectMultipleSitesAction(ids)), + selectMultipleLinks: (ids: PopupElement[]) => dispatcher.dispatch(new SelectMultipleLinksAction(ids)), + selectMultipleSites: (ids: PopupElement[]) => dispatcher.dispatch(new SelectMultipleSitesAction(ids)), setPopupPosition: (x: number, y: number) => dispatcher.dispatch(new SetPopupPositionAction(x, y)), highlightLink: (link: link) => dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: site) => dispatcher.dispatch(new HighlightSiteAction(site)), + highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), updateMapPosition: (lat: number, lon: number, zoom: number) => dispatcher.dispatch(new SetCoordinatesAction(lat, lon, zoom)), setStatistics: (linkCount: string, siteCount: string) => dispatcher.dispatch(new SetStatistics(siteCount, linkCount)), setTileServerLoaded: (reachable: boolean) => dispatcher.dispatch(setTileServerReachableAction(reachable)), diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/components/mapPopup.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/components/mapPopup.tsx index 040024760..7435a0a3f 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/mapPopup.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/mapPopup.tsx @@ -19,7 +19,7 @@ import * as React from 'react'; import { Typography, Select, MenuItem, ClickAwayListener, Popper, Paper, FormGroup, Portal, Popover } from '@material-ui/core'; import { SelectSiteAction, ClearHistoryAction, ClearDetailsAction } from '../actions/detailsAction'; -import { site } from '../model/site'; +import { Site } from '../model/site'; import { link } from '../model/link'; import { URL_API } from '../config'; import { HighlightLinkAction, HighlightSiteAction } from '../actions/mapActions'; @@ -40,7 +40,7 @@ const MapPopup: React.FunctionComponent = (props) => { const id = event.target.value; - fetch(`${URL_API}/${props.type}/${id}`) + fetch(`${URL_API}/${props.type.toLocaleLowerCase()}s/${id}`) .then(result => verifyResponse(result)) .then(res => res.json()) .then(result => { @@ -64,7 +64,7 @@ const MapPopup: React.FunctionComponent = (props) => { @@ -75,17 +75,17 @@ const MapPopup: React.FunctionComponent = (props) => { type props = Connect& { onClose(): void } const mapStateToProps = (state: IApplicationStoreState) => ({ - ids: state.network.popup.selectionPendingForIds, + elements: state.network.popup.selectionPendingForElements, type: state.network.popup.pendingDataType, position: state.network.popup.position }); const mapDispatchToProps = (dispatcher: IDispatcher) => ({ - selectElement: (site: site) => dispatcher.dispatch(new SelectSiteAction(site)), + selectElement: (site: Site) => dispatcher.dispatch(new SelectSiteAction(site)), clearDetailsHistory:()=> dispatcher.dispatch(new ClearHistoryAction()), highlightLink: (link: link) => dispatcher.dispatch(new HighlightLinkAction(link)), - highlightSite: (site: site) => dispatcher.dispatch(new HighlightSiteAction(site)), + highlightSite: (site: Site) => dispatcher.dispatch(new HighlightSiteAction(site)), handleConnectionError: (error:Error) => dispatcher.dispatch(handleConnectionError(error)), clearDetails: () => dispatcher.dispatch(new ClearDetailsAction()), 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 = (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 = (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 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)), });; -- cgit 1.2.3-korg