diff options
author | 2021-02-18 10:55:11 +0100 | |
---|---|---|
committer | 2021-02-18 10:55:11 +0100 | |
commit | f333557c8bf0a74eb7b88d6294dea2a420b1ec61 (patch) | |
tree | 696dabd7e02e97f53ff936e54543a31944696c3d /sdnr/wt/odlux/apps/networkMapApp/src/components/mapPopup.tsx | |
parent | 5cf15b27796b68b3edbfc1e59f258dee1e10b2b9 (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/mapPopup.tsx')
-rw-r--r-- | sdnr/wt/odlux/apps/networkMapApp/src/components/mapPopup.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
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> = (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> = (props) => { <Select style={{ width: 300 }} onChange={handleChange} value={value} native> <option value={""} disabled>{props.type} ids</option> { - props.ids.map(id => <option key={id} value={id}>{id}</option>) + props.elements.map(el => <option key={el.id} value={el.id}>{el.name}</option>) } </Select> </Paper> @@ -75,17 +75,17 @@ const MapPopup: React.FunctionComponent<props> = (props) => { type props = Connect<typeof mapStateToProps, typeof mapDispatchToProps>& { 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()), |