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 --- .../src/components/details/details.tsx | 14 ++++++------- .../src/components/details/linkDetails.tsx | 17 ++++++++------- .../src/components/details/siteDetails.tsx | 24 +++++++++++----------- 3 files changed, 27 insertions(+), 28 deletions(-) (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/components/details') 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 a2e51d30f..081276b5c 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/details.tsx @@ -50,10 +50,9 @@ const Details: React.FunctionComponent = (props) => { }, []); - // if url changed + // if url changed, load details data React.useEffect(() => { const detailsId = getDetailsIdFromUrl(); - console.log(detailsId) if (detailsId !== null && props.data?.name !== detailsId) { loadDetailsData(detailsId) } @@ -154,16 +153,17 @@ const Details: React.FunctionComponent = (props) => { }) } + const panelId = props.data!== null ? (isSite(props.data) ? 'site-details-panel' : 'link-details-panel' ): 'details-panel'; return (
- + { props.breadcrumbs.length > 0 && - - + + {props.breadcrumbs[0].id} - + {props.data?.name} @@ -171,7 +171,7 @@ const Details: React.FunctionComponent = (props) => { { props.data !== null ? createDetailPanel(props.data) - : {message} + : {message} } 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 de1bf6b16..0c9f6034f 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx @@ -32,8 +32,7 @@ const LinkDetails: React.FunctionComponent = (props) => { const [height, setHeight] = React.useState(330); const handleResize = () =>{ - console.log("resize") - const el = document.getElementById('site-details-panel')?.getBoundingClientRect(); + const el = document.getElementById('link-details-panel')?.getBoundingClientRect(); const el2 = document.getElementById('site-tabs')?.getBoundingClientRect(); if(el && el2){ @@ -69,7 +68,7 @@ const LinkDetails: React.FunctionComponent = (props) => { const distance = props.link.length > 0 ? props.link.length : props.link.calculatedLength; const azimuthA = props.link.azimuthA; const azimuthB = props.link.azimuthB; - window.open(`/#/linkCalculation?lat1=${siteA.lat}&lon1=${siteA.lon}&lat2=${siteB.lat}&lon2=${siteB.lon}&siteA=${nameA}&siteB=${nameB}&azimuthA=${azimuthA}&azimuthB=${azimuthB}&distance=${distance}`) + window.open(`/#/linkCalculation?lat1=${siteA.lat}&lon1=${siteA.lon}&lat2=${siteB.lat}&lon2=${siteB.lon}&siteA=${nameA}&siteB=${nameB}&azimuthA=${azimuthA}&azimuthB=${azimuthB}&distance=${distance}&amslSiteA=${siteA.amsl}&AGLsiteA=${siteA.antennaHeight}&amslSiteB=${siteB.amsl}&AGLsiteB=${siteB.antennaHeight}`) } @@ -83,15 +82,15 @@ const LinkDetails: React.FunctionComponent = (props) => { return (

{props.link.name}

- - - - + + + + - SITE DETAILS + SITE DETAILS - + { props.link.type==="microwave" && } 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 a95666e38..92643d0c4 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx +++ b/sdnr/wt/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx @@ -81,28 +81,28 @@ const SiteDetails: React.FunctionComponent = (props) => {

{props.site.name}

{ props.site.operator !== '' && props.site.operator !== null ? - : - + : + } { props.site.type !== undefined && props.site.type.length > 0 && - + } { props.site.address !== undefined && props.site.address.length > 0 && - + } { props.site.heighAGLInMeters !== undefined && props.site.heighAGLInMeters > 0 && - + } { props.site.antennaHeightAGLInMeters !== undefined && props.site.antennaHeightAGLInMeters > 0 && - + } - - + + @@ -115,12 +115,12 @@ const SiteDetails: React.FunctionComponent = (props) => { <> { props.site.links.length === 0 && - No links available. + No links available. } { props.site.links.length > 0 && - + /** * * */ @@ -136,12 +136,12 @@ const SiteDetails: React.FunctionComponent = (props) => { <> { props.site.devices.length === 0 && - No nodes available. + No nodes available. } { props.site.devices.length>0 && props.updatedDevices !== null && - + } } -- cgit 1.2.3-korg