From: Ravi Pendurty Date: Thu, 28 Aug 2025 05:07:10 +0000 (+0530) Subject: Push artifacts to o-ran-sc nexus X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=cae4bfd215dbb52d9954255151aba14c9b943687;p=oam%2Foam-controller.git Push artifacts to o-ran-sc nexus Use maven deploy Issue-ID: OAM-486 Change-Id: Ie9aacd3fe411304db10ad7c34291bdcdeafbc999 Signed-off-by: Ravi Pendurty --- diff --git a/distribution/oam-controller/pom.xml b/distribution/oam-controller/pom.xml index 1df1832..42dd01c 100644 --- a/distribution/oam-controller/pom.xml +++ b/distribution/oam-controller/pom.xml @@ -36,8 +36,19 @@ opt/opendaylight deploy true - + + + + o-ran-sc-releases + ${o-ran-sc.nexus.release-url} + + + o-ran-sc-snapshots + ${o-ran-sc.nexus.snapshot-url} + + + ${ccsdk.feature.groupid} diff --git a/features/sdnr/odlux/helpserver/pom.xml b/features/sdnr/odlux/helpserver/pom.xml old mode 100755 new mode 100644 index 538f5ad..9e915c5 --- a/features/sdnr/odlux/helpserver/pom.xml +++ b/features/sdnr/odlux/helpserver/pom.xml @@ -33,6 +33,17 @@ SDNR ODLUX :: ${project.artifactId} + + + o-ran-sc-releases + https://nexus.o-ran-sc.org/content/repositories/releases + + + o-ran-sc-snapshots + https://nexus.o-ran-sc.org/content/repositories/snapshots + + + provider diff --git a/features/sdnr/odlux/helpserver/provider/pom.xml b/features/sdnr/odlux/helpserver/provider/pom.xml index 9a800e4..ba94d4f 100644 --- a/features/sdnr/odlux/helpserver/provider/pom.xml +++ b/features/sdnr/odlux/helpserver/provider/pom.xml @@ -42,6 +42,17 @@ 4.13.2 + + + o-ran-sc-releases + https://nexus.o-ran-sc.org/content/repositories/releases + + + o-ran-sc-snapshots + https://nexus.o-ran-sc.org/content/repositories/snapshots + + + jakarta.servlet diff --git a/features/sdnr/odlux/odlux/apps/apiDemo/pom.xml b/features/sdnr/odlux/odlux/apps/apiDemo/pom.xml index 10c3026..c070446 100644 --- a/features/sdnr/odlux/odlux/apps/apiDemo/pom.xml +++ b/features/sdnr/odlux/odlux/apps/apiDemo/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-apiDemo 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/app-installer/pom.xml b/features/sdnr/odlux/odlux/apps/app-installer/pom.xml old mode 100755 new mode 100644 index 284bc06..bea261e --- a/features/sdnr/odlux/odlux/apps/app-installer/pom.xml +++ b/features/sdnr/odlux/odlux/apps/app-installer/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-apps-installer 1.7.0-SNAPSHOT @@ -102,31 +108,6 @@ sdnr-odlux-app-configurationApp ${project.version} - - ${project.groupId} - sdnr-odlux-app-networkMapApp - ${project.version} - - - ${project.groupId} - sdnr-odlux-app-microwaveApp - ${project.version} - - - - ${project.groupId} - sdnr-odlux-app-siteManagerApp - ${project.version} - - - ${project.groupId} - sdnr-odlux-app-unmFaultManagementApp - ${project.version} - diff --git a/features/sdnr/odlux/odlux/apps/configurationApp/pom.xml b/features/sdnr/odlux/odlux/apps/configurationApp/pom.xml index 2093723..f8da9ef 100644 --- a/features/sdnr/odlux/odlux/apps/configurationApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/configurationApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-configurationApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/connectApp/pom.xml b/features/sdnr/odlux/odlux/apps/connectApp/pom.xml index c0b0525..71436e3 100644 --- a/features/sdnr/odlux/odlux/apps/connectApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/connectApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-connectApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/demoApp/pom.xml b/features/sdnr/odlux/odlux/apps/demoApp/pom.xml index 24dcd41..588b3d9 100644 --- a/features/sdnr/odlux/odlux/apps/demoApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/demoApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-demoApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/eventLogApp/pom.xml b/features/sdnr/odlux/odlux/apps/eventLogApp/pom.xml index 9e8da5d..370db3e 100644 --- a/features/sdnr/odlux/odlux/apps/eventLogApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/eventLogApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-eventLogApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/faultApp/pom.xml b/features/sdnr/odlux/odlux/apps/faultApp/pom.xml index bead906..3af06f8 100644 --- a/features/sdnr/odlux/odlux/apps/faultApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/faultApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-faultApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/helpApp/pom.xml b/features/sdnr/odlux/odlux/apps/helpApp/pom.xml index 17a04c7..6fd7e5c 100644 --- a/features/sdnr/odlux/odlux/apps/helpApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/helpApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-helpApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/inventoryApp/pom.xml b/features/sdnr/odlux/odlux/apps/inventoryApp/pom.xml index 4d7b941..9e38f23 100644 --- a/features/sdnr/odlux/odlux/apps/inventoryApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/inventoryApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-inventoryApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/maintenanceApp/pom.xml b/features/sdnr/odlux/odlux/apps/maintenanceApp/pom.xml index be3159f..ce2f5e7 100644 --- a/features/sdnr/odlux/odlux/apps/maintenanceApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/maintenanceApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-maintenanceApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/mediatorApp/pom.xml b/features/sdnr/odlux/odlux/apps/mediatorApp/pom.xml index cc5ff10..7a2c85f 100644 --- a/features/sdnr/odlux/odlux/apps/mediatorApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/mediatorApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-mediatorApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/.babelrc b/features/sdnr/odlux/odlux/apps/microwaveApp/.babelrc deleted file mode 100644 index 3d8cd12..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/package.json b/features/sdnr/odlux/odlux/apps/microwaveApp/package.json deleted file mode 100644 index 202b5da..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "@odlux/microwave-app", - "version": "0.1.0", - "description": "A react based modular UI to do link analysis.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Mohammad Boroon", - "license": "Apache-2.0", - "dependencies": { - "@fortawesome/free-solid-svg-icons": "5.6.3", - "@fortawesome/react-fontawesome": "0.1.14", - "@emotion/react": "^11.7.0", - "@emotion/styled": "^11.6.0", - "@mui/icons-material": "^5.2.0", - "@mui/material": "^5.2.2", - "@mui/styles": "^5.2.2", - "@odlux/framework": "*", - "@types/d3": "^6.7.0", - "@types/node": "^12.0.0", - "d3": "^7.0.0", - "d3-polygon": "^3.0.1", - "maplibre-gl": "^3.0.0", - "object.values": "^1.1.1" - }, - "peerDependencies": { - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "@types/react": "17.0.37", - "@types/react-dom": "17.0.11", - "@types/react-router-dom": "5.1.7", - "jquery": "3.3.1", - "react": "17.0.2", - "react-dom": "17.0.2", - "react-router-dom": "5.2.0" - }, - "devDependencies": { - "css-loader": "1.0.0", - "webpack": "^4.44.2" - } -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/pom.xml b/features/sdnr/odlux/odlux/apps/microwaveApp/pom.xml deleted file mode 100644 index 4a8bcb4..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/pom.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - 4.0.0 - - org.o-ran-sc.oam-controller.features.sdnr.odlux - sdnr-odlux-app-microwaveApp - 1.7.0-SNAPSHOT - jar - - SDNR ODLUX :: ${project.artifactId} - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - true - - - - - - dist - odlux - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - de.jacks-it-lab - frontend-maven-plugin - 1.7.2 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v16.17.0 - v1.22.19 - - - - yarn build - - yarn - - - run build - - - - - - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/index.html b/features/sdnr/odlux/odlux/apps/microwaveApp/src/index.html deleted file mode 100644 index f76b445..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - Microwave App - - - -
- - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/actions/lineOfSightCommonActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/actions/lineOfSightCommonActions.ts deleted file mode 100644 index b508c5d..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/actions/lineOfSightCommonActions.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { Action } from '../../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../../framework/src/flux/store'; - -import { Height } from '../model/lineOfSightHeight'; -import { LatLon } from '../model/lineOfSightLatLon'; - -import { calculateMidPoint } from '../utils/lineOfSightMap'; -import { isNumber } from '../utils/lineOfSightMath'; - -export class SetPassedInValuesAction extends Action { - constructor(public start: LatLon, public end: LatLon, public center: LatLon, public heightA: Height | null, public heightB: Height | null) { - super(); - } -} - -export class SetReachableAction extends Action { - constructor(public reachable: boolean | null) { - super(); - } -} - -export const SetPassedInValues = (values: (string | null)[]) => (dispatcher: Dispatch) => { - const start: LatLon = { latitude: Number(values[0]), longitude: Number(values[1]) }; - const end: LatLon = { latitude: Number(values[2]), longitude: Number(values[3]) }; - const midpoint = calculateMidPoint(start.latitude, start.longitude, end.latitude, end.longitude); - const center: LatLon = { latitude: midpoint.latitude, longitude: midpoint.longitude }; - const heightA: Height | null = isNumber(values[4]) && isNumber(values[5]) ? { amsl: +values[4]!, antennaHeight: +values[5]! } : null; - const heightB: Height | null = isNumber(values[6]) && isNumber(values[7]) ? { amsl: +values[6]!, antennaHeight: +values[7]! } : null; - dispatcher(new SetPassedInValuesAction(start, end, center, heightA, heightB)); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/actions/lineOfSightMapActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/actions/lineOfSightMapActions.ts deleted file mode 100644 index ca5d773..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/actions/lineOfSightMapActions.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { Action } from '../../../../../framework/src/flux/action'; - -import { Height } from '../model/lineOfSightHeight'; -import { LatLon } from '../model/lineOfSightLatLon'; - -export class SetChartAction extends Action { - constructor(public startPoint: LatLon, public endPoint: LatLon, public heightA: Height, public heightB: Height) { - super(); - } -} - -export class SetStartPointAction extends Action { - constructor(public startPoint: LatLon | null) { - super(); - } -} - -export class SetEndpointAction extends Action { - constructor(public endPoint: LatLon | null) { - super(); - } -} - -export class SetHeightA extends Action { - constructor(public height: Height) { - super(); - } -} - -export class SetHeightB extends Action { - constructor(public height: Height) { - super(); - } -} - -export class ClearSavedChartAction extends Action { - // eslint-disable-next-line @typescript-eslint/no-useless-constructor - constructor() { - super(); - } -} - -export class SetMapCenterAction extends Action { - /** - * - */ - constructor(public point: LatLon, public zoom: number) { - super(); - - } -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/assets/lineOfSightAppIcon.svg b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/assets/lineOfSightAppIcon.svg deleted file mode 100644 index 47b881e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/assets/lineOfSightAppIcon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightConnectionErrorPoup.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightConnectionErrorPoup.tsx deleted file mode 100644 index 5a97234..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightConnectionErrorPoup.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { Paper, Typography } from '@mui/material'; - -type ConnectionErrorPopupProps = { reachable: boolean | null }; - -const ConnectionErrorPopup: FC = (props) => { - - return (props.reachable != null && !props.reachable ? - -
-
Connection Error
- Service unavailable -
-
: null - ); -}; - -export default ConnectionErrorPopup; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightHeightChart.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightHeightChart.tsx deleted file mode 100644 index f4730c5..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightHeightChart.tsx +++ /dev/null @@ -1,122 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import * as d3 from 'd3'; - -import { useD3 } from '../hooks/d3'; -import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult'; -import { max } from '../utils/lineOfSightMath'; - -type HeightMapProps = { - data: GPSProfileResult[]; - dataMin: GPSProfileResult; - dataMax: GPSProfileResult; - width: number; - height: number; - heightPosA: number; - heightPosB: number; -}; - -const HeightChart: FC = (props) => { - const { data, dataMin, dataMax, heightPosA, heightPosB } = props; - let ref: React.RefObject; - - const drawSvg = () => { - ref = useD3( - (svg) => { - const margin = 100; - const width = Number(svg.attr('width')) - margin; - const height = Number(svg.attr('height')) - margin; - - // Add X axis - const x = d3.scaleBand() - .range([0, width]) - .domain(data.map(d => (`${d.gps.latitude},${d.gps.latitude}`))) - .padding(0.2); - - const maxHeight = max([dataMax.height, heightPosA, heightPosB], d => d); - - // Add Y axis - const y = d3.scaleLinear() - .domain([dataMin.height, maxHeight]) - .range([height, 0]); - - svg.append('g') - .attr('transform', `translate(${margin / 2}, ${margin / 2})`) - .call(d3.axisLeft(y)); - - // Bars - svg.selectAll('myBar') - .data(data) - .join('rect') - .attr('transform', `translate(${margin / 2}, ${margin / 2})`) - .attr('x', d => x(`${d.gps.latitude},${d.gps.latitude}`) || '') - .attr('y', d => y(d.height)) - .attr('width', x.bandwidth()) - .attr('fill', '#69b3a2b0') - .attr('height', d => height - y(d.height)); // always equal to 0 - - const firstX = `${data[0].gps.latitude},${data[0].gps.latitude}`; - const lastX = `${data[data.length - 1].gps.latitude},${data[data.length - 1].gps.latitude}`; - - //add line - const x1 = x(firstX)!; - const x2 = x(lastX)!; - - svg.append('line') - .attr('transform', `translate(${margin / 2}, ${margin / 2})`) - .attr('x1', x1) - .attr('y1', y(props.heightPosA)) - .attr('x2', x2) - .attr('y2', y(props.heightPosB)) - - .style('stroke', '#88A') - .attr('stroke-width', '3px'); - - //append circle on start and end - - svg.append('circle') - .attr('transform', `translate(${margin / 2}, ${margin / 2})`) - .attr('cx', x1) - .attr('cy', y(props.heightPosA)) - .attr('r', 10) - .attr('stroke', '#223b53') - .attr('fill', '#225ba3'); - - svg.append('circle') - .attr('transform', `translate(${margin / 2}, ${margin / 2})`) - .attr('cx', x2) - .attr('cy', y(props.heightPosB)) - .attr('r', 10) - .attr('stroke', '#223b53') - .attr('fill', '#225ba3'); - }, - [data], - ); - }; - - drawSvg(); - - return ( - - ); -}; - -export { HeightChart }; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMap.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMap.tsx deleted file mode 100644 index 4b55779..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMap.tsx +++ /dev/null @@ -1,290 +0,0 @@ -/* eslint-disable @typescript-eslint/no-shadow */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect, useRef, useState } from 'react'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - -import makeStyles from '@mui/styles/makeStyles'; - -import maplibre from 'maplibre-gl'; -import 'maplibre-gl/dist/maplibre-gl.css'; - -import { render } from 'react-dom'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import { SetReachableAction } from '../actions/lineOfSightCommonActions'; -import { ClearSavedChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from '../actions/lineOfSightMapActions'; - -import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult'; -import { Height } from '../model/lineOfSightHeight'; -import { LatLon } from '../model/lineOfSightLatLon'; - -import { getGPSProfile } from '../service/lineOfSightHeightService'; -import { addBaseLayer, addBaseSource, addPoint, calculateMidPoint } from '../utils/lineOfSightMap'; -import { max, min } from '../utils/lineOfSightMath'; - -import ConnectionErrorPopup from './lineOfSightConnectionErrorPoup'; -import { HeightChart } from './lineOfSightHeightChart'; -import MapContextMenu from './lineOfSightMapContextMenu'; -import MapInfo from './lineOfSightMapInfo'; - -import { OSM_STYLE, URL_BASEPATH } from '../config'; - -type MapProps = RouteComponentProps; - -const styles = makeStyles({ - chart: { - position: 'absolute', - top: 0, - bottom: 0, - left: 0, - right: 0, - }, -}); - -let map: maplibregl.Map; - -const Map: FC = (props) => { - - const center = useSelectApplicationState(state => state.microwave.map.center); - const zoom = useSelectApplicationState(state => state.microwave.map.zoom); - const start = useSelectApplicationState(state => state.microwave.map.start); - const end = useSelectApplicationState(state => state.microwave.map.end); - const siteAHeight = useSelectApplicationState(state => state.microwave.map.heightA); - const siteBHeight = useSelectApplicationState(state => state.microwave.map.heightB); - const ready = useSelectApplicationState(state => state.microwave.map.ready); - - const dispatch = useApplicationDispatch(); - const clearChartAction = () => dispatch(new ClearSavedChartAction); - const setMapPosition = (point: LatLon, zoom: number) => dispatch(new SetMapCenterAction(point, zoom)); - const setHeightStart = (height: Height) => dispatch(new SetHeightA(height)); - const setHeightEnd = (height: Height) => dispatch(new SetHeightB(height)); - const setStartPosition = (position: LatLon | null) => dispatch(new SetStartPointAction(position)); - const setEndPosition = (position: LatLon | null) => dispatch(new SetEndpointAction(position)); - const setReachable = (reachable: boolean | null) => dispatch(new SetReachableAction(reachable)); - - const [data, setData] = useState(Number.NaN); - const [dataMin, setDataMin] = useState(); - const [dataMax, setDataMax] = useState(); - const [isMapLoaded, setMapLoaded] = useState(false); - - const mapRef = useRef<{ map: maplibregl.Map | null }>({ map: null }); - const mapContainerRef = useRef(null); - - const classes = styles(); - - const heightA = siteAHeight !== null ? siteAHeight.amsl + siteAHeight.antennaHeight : 0; - const heightB = siteBHeight !== null ? siteBHeight.amsl + siteBHeight.antennaHeight : 0; - - const handleResize = () => { - - if (map) { - // wait a moment until resizing actually happened - window.setTimeout(() => map.resize(), 500); - } - }; - - useEffect(() => { - window.addEventListener('menu-resized', handleResize); - return () => { - window.removeEventListener('menu-resized', handleResize); - const center = mapRef.current.map?.getCenter(); - const mapZoom = mapRef.current.map?.getZoom(); - if (center) { - setMapPosition({ latitude: center.lat, longitude: center.lng }, mapZoom!); - } - setReachable(null); - }; - - }, []); - - - - const zoomInOnLink = (start: LatLon, end: LatLon) => { - const center = calculateMidPoint(start.latitude, start.longitude, end.latitude, end.longitude); - const newBounds = new maplibre.LngLatBounds(); - const allValues = { center, start, end }; - Object.values(allValues).forEach(value => { - if (value) { - newBounds.extend([value.longitude, value.latitude]); - } - }); - //zooms in/out to accumulate bounding box - map.fitBounds(newBounds, { padding: 20 }); - }; - - const drawChart = () => { - if (start && end) { - addBaseSource(map, 'route'); - addBaseLayer(map, 'route'); - zoomInOnLink(start, end); - const json = `{ - "type": "Feature", - "properties": {}, - "geometry": { - "type": "LineString", - "coordinates": [ - [${start.longitude}, ${start.latitude}], - [${end.longitude}, ${end.latitude}] - ]} - }`; - (map.getSource('route') as maplibregl.GeoJSONSource).setData(JSON.parse(json)); - getGPSProfile({ latitude: start.latitude, longitude: start.longitude }, { latitude: end.latitude, longitude: end.longitude }).then(data => { - if (Array.isArray(data)) { - setDataMin(min(data, d => d.height)); - setDataMax(max(data, d => d.height)); - } - setData(data); - }); - } else if (start || end) { - const point = start !== null ? start : end!; - addBaseSource(map, 'route'); - addBaseLayer(map, 'route'); - addPoint(map, point); - } else { - //delete layers and source - //used instead of clearing source data because it has better performance - //(setting data to empty results in a noticeable lag of line being cleared) - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - mapRef.current.map?.getLayer('line') && mapRef.current.map?.removeLayer('line') && - mapRef.current.map?.removeLayer('points') && mapRef.current.map?.removeSource('route'); - } - }; - - const updateLosUrl = () => { - if (start && end) { - const locationPart = `lat1=${start.latitude}&lon1=${start.longitude}&lat2=${end.latitude}&lon2=${end.longitude}`; - let heightPart = ''; - if (siteAHeight && siteBHeight) { - heightPart = `&amslA=${siteAHeight.amsl}&antennaHeightA=${siteAHeight.antennaHeight}&amslB=${siteBHeight.amsl}&antennaHeightB=${siteBHeight.antennaHeight}`; - } - props.history.replace(`/${URL_BASEPATH}/los?${locationPart}${heightPart}`); - } else if (!start && !end) { - props.history.replace(`/${URL_BASEPATH}`); - } - }; - - const updateHeightA = (value: number, value2: number) => { - setHeightStart({ amsl: value, antennaHeight: value2 }); - }; - - const updateHeightB = (value: number, value2: number) => { - setHeightEnd({ amsl: value, antennaHeight: value2 }); - }; - - const OnEndPosition = (position: maplibregl.LngLat) => { - setEndPosition({ latitude: position.lat, longitude: position.lng }); - }; - - const OnStartPosition = (position: maplibregl.LngLat) => { - setStartPosition({ latitude: position.lat, longitude: position.lng }); - }; - - const mapMoveEnd = () => { - const mapZoom = Number(map.getZoom().toFixed(2)); - const lat = Number(map.getCenter().lat.toFixed(4)); - const lon = Number(map.getCenter().lng.toFixed(4)); - setMapPosition({ latitude: lat, longitude: lon }, mapZoom); - }; - - const setupMap = () => { - let initialLat = center.latitude; - let initialLon = center.longitude; - let initialZoom = zoom; - - map = new maplibre.Map({ - container: mapContainerRef.current!, - style: OSM_STYLE as any, - center: [initialLon, initialLat], - zoom: initialZoom, - }); - - mapRef.current.map = map; - - map.on('load', () => { - - map.setMaxZoom(18); - setMapLoaded(true); - - //add source, layer - addBaseSource(map, 'route'); - addBaseLayer(map, 'route'); - - }); - - let currentPopup: maplibregl.Popup | null = null; - map.on('contextmenu', (e) => { - if (currentPopup) - currentPopup.remove(); - //change height if start/end changes - const popupNode = document.createElement('div'); - render( - { OnStartPosition(p); if (currentPopup) currentPopup.remove(); }} - onEnd={(p) => { OnEndPosition(p); if (currentPopup) currentPopup.remove(); }} - onHeightA={(p, p1) => updateHeightA(p, p1)} - onHeightB={(p, p1) => updateHeightB(p, p1)} />, - popupNode); - - currentPopup = new maplibre.Popup() - .setLngLat(e.lngLat) - .setDOMContent(popupNode) - .addTo(map); - }); - map.on('moveend', mapMoveEnd); - }; - - useEffect(() => { - if (ready) { - setupMap(); - } - }, [ready]); - - useEffect(() => { - if (ready && isMapLoaded) { - drawChart(); - updateLosUrl(); - } - }, [start, end, isMapLoaded]); - - return <> -
- - - - {typeof data === 'object' - ? ( - < div className={classes.chart} onClick={() => { - setData(Number.NaN); - setDataMax(undefined); - setDataMin(undefined); - clearChartAction(); - }}> - -
- ) - : null - } - - - ; -}; - -export default withRouter(Map); \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMapContextMenu.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMapContextMenu.tsx deleted file mode 100644 index 6eab2c3..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMapContextMenu.tsx +++ /dev/null @@ -1,82 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect, useState } from 'react'; - -import { Button, InputAdornment, TextField, Tooltip } from '@mui/material'; -import makeStyles from '@mui/styles/makeStyles'; - -import { getGPSHeight } from '../service/lineOfSightHeightService'; - -type MapContextMenuProps = { - pos: maplibregl.LngLat; - onStart: (pos: maplibregl.LngLat) => void; - onEnd: (pos: maplibregl.LngLat) => void; - onHeightA: (height: number, antennaHeight: number) => void; - onHeightB: (height: number, antennaHeight: number) => void; -}; - -const styles = makeStyles({ - flexContainer: { display: 'flex', flexDirection: 'row' }, - textField: { width: 60 }, - button: { marginRight: 5, marginTop: 5, flexGrow: 2 }, -}); - -const MapContextMenu: FC = (props) => { - const { pos, onStart, onEnd } = props; - const [height, setHeight] = useState(undefined); - const [value1, setValue1] = useState(''); - const [value2, setValue2] = useState(''); - const classes = styles(); - - useEffect(() => { - getGPSHeight({ longitude: pos.lng, latitude: pos.lat }).then(setHeight); - }, [pos.lat, pos.lng]); - - const handleChangeHeight = (e: React.ChangeEvent, id: 'heightA' | 'heightB') => { - //sanitize non numbers - const onlyNums = e.target.value.replace(/[^0-9]/g, ''); - if (id === 'heightA') { - setValue1(onlyNums); - } else { - setValue2(onlyNums); - } - }; - - return ( -
-
Height: {height} m
-
-
- - - handleChangeHeight(e, 'heightA')} InputProps={{ endAdornment: m }} /> - -
-
- - - handleChangeHeight(e, 'heightB')} InputProps={{ endAdornment: m }} /> - -
-
-
- ); -}; - -export default MapContextMenu; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMapInfo.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMapInfo.tsx deleted file mode 100644 index b6bb69a..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/components/lineOfSightMapInfo.tsx +++ /dev/null @@ -1,144 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect, useState } from 'react'; - -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import { Accordion, AccordionDetails, AccordionSummary, Typography } from '@mui/material'; -import makeStyles from '@mui/styles/makeStyles'; -import { useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult'; -import { calculateDistanceInMeter } from '../utils/lineOfSightMap'; - -type MapInfoProps = { - minHeight: GPSProfileResult | undefined; - maxHeight: GPSProfileResult | undefined; -}; - -const styles = (props: any) => makeStyles({ - accordion: { padding: 5, position: 'absolute', top: 10, width: props.width, marginLeft: 10, zIndex: 1 }, - container: { flexDirection: 'column', marginLeft: 10, padding: 5 }, - caption: { width: '40%' }, - subTitleRow: { width: '60%' }, - titleRowElement: { width: '40%', fontWeight: 'bold' }, - secondRow: { width: '25%' }, - thirdRow: { width: '20%' }, -}); - -const MapInfo: FC = (props) => { - - const center = useSelectApplicationState(state => state.microwave.map.center); - const zoom = useSelectApplicationState(state => state.microwave.map.zoom); - const start = useSelectApplicationState(state => state.microwave.map.start); - const end = useSelectApplicationState(state => state.microwave.map.end); - const heightA = useSelectApplicationState(state => state.microwave.map.heightA); - const heightB = useSelectApplicationState(state => state.microwave.map.heightB); - const [expanded, setExpanded] = useState(false); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [width, setWidth] = useState(470); - const [length, setLength] = useState(); - const classes = styles({ width: width })(); - const { minHeight, maxHeight } = props; - - useEffect(() => { - if (start && end) { - setLength(calculateDistanceInMeter(start.latitude, start.longitude, end.latitude, end.longitude).toFixed(3)); - } else { - setLength(undefined); - } - }, [start, end]); - - const handleChange = (event: any, isExpanded: boolean) => { - setExpanded(isExpanded); - }; - - return - } - aria-controls="panel1a-content" - id="panel1a-header"> - Map Info - - - - Map Center -
-
- Longitude{center.longitude}
-
- Latitude{center.latitude}
-
- Zoom {zoom}
-
- - Link -
-
- Start - End -
- -
- Longitude - {start?.longitude.toFixed(3)} - {end?.longitude.toFixed(3)} -
- -
- Latitude - {start?.latitude.toFixed(3)} - {end?.latitude.toFixed(3)} -
- -
- Meassured height [m] - {heightA?.amsl} - {heightB?.amsl} -
- -
- Antenna height [m] - {heightA?.antennaHeight} - {heightB?.antennaHeight} -
- -
- Length [m] - {length} -
- -
- Max height @ position - {maxHeight ? maxHeight.height + ' m' : ''} - {maxHeight?.gps.longitude.toFixed(3)} - {maxHeight?.gps.latitude.toFixed(3)} -
- -
- Min height @ position - {minHeight ? minHeight.height + ' m' : ''} - {minHeight?.gps.longitude.toFixed(3)} - {minHeight?.gps.latitude.toFixed(3)} -
- -
-
-
; -}; - -export default MapInfo; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/config.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/config.ts deleted file mode 100644 index 473fff9..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/config.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const URL_BASEPATH = 'microwave/lineOfSightMap'; - -export const TERRAIN_URL = '/terrain'; //http://10.20.11.249:5200 maybe? /terrain -export const TILE_URL = '/tiles'; //http://tile.openstreetmap.org /tiles - -export const OSM_STYLE = { - 'version': 8, - 'sources': { - 'raster-tiles': { - 'type': 'raster', - 'tiles': [ - TILE_URL + '/{z}/{x}/{y}.png', - ], - 'tileSize': 256, - 'attribution': - '© OpenStreetMap contributors', - }, - }, - 'layers': [ - { - 'id': 'simple-tiles', - 'type': 'raster', - 'source': 'raster-tiles', - 'minZoom': 0, - 'maxZoom': 18, - }, - ], -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/handlers/lineOfSightMapHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/handlers/lineOfSightMapHandler.ts deleted file mode 100644 index 8f789c1..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/handlers/lineOfSightMapHandler.ts +++ /dev/null @@ -1,76 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; - -import { SetPassedInValuesAction, SetReachableAction } from '../actions/lineOfSightCommonActions'; -import { ClearSavedChartAction, SetChartAction, SetEndpointAction, SetHeightA, SetHeightB, SetMapCenterAction, SetStartPointAction } from '../actions/lineOfSightMapActions'; - -import { Height } from '../model/lineOfSightHeight'; -import { LatLon } from '../model/lineOfSightLatLon'; - - -export interface IMap { - center: LatLon; - zoom: number; - start: LatLon | null; - heightA: Height | null; - end: LatLon | null; - heightB: Height | null; - ready: boolean | null; -} - -const initialState: IMap = { - center: { latitude: 52.4003, longitude: 13.0584 }, - zoom: 12, - start: null, - end: null, - ready: null, - heightA: null, - heightB: null, - -}; - -export const mapHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof SetPassedInValuesAction) { - state = { ...state, start: action.start, end: action.end, center: action.center, heightA: action.heightA, heightB: action.heightB }; - } else if (action instanceof SetReachableAction) { - state = { ...state, ready: action.reachable }; - - } else if (action instanceof SetChartAction) { - state = { ...state, start: action.startPoint, end: action.endPoint, heightA: action.heightA, heightB: action.heightB }; - } else if (action instanceof SetStartPointAction) { - state = { ...state, start: action.startPoint }; - - } else if (action instanceof SetEndpointAction) { - state = { ...state, end: action.endPoint }; - - } else if (action instanceof SetHeightA) { - state = { ...state, heightA: action.height }; - - } else if (action instanceof SetHeightB) { - state = { ...state, heightB: action.height }; - - } else if (action instanceof ClearSavedChartAction) { - state = { ...state, start: null, end: null, heightA: null, heightB: null }; - } else if (action instanceof SetMapCenterAction) { - state = { ...state, zoom: action.zoom, center: action.point }; - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/hooks/d3.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/hooks/d3.ts deleted file mode 100644 index dfebe86..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/hooks/d3.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -/* eslint-disable react-hooks/exhaustive-deps */ -import { useEffect, useRef } from 'react'; -import type { DependencyList } from 'react'; - -import * as d3 from 'd3'; - - -type SelectionType = d3.Selection; - -export const useD3 = (renderChartFn: (selection: SelectionType) => void, dependencies: DependencyList) => { - const ref = useRef(null); - - useEffect(() => { - if (ref.current) renderChartFn(d3.select(ref.current)); - return () => { }; - }, dependencies); - - return ref; -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightGPSProfileResult.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightGPSProfileResult.ts deleted file mode 100644 index bf7be25..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightGPSProfileResult.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type GPSProfileResult = { height: number; gps: { latitude: number; longitude: number }; band: string; zone: number; easting: number; northing: number }; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightHeight.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightHeight.tsx deleted file mode 100644 index 9bafec2..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightHeight.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Height = { - amsl: number; - antennaHeight: number; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightLatLon.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightLatLon.ts deleted file mode 100644 index 28cdba4..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/model/lineOfSightLatLon.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type LatLon = { - latitude: number; - longitude: number; -}; - -type LinkDetailLocation = { - lon: number; - lat: number; - siteId: number; - name: string | null; - amslM: number | null; - azimuthDeg: number | null; - radioAntenna: { - id: number; - operationalParameters: { - agl: number; - }; - }; -}; - -export type Link = { - id: number; - name: string; - operator: string; - siteA: LinkDetailLocation; - siteB: LinkDetailLocation; - type: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/service/lineOfSightHeightService.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/service/lineOfSightHeightService.ts deleted file mode 100644 index 9deec1f..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/service/lineOfSightHeightService.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { TERRAIN_URL } from '../config'; -import { GPSProfileResult } from '../model/lineOfSightGPSProfileResult'; -import { LatLon } from '../model/lineOfSightLatLon'; - -import { requestRest } from '../../../../../framework/src/services/restService'; - -export const apiUrlBase = 'api/Query'; - -export const getGPSProfile = async (start: LatLon, end: LatLon) => { - const url = `${TERRAIN_URL}/${apiUrlBase}/GPSProfileRecords`; - - const result = await fetch(url, { - method: 'POST', - body: JSON.stringify({ start, end }), - headers: { - 'Content-Type': 'application/json', - // 'Content-Type': 'application/x-www-form-urlencoded', - }, - }); - if (result.ok) { - const data = await result.json() as GPSProfileResult[]; - return data; - } - return Number.NaN; -}; - -export const getGPSHeight = async (gpsCoord: LatLon) => { - const url = `${TERRAIN_URL}/${apiUrlBase}/GPSHeight`; - const result = await fetch(url, { - method: 'POST', - body: JSON.stringify(gpsCoord), - headers: { - 'Content-Type': 'application/json', - // 'Content-Type': 'application/x-www-form-urlencoded', - }, - }); - if (result.ok) { - const data = await result.json() as { height: number }; - return data.height; - } else { - return undefined; - } -}; - -const LINK_DETAILS_URL = '/topology/linkcalculator'; -export const getLinkDetails = async (linkId: any) => { - const result = requestRest(LINK_DETAILS_URL + '/link/' + linkId); - return result; -}; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/styles/index.css b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/styles/index.css deleted file mode 100644 index ec2585e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/styles/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/styles/mapbox-gl.css b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/styles/mapbox-gl.css deleted file mode 100644 index 03c479a..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/styles/mapbox-gl.css +++ /dev/null @@ -1 +0,0 @@ -.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);text-align:left}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:0;margin:10px;position:relative;background-color:#fff;border-radius:3px 12px 12px 3px}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 24px 2px 4px;visibility:visible;margin-top:6px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:"";cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/utils/lineOfSightMap.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/utils/lineOfSightMap.ts deleted file mode 100644 index 472e0db..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/utils/lineOfSightMap.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable no-param-reassign */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { LatLon } from '../model/lineOfSightLatLon'; - -export const addBaseSource = (map: maplibregl.Map, name: string) => { - if (!map.getSource(name)) - map.addSource(name, { - type: 'geojson', - data: { type: 'FeatureCollection', features: [] }, - }); -}; - -export const addPoint = (map: maplibregl.Map, point: LatLon) => { - const json = `{ - "type": "Feature", - "properties": {}, - "geometry": { - "type": "Point", - "coordinates": - [${point.longitude}, ${point.latitude}] - } - }`; - (map.getSource('route') as maplibregl.GeoJSONSource).setData(JSON.parse(json)); -}; - -export const addBaseLayer = (map: maplibregl.Map, sourceName: string) => { - if (!map.getLayer('line')) - map.addLayer({ - 'id': 'line', - 'type': 'line', - 'source': sourceName, - 'layout': { - 'line-join': 'round', - 'line-cap': 'round', - }, - 'paint': { - 'line-color': '#88A', - 'line-width': 6, - 'line-opacity': 0.75, - }, - }); - - if (!map.getLayer('points')) - map.addLayer({ - id: 'points', - type: 'circle', - source: sourceName, - paint: { - 'circle-radius': 5, - 'circle-color': '#223b53', - 'circle-stroke-color': '#225ba3', - 'circle-stroke-width': 3, - 'circle-opacity': 0.5, - }, - }); -}; - -const degrees_to_radians = (degrees: number) => { - return degrees * (Math.PI / 180); -}; - -const radians_to_degrees = (radians: number) => { - var pi = Math.PI; - return radians * (180 / pi); -}; - -//taken from https://www.movable-type.co.uk/scripts/latlong.html -export const calculateMidPoint = (lat1: number, lon1: number, lat2: number, lon2: number): LatLon => { - const dLon = degrees_to_radians(lon2 - lon1); - //convert to radians - lat1 = degrees_to_radians(lat1); - lat2 = degrees_to_radians(lat2); - lon1 = degrees_to_radians(lon1); - - const Bx = Math.cos(lat2) * Math.cos(dLon); - const By = Math.cos(lat2) * Math.sin(dLon); - const lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), Math.sqrt((Math.cos(lat1) + Bx) * (Math.cos(lat1) + Bx) + By * By)); - const lon3 = lon1 + Math.atan2(By, Math.cos(lat1) + Bx); - const coordinate: LatLon = { latitude: radians_to_degrees(lat3), longitude: radians_to_degrees(lon3) }; - return coordinate; -}; - -function toRad(value: number) { - return (value * Math.PI) / 180; -} - -export const calculateDistanceInMeter = (lat1: number, lon1: number, lat2: number, lon2: number) => { - const lonRad1 = toRad(lon1); - const latRad1 = toRad(lat1); - const lonRad2 = toRad(lon2); - const latRad2 = toRad(lat2); - const dLon = lonRad2 - lonRad1; - const dLat = latRad2 - latRad1; - const a = Math.pow(Math.sin(dLat / 2), 2) + - Math.cos(latRad1) * Math.cos(latRad2) * - Math.pow(Math.sin(dLon / 2), 2); - const c = 2 * Math.asin(Math.sqrt(a)); - - return 6378 * c; -}; - - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/utils/lineOfSightMath.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/utils/lineOfSightMath.ts deleted file mode 100644 index e4ea962..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/utils/lineOfSightMath.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const max = (a: T[], p: (v: T) => Number) => a.reduce((m, x) => p(m) > p(x) ? m : x, a[0]); -export const min = (a: T[], p: (v: T) => Number) => a.reduce((m, x) => p(m) < p(x) ? m : x, a[0]); - -export const isNumber = (value: string | null) => { - if (!value) { - return false; - } else { - const num = Number(value); - return !isNaN(num); - } -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/views/lineOfSightMain.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/views/lineOfSightMain.tsx deleted file mode 100644 index 293ea38..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/lineOfSight/views/lineOfSightMain.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; -import Map from '../components/lineOfSightMap'; - -const LineOfSightMainView: FC = () => { - return ( -
- -
- ); -}; - -export default LineOfSightMainView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/adaptiveModulationAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/adaptiveModulationAction.ts deleted file mode 100644 index 99ac55c..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/adaptiveModulationAction.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { AdaptiveModulationInput } from '../model/adaptiveModulationInput'; -import { Dispatch } from '../../../../../framework/src/flux/store'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import dataService from '../service/dataService'; -import { Action } from '../../../../../framework/src/flux/action'; -import { AdaptiveModulationTable } from '../model/adaptiveModulationTable'; - - -export class UpdateAdaptiveModulationTableAction extends Action { - constructor(public adaptiveModulationTableAtoB: AdaptiveModulationTable[] | null, public adaptiveModulationTableBtoA: AdaptiveModulationTable[] | null, public message: string, public status: number) { - super(); - } -} -export class UpdateAdaptiveModulationProcessing extends Action { - constructor(public processing: boolean) { - super(); - } -} - -export const adaptiveModulationInputCreator = () => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - - const { - microwave: { - link: { polarization, linkId }, - radio: { band, txPowerA, txPowerB, radioIdSiteA, radioIdSiteB, modulationA, modulationB }, - atmosphere: { attenuationMethod, worstMonth, rainVal, rainMethod }, - antenna: { antennaIdSiteA, antennaIdSiteB, antennaHeightA, antennaHeightB }, - waveguide: { waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate }, - bandPlan: { region }, - }, - } = getState(); - - let adaptiveModulationInput: AdaptiveModulationInput = { - linkId: 0, - linkOperationalParameters: { - bandKeyId: '0', - bandplanKeyId:'', - polarization: '', - absorptionMethod: '', - calculationPeriod: '', - rainRate: 0, - rainModel: '', - }, - siteA: { - radioModelId: 0, - waveguideModelId: 0, - radioAntennaModelId: 0, - modulationType: '', - transmissionPower: 0, - waveguideLength: 0, - agl: 0, - }, - siteB: { - radioModelId: 0, - waveguideModelId: 0, - radioAntennaModelId: 0, - modulationType: '', - transmissionPower: 0, - waveguideLength: 0, - agl: 0, - }, - }; - - // setting link attributes - adaptiveModulationInput = { - ...adaptiveModulationInput, - linkId: linkId, - linkOperationalParameters: { - bandKeyId: band.keyId, - bandplanKeyId: region.keyId, - polarization: polarization!, - absorptionMethod: attenuationMethod, - calculationPeriod: worstMonth === true ? 'WORSTMONTH' : 'ANNUAL', - rainRate: rainVal, - rainModel: rainMethod, - }, - }; - // setting site A attributes - adaptiveModulationInput = { - ...adaptiveModulationInput, - siteA: { - radioModelId: radioIdSiteA, - waveguideModelId: waveguideIdSiteA, - radioAntennaModelId: antennaIdSiteA, - modulationType: modulationA, - transmissionPower: txPowerA, - waveguideLength: waveguideLengthACalculate, - agl: antennaHeightA, - }, - }; - // setting SiteB attributes - adaptiveModulationInput = { - ...adaptiveModulationInput, - siteB: { - radioModelId: radioIdSiteB, - waveguideModelId: waveguideIdSiteB, - radioAntennaModelId: antennaIdSiteB, - modulationType: modulationB, - transmissionPower: txPowerB, - waveguideLength: waveguideLengthBCalculate, - agl: antennaHeightB, - }, - }; - - const adaptivemodulationPromise = dataService.adaptiveModulationTable(adaptiveModulationInput); - - adaptivemodulationPromise.then((response ) => { - dispatch(new UpdateAdaptiveModulationTableAction(response.data?.aToB!, response.data?.bToA!, response.message!, response.status)); - }); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/antennaActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/antennaActions.ts deleted file mode 100644 index aa531b7..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/antennaActions.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../../framework/src/flux/action'; -import { Antenna } from '../model/antenna'; - -export class UpdateAntennaDBAction extends Action { - constructor(public antenna: Antenna[]) { - super(); - } -} -export class UpdateAntennaAction extends Action { - constructor(public antennaA: Antenna | null, public antennaB: Antenna | null) { - super(); - } -} -export class antennaMandatoryAction extends Action { - constructor(public antennaMandatoryParameters: boolean) { - super(); - } -} - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/atmosphericLossAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/atmosphericLossAction.ts deleted file mode 100644 index 5950589..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/atmosphericLossAction.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../../framework/src/flux/action'; - -export class UpdateRainValAction extends Action { - constructor(public rainVal: number) { - super(); - } -} -export class UpdateRainMethodAction extends Action { - constructor(public rainMethod: string) { - super(); - } -} -export class UpdateAttenuationMethodAction extends Action { - constructor(public attenuationMethod: string) { - super(); - } -} -export class UpdateWorstMonthAction extends Action { - constructor(public worstMonth: boolean) { - super(); - } -} -export class attenuationMandatoryParametersAction extends Action { - constructor(public attenuationMandatoryParameters: boolean) { - super(); - } -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/bandPlanAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/bandPlanAction.ts deleted file mode 100644 index 944404d..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/bandPlanAction.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { Action } from '../../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../../framework/src/flux/store'; -import { Channel, ChannelTable, FrequencyPlan, RegionRegulator } from '../model/bandPlan'; -import { RadioBand } from '../model/topologyTypes'; -import { SaveChannel } from '../model/updateLink'; -import dataService from '../service/dataService'; -import { UpdateFrequencyPlanAction } from './linkAction'; -import { UpdateBandList } from './queryActions'; - - -export class UpdateRegionRegulatorAction extends Action { - constructor(public region: RegionRegulator) { - super(); - } -} -export class UpdateChannelListQueryAction extends Action { - constructor(public channelList: Channel[]) { - super(); - } -} -export class UpdateChannelListLoadingAction extends Action { - constructor(public channelListLoading: boolean) { - super(); - } -} -export class UpdateChannelListAction extends Action { - constructor(public channels: ChannelTable[]) { - super(); - } -} -export class ResetChannelTableAction extends Action {} - -export class UpdateFrequencyPlans extends Action { - constructor(public siteAFrequencyPlan: FrequencyPlan[], public siteBFrequencyPlan: FrequencyPlan[]) { - super(); - } -} - -export const updateSavedChannels = (channels: SaveChannel[], allChannel: Channel[]) => async (dispatcher: Dispatch) => { - let channelTable: ChannelTable[] = []; - - - channels.forEach(x => { - allChannel.forEach(y => { - if (y.keyId === x.channelKeyId) { - channelTable.push({ - name: y.name, - bandwidthMHz: y.bandwidthMHz.bandwidthMHz, - centerFrequencyHigh: y.centerFrequencyHigh, - centerFrequencyLow: y.centerFrequencyLow, - availability: y.availability.name, - xPolCondition: y.xPolCondition.name, - keyId: y.keyId, - polarization: x.channelPolarizationEnum, - }); - } - }, - ); - }); - dispatcher(new UpdateChannelListAction(channelTable)); -}; - -export const UpdateChannelQuery = (bandplanKeyId: string, bandKeyId: string) => async (dispatcher: Dispatch) => { - - dataService.channelQuery(bandplanKeyId, bandKeyId).then(result => { - dispatcher(new UpdateChannelListQueryAction(result?.data!)); - dispatcher(new UpdateChannelListLoadingAction(false)); - }); -}; - - - -export const getAllBands = (bandplanKeyId: string) => async (dispatcher: Dispatch) => { - await dataService.bandListQuery(bandplanKeyId).then(result => { - if (result.data) { - let bandList: RadioBand[] = []; - result.data.forEach(x => bandList.push(x)); - dispatcher(new UpdateBandList(bandList)); - } - }); -}; - -export const getFrequencyplans = (siteIdA: number, siteIdB: number, bandKeyId: string) => async (dispatcher: Dispatch) => { - let siteAFrequencyPlan: FrequencyPlan[] = []; - let siteBFrequencyPlan: FrequencyPlan[] = []; - - await dataService.frequencyPlanQuery(siteIdA).then(result => { - siteAFrequencyPlan = result.data; - }); - await dataService.frequencyPlanQuery(siteIdB).then(result => { - siteBFrequencyPlan = result.data; - - }); - dispatcher(new UpdateFrequencyPlans(siteAFrequencyPlan, siteBFrequencyPlan)); - let frequencyPlanA: string = ''; - let frequencyPlanB: string = ''; - siteAFrequencyPlan.forEach(x => { - if (x.band.keyId === bandKeyId) { - frequencyPlanA = x.configuration; - } - }); - siteBFrequencyPlan.forEach(x => { - if (x.band.keyId === bandKeyId) { - frequencyPlanB = x.configuration; - } - }); - dispatcher(new UpdateFrequencyPlanAction(frequencyPlanA as 'HIGH' | 'LOW', frequencyPlanB as 'HIGH' | 'LOW')); -}; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/commonActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/commonActions.ts deleted file mode 100644 index bcb8dbd..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/commonActions.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { TabId } from '../model/tabId'; -import { Action } from '../../../../../framework/src/flux/action'; -import { CalculationResult } from '../model/calculationResult'; - -export class UpdateCalculationResultAction extends Action { - constructor(public result: CalculationResult) { - super(); - } -} -export class UpdateTabAction extends Action { - constructor(public openTab: TabId) { - super(); - } -} - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/errorAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/errorAction.ts deleted file mode 100644 index 4e29cbf..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/errorAction.ts +++ /dev/null @@ -1,74 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../../framework/src/flux/store'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; - -export class UpdateLatitudeErrorAction extends Action { - constructor(public error1: string | null, public error2: string | null) { - super(); - } -} -export class UpdateLongitudeErrorAction extends Action { - constructor(public error1: string | null, public error2: string | null) { - super(); - } -} -export class UpdateFrequencyErrorAction extends Action { - constructor(public error: string) { - super(); - } -} -export class UpdateRainMethodErrorAction extends Action { - constructor(public error: string) { - super(); - } -} -export class UpdateAttenuationMethodErrorAction extends Action { - constructor(public error: string) { - super(); - } -} -export class FirstMandatoryCheckAction extends Action { -} - - - -export const formValid = () => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - - const siteState = getState().microwave.site; - - const latitude1Error = siteState.lat1 === 0 ? 'Enter a number between -90 to 90' : null; - const latitude2Error = siteState.lat2 === 0 ? 'Enter a number between -90 to 90' : null; - const longitude1Error = siteState.lon1 === 0 ? 'Enter a number between -180 to 180' : null; - const longitude2Error = siteState.lon2 === 0 ? 'Enter a number between -180 to 180' : null; - const frequencyError = getState().microwave.radio.band.frequency === 0 ? 'Select a frequency' : ''; - const rainMethodError = getState().microwave.atmosphere.rainMethod === '0' ? 'Select the rain method' : ''; - const attenuationMethodError = getState().microwave.atmosphere.attenuationMethod === '0' ? 'Select the attenuation method' : ''; - - dispatcher(new UpdateLatitudeErrorAction(latitude1Error, latitude2Error)); - dispatcher(new UpdateLongitudeErrorAction(longitude1Error, longitude2Error)); - dispatcher(new UpdateFrequencyErrorAction(frequencyError)); - dispatcher(new UpdateRainMethodErrorAction(rainMethodError)); - dispatcher(new UpdateAttenuationMethodErrorAction(attenuationMethodError)); - - return latitude1Error === null && latitude2Error === null && longitude1Error === null && longitude2Error === null && frequencyError === ''; -}; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/handleButtonAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/handleButtonAction.ts deleted file mode 100644 index 5369340..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/handleButtonAction.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import dataService from '../service/dataService'; -import { Dispatch } from '../../../../../framework/src/flux/store'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import { UpdateDistanceAction } from './linkAction'; -import { CalculationResult } from '../model/calculationResult'; -import { UpdateCalculationResultAction } from './commonActions'; - -export const calculateButtonAction = () => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - - const { - microwave: { - site: { lat1, lon1, lat2, lon2 }, - link: { polarization, distance }, - radio: { band, txPowerA, txPowerB, thresholdBER3A, thresholdBER3B, radioMandatoryParameters, frequencyMandatoryParameters }, - atmosphere: { worstMonth, rainVal, attenuationMethod, rainMethod, attenuationMandatoryParameters }, - antenna: { antennaGainA, antennaGainB, antennaMandatoryParameters }, - waveguide: { waveguideMandatoryParameters, waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate }, - }, - } = getState(); - - let distanceInKm; - // const autoDistance = await dataServices.updateAutoDistance(lat1, lon1, lat2, lon2); - - if (distance !== 0) { - distanceInKm = distance; - } else { - distanceInKm = (await dataService.updateAutoDistance(lat1, lon1, lat2, lon2))!.distanceInKm; - dispatch(new UpdateDistanceAction(distanceInKm)); - } - - let rainLoss; - if (rainMethod === 'ITURP8377') { - rainLoss = await dataService.rainAttenuation(lat1, lon1, lat2, lon2, band.keyId, polarization!, worstMonth); - } else if (rainMethod === 'MANUAL') { - if (rainVal !== 0) { - rainLoss = await dataService.manualRain(rainVal, band.keyId, distanceInKm, polarization!); - } - } - let linkBudget; - let waveguideLoss; - const freeSpaceLoss = await dataService.FSL(distanceInKm, band.keyId); - const absorptionLoss = await dataService.AbsorptionAtt(lat1, lon1, lat2, lon2, band.keyId, worstMonth, attenuationMethod); - - waveguideLoss = await dataService.waveguideLoss(waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate); - - if (antennaMandatoryParameters && radioMandatoryParameters && frequencyMandatoryParameters && attenuationMandatoryParameters && waveguideMandatoryParameters && waveguideLoss) { - linkBudget = await dataService.linkBudget(lat1, lon1, lat2, lon2, band.keyId, attenuationMethod, polarization!, antennaGainA, antennaGainB, waveguideLoss.waveguideLossA, waveguideLoss.waveguideLossB, txPowerA!, txPowerB!, thresholdBER3A!, thresholdBER3B!); - } - let result = new CalculationResult(); - if (rainLoss && rainLoss.rainAttenuation) result.rainLoss = rainLoss; - if (freeSpaceLoss) result.freeSpaceLoss = freeSpaceLoss; - if (absorptionLoss && absorptionLoss.oxygenLoss && absorptionLoss.waterLoss) result.absorptionLoss = absorptionLoss; - if (waveguideLoss) result.waveguideLoss = waveguideLoss; - if (linkBudget && linkBudget.receivedPowerA && linkBudget.receivedPowerB ) result.linkBudget = linkBudget; - if (result) dispatch(new UpdateCalculationResultAction(result)); -}; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/linkAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/linkAction.ts deleted file mode 100644 index ec24571..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/linkAction.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../../framework/src/flux/action'; - - -export class UpdatePolAction extends Action { - constructor(public polarization: 'HORIZONTAL' | 'VERTICAL' | null) { - super(); - } -} -export class UpdateDistanceAction extends Action { - constructor(public distance: number | null) { - super(); - } -} -export class UpdateFrequencyPlanAction extends Action { - constructor(public frequencyPlanA: 'HIGH' | 'LOW', public frequencyPlanB :'HIGH' | 'LOW' ) { - super(); - } -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/queryActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/queryActions.ts deleted file mode 100644 index d798595..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/queryActions.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { Action } from '../../../../../framework/src/flux/action'; -import { RegionRegulator } from '../model/bandPlan'; -import { ModelType, RadioBand } from '../model/topologyTypes'; - -export class UpdateBandList extends Action { - constructor(public bandList: RadioBand[]) { - super(); - } -} -export class UpdateRegionRegulatorListAction extends Action { - constructor(public regionRegulatorList : RegionRegulator[]) { - super(); - } -} -export class UpdateModelTypesAction extends Action { - constructor(public ModelTypes : ModelType[]) { - super(); - } -} - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/radioActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/radioActions.ts deleted file mode 100644 index 4ceb37c..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/radioActions.ts +++ /dev/null @@ -1,177 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import dataService from '../service/dataService'; -import { Action } from '../../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../../framework/src/flux/store'; -import { Radio, RadioEverything } from '../model/radio'; -import { Modulation } from '../model/modulation'; - -import { Antenna } from '../model/antenna'; -import { Waveguide } from '../model/waveguide'; -import { FirstMandatoryCheckAction } from './errorAction'; -import { Link } from '../model/link'; -import { radioService } from '../service/processingService'; - -export class UpdateFrequencyAction extends Action { - constructor(public frequency: number) { - super(); - - } -} -export class UpdateTxPowerAction extends Action { - constructor(public txPowerA: number | null, public txPowerB: number | null) { - super(); - } -} -export class UpdateRxSensitivityAction extends Action { - constructor(public thresholdBER3A: number | null, public thresholdBER6A: number | null, public thresholdBER3B: number | null, public thresholdBER6B: number | null) { - super(); - } -} -export class UpdateRxPowerAction extends Action { - constructor(public rxPowerA: number, public rxPowerB: number) { - super(); - } -} -export class UpdateSomAction extends Action { - constructor(public somA: number, public somB: number) { - super(); - } -} -export class UpdateRadioListAction extends Action { - constructor(public radioNameList: string[]) { - super(); - } -} - -export class UpdateRadioAction extends Action { - constructor(public radioNameA: string | null, public radioNameB: string | null) { - super(); - } -} -export class radioMandatoryParametersAction extends Action { - constructor(public radioMandatoryParameters: boolean) { - super(); - } -} -export class frequencyMandatoryParametersAction extends Action { - constructor(public frequencyMandatoryParameters: boolean) { - super(); - } -} - -export class UpdateRadioParametersAction extends Action { - constructor(public radioParameters: Radio[]) { - super(); - } -} -export class radioBandwidthAction extends Action { - constructor(public radioBandwidthA: number | null, public radioBandwidthB: number | null) { - super(); - } -} -export class UpdateRadioIdAction extends Action { - constructor(public radioIdSiteA: number | null, public radioIdSiteB: number | null) { - super(); - } -} - -export class UpdateModulationListAction extends Action { - constructor(public modulationListA: string[] | null, public modulationListB: string[] | null) { - super(); - } -} -export class UpdateModulationAction extends Action { - constructor(public modulationA: string | null, public modulationB: string | null) { - super(); - } -} - -export class UpdateModulationParametersAction extends Action { - constructor(public modulationParametersA: Modulation | null, public modulationParametersB: Modulation | null) { - super(); - } -} - -export class ResetAction extends Action { -} -export class UpdateDeviceListsOnBandChangeAction extends Action { - constructor( - public antennas: Antenna[], - public radioList: Radio[], - public waveguideList: Waveguide[]) { - super(); - } -} -export class UpdateDevicesOnFirstLoad extends UpdateDeviceListsOnBandChangeAction { - constructor( - public antennas: Antenna[], - public radioList: Radio[], - public waveguideList: Waveguide[], - public linkAttributes: Link ) { - super(antennas, radioList, waveguideList); - } -} - -export class UpdateRadioEverything extends Action { - constructor(public transport: RadioEverything) { - super(); - } -} -export class UpdateTotalBandwidthAction extends Action { - constructor(public totalBandwidthMHz: number) { - super(); - } -} - -export class UpdateEnabeldAdaptiveModulations extends Action { - constructor(public enabledAdaptiveModulations: string[]) { - super(); - } -} -export const updateFrequencyBand = (bandKeyId: string) => async (dispatcher: Dispatch) => { - dispatcher( new ResetAction()); - dispatcher(new UpdateFrequencyAction(Number(bandKeyId.replace('$', '')))); - dispatcher(new FirstMandatoryCheckAction()); - - - let radios: Radio[] = []; - let antennas: Antenna[] = []; - let waveguides: Waveguide[] = []; - await dataService.getModels(bandKeyId, 'radio')!.then((x: Radio[]) => { - radios = x; - }); - await dataService.getModels(bandKeyId, 'radio-antenna')!.then((x: Antenna[]) => { - antennas = x; - }); - await dataService.getModels(bandKeyId, 'radio-to-antenna-link')!.then((x: Waveguide[]) => { - waveguides = x; - }); - dispatcher(new UpdateDeviceListsOnBandChangeAction(antennas, radios, waveguides)); -}; -export const revertAntennaRadioWaveguideattributes = () => async (dispatcher: Dispatch) => { - dispatcher(new ResetAction()); -}; -export const updateRadioAttributes = (radioA: string | null, radioB: string | null, radioParameters: Radio[]) => async (dispatcher: Dispatch) => { - dispatcher(new UpdateRadioAction(radioA, radioB)); - const radios: RadioEverything = await radioService(radioA, radioB, radioParameters); - dispatcher(new UpdateRadioEverything(radios)); -}; - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/saveLinkAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/saveLinkAction.ts deleted file mode 100644 index eec15c0..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/saveLinkAction.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { Dispatch } from '../../../../../framework/src/flux/store'; -import { Action } from '../../../../../framework/src/flux/action'; - -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; - -import dataService from '../service/dataService'; -import { SaveChannel, UpdateLink } from '../model/updateLink'; - - - -export class linkSavedSuccessfulAction extends Action { - constructor(public saved: any) { - super(); - } -} -export class linkBeingSavedAction extends Action { - constructor(public saving: boolean) { - super(); - } -} -export const saveLinkCallAsync = () => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { - dispatch(new linkBeingSavedAction(true)); - const { - microwave: { - link: { polarization }, - radio: { band, txPowerA, txPowerB, radioIdSiteA, radioIdSiteB, modulationA, modulationB, enabledAdaptiveModulations }, - atmosphere: { attenuationMethod, worstMonth, rainMethod, rainVal }, - antenna: { antennaIdSiteA, antennaIdSiteB, antennaHeightA, antennaHeightB }, - waveguide: { waveguideIdSiteA, waveguideIdSiteB, waveguideLengthACalculate, waveguideLengthBCalculate }, - query: { linkAttributes }, - bandPlan:{ region, savedChannels }, - }, - } = getState(); - - let saveChannels: SaveChannel[] = []; - savedChannels.map(x => { - saveChannels.push({ channelKeyId: x.keyId, channelPolarizationEnum: x.polarization }); - }); - - let link: UpdateLink = { - - siteA: { modulationType :modulationA, - transmissionPower:txPowerA, - waveguideLength:waveguideLengthACalculate, - agl:antennaHeightA, - radioModelId: radioIdSiteA, - waveguideModelId:waveguideIdSiteA, - radioAntennaModelId:antennaIdSiteA, - enabledAdmModulations: enabledAdaptiveModulations, - }, - siteB: { modulationType :modulationB, - transmissionPower:txPowerB, - waveguideLength:waveguideLengthBCalculate, - agl:antennaHeightB, - radioModelId: radioIdSiteB, - waveguideModelId:waveguideIdSiteB, - radioAntennaModelId:antennaIdSiteB, - enabledAdmModulations: enabledAdaptiveModulations, - }, - linkOperationalParameters: { - bandKeyId: band.keyId, - rainPolarity: polarization!, - rainModel: rainMethod, - rainRate: rainVal, - absorptionMethod: attenuationMethod, - calculationPeriod: worstMonth ? 'WORSTMONTH' : 'ANNUAL', - bandplanKeyId: region.keyId, - selectedChannelList: saveChannels, - }, - - - }; - - const callLinkPromise = (await dataService.saveLink(link as any, linkAttributes.id)); - dispatch(new linkSavedSuccessfulAction(callLinkPromise)); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/siteAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/siteAction.ts deleted file mode 100644 index e9bac4e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/siteAction.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { Action } from '../../../../../framework/src/flux/action'; - - - -//TODO: calculate distance if all lat/lons are set -export class UpdateLatLonAction extends Action { - constructor( - public lat1: number, - public lon1: number, - public lat2: number, - public lon2: number, - ) { - super(); - - } -} -export class locationMandatoryAction extends Action { - constructor(public locationMandatoryParameters: boolean) { - super(); - } -} - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/viewAction.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/viewAction.ts deleted file mode 100644 index b2a5a02..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/viewAction.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../../framework/src/flux/action'; - - -export class isCalculationServerReachableAction extends Action { - constructor(public reachable: boolean) { - super(); - } -} - -export class ResetFormAction extends Action { -} - -export class UpdateRainMethodDisplayAction extends Action { - constructor(public rainDisplay: boolean) { - super(); - } -} -export class PluginDoneLoadingAction extends Action { - constructor(public loadingComplete: boolean) { - super(); - } -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/waveguideActions.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/waveguideActions.ts deleted file mode 100644 index 917543f..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/actions/waveguideActions.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Waveguide } from '../model/waveguide'; -import { Action } from '../../../../../framework/src/flux/action'; - -export class UpdateWaveguideLossAction extends Action { - constructor(public waveguideLossA: number, public waveguideLossB: number) { - super(); - } -} -export class UpdatewaveguideListAction extends Action { - constructor(public waveguideListName: string[]) { - super(); - } -} - -export class updateWaveguideNameAction extends Action { - constructor(public waveguideNameA: string | null, public waveguideNameB: string | null) { - super(); - } -} -export class waveguideMandatoryAction extends Action { - constructor(public waveguideMandatoryParameters: boolean) { - super(); - } -} -export class UpdateWaveguideIdAction extends Action { - constructor(public waveguideIdSiteA: number | null, public waveguideIdSiteB: number | null) { - super(); - } -} -export class updateWaveguideTypeAction extends Action { - constructor(public waveguideTypeA: string | null, public waveguideTypeB: string | null) { - super(); - } -} -export class UpdateWaveguideParametersAction extends Action { - constructor(public waveguide: Waveguide[]) { - super(); - } -} -export class UpdateNewWaveguideParametersAction extends Action { - constructor(public waveguideParametersA: Waveguide | null, public waveguideParametersB: Waveguide | null) { - super(); - } -} - - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/assets/icons/microwaveAppIcon.svg b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/assets/icons/microwaveAppIcon.svg deleted file mode 100644 index 47b881e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/assets/icons/microwaveAppIcon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/adaptiveModulationDialog.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/adaptiveModulationDialog.tsx deleted file mode 100644 index 8587635..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/adaptiveModulationDialog.tsx +++ /dev/null @@ -1,157 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect, useState } from 'react'; - -import CloseIcon from '@mui/icons-material/Close'; -import makeStyles from '@mui/styles/makeStyles'; -import { InputProps } from '@mui/material/Input'; -import Dialog from '@mui/material/Dialog'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; -import DialogContent from '@mui/material/DialogContent'; -import DialogActions from '@mui/material/DialogActions'; -import IconButton from '@mui/material/IconButton'; -import Box from '@mui/material/Box'; - -import MaterialTable, { ColumnType, MaterialTableCtorType } from '../../../../../framework/src/components/material-table'; - -import { AdaptiveModulationTable } from '../model/adaptiveModulationTable'; -import { Modulation } from '../model/modulation'; -import Checkbox from '@mui/material/Checkbox'; -import Button from '@mui/material/Button'; - - -type PropTypes = InputProps & { - style?: React.CSSProperties; - open: boolean; - close(): void; - row: AdaptiveModulationTable[]; - direction: string; - selectedElement: string[]; - updateModulation(data: string[]): void; -}; - -const ModulationTable = MaterialTable as MaterialTableCtorType; -const styles = makeStyles({ - closeIcon: { - position: 'absolute', - top: 0, - right: 0, - color: 'black', - }, - closeButton: { - marginTop: 20, position: 'absolute', top: '850px', right: '50px', - }, - applyButton: { - marginTop: 20, position: 'absolute', top: '850px', right: '160px', - }, -}); - -export const AdaptiveModulationDialog: FC = ({ open, row, close, direction, selectedElement, updateModulation }) => { - const [selectedElements, setSelectedElements] = useState(selectedElement); - const classes = styles(); - - const onChange = (element: any) => { - const data: { modulation: string; parameters: Modulation | null } = { modulation: element.target.value, parameters: null }; - setSelectedElements([element.target.value]); - - if (selectedElements.includes(data.modulation)) { - - setSelectedElements(selectedElements.filter((i) => i !== data.modulation)); - - } else { - var newData = [...selectedElements, data.modulation]; - setSelectedElements(newData); - - } - }; - - const onClose = () => { - close(); - }; - - const onSave = () => { - updateModulation(selectedElements); - close(); - }; - useEffect(() => { - setSelectedElements(selectedElement); - }, []); - - return ( -
- onClose()} open={open} fullWidth maxWidth={'lg'} > - - - Adaptive Modulation - - {direction} - - - onClose()} - size="large"> - - - - - - {row !== null ? - <> ( onChange(e)} />), - }, - { property: 'dataRate', title: 'Data Rate (Mbit/s)', type: ColumnType.numeric }, - { property: 'receiverThresholdBER-3', title: 'Thrs BER 10-3 (dBm)', type: ColumnType.numeric }, - { property: 'receiverThresholdBER-6', title: 'Thrs BER 10-6 (dBm)', type: ColumnType.numeric }, - { property: 'receivedSignalLevel', title: 'RSL (dBm)', type: ColumnType.numeric }, - { property: 'linkMarginBER-3', title: 'Margin (dB)\n BER 10-3', type: ColumnType.numeric }, - { property: 'linkMarginBER-6', title: 'Margin (dB)\n BER 10-6', type: ColumnType.numeric }, - { property: 'txPowerMin', title: 'txPower\nMin(dBm)', type: ColumnType.numeric }, - { property: 'txPowerMax', title: 'txPower\nMax(dBm)', type: ColumnType.numeric }, - { property: 'rainAvailabilityBER-3', title: 'Rain Availability\n BER10-3', type: ColumnType.numeric }, - { property: 'rainAvailabilityBER-6', title: 'Rain Availability\n BER10-6', type: ColumnType.numeric }, - { property: 'multipathAvailabilityBER-3', title: 'multipath Fading\n BER10-3', type: ColumnType.numeric }, - { property: 'multipathAvailabilityBER-6', title: 'multipath Fading\n BER10-6', type: ColumnType.numeric }, - ]} /> - - - - - - : null - } - - -
- ); -}; -export default AdaptiveModulationDialog; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/antenna.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/antenna.tsx deleted file mode 100644 index 8951f4f..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/antenna.tsx +++ /dev/null @@ -1,255 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect } from 'react'; - -import FormControl from '@mui/material/FormControl'; -import FormHelperText from '@mui/material/FormHelperText'; -import InputLabel from '@mui/material/InputLabel'; -import MenuItem from '@mui/material/MenuItem'; -import Select from '@mui/material/Select'; -import Stack from '@mui/material/Stack'; -import TextField from '@mui/material/TextField'; -import Typography from '@mui/material/Typography'; -import makeStyles from '@mui/styles/makeStyles'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import { antennaMandatoryAction, UpdateAntennaAction } from '../actions/antennaActions'; -import { Antenna } from '../model/antenna'; -import { TextFieldwithAdornment } from './textFieldwithAdornment'; - - - -const antennaStyles = makeStyles({ - column: { - width: '220px', - }, - container: { - display: 'flex', flexDirection: 'column', width: 'column', - }, - component: { - flexDirection: 'row', justifyContent: 'space-around', - }, -}); - -const AntennaView: FC = (() => { - const antennaDb = useSelectApplicationState(state => state.microwave.antenna.antenna); - const eirpA = useSelectApplicationState(state => state.microwave.antenna.eirpA).toFixed(3); - const eirpB = useSelectApplicationState(state => state.microwave.antenna.eirpB).toFixed(3); - const antennaGainA = useSelectApplicationState(state => state.microwave.antenna.antennaGainA); - const antennaGainB = useSelectApplicationState(state => state.microwave.antenna.antennaGainB); - const aglA = useSelectApplicationState(state => state.microwave.antenna.antennaHeightA); - const aglB = useSelectApplicationState(state => state.microwave.antenna.antennaHeightB); - const lat1 = useSelectApplicationState(state => state.microwave.site.lat1); - const lon1 = useSelectApplicationState(state => state.microwave.site.lon1); - const lat2 = useSelectApplicationState(state => state.microwave.site.lat2); - const lon2 = useSelectApplicationState(state => state.microwave.site.lon2); - const antennaNameList = useSelectApplicationState(state => state.microwave.antenna.antennaNameList); - const antennaModelA = useSelectApplicationState(state => state.microwave.antenna.antennaNameA); - const antennaModelB = useSelectApplicationState(state => state.microwave.antenna.antennaNameB); - - const dispatch = useApplicationDispatch(); - - const updateAntennaParameters = (antennaA: Antenna | null, antennaB: Antenna | null) => { - dispatch(new UpdateAntennaAction(antennaA, antennaB)); - }; - const updateMandatoryParameters = (mandatoryParameters: boolean) => { - dispatch(new antennaMandatoryAction(mandatoryParameters)); - }; - - const classes = antennaStyles(); - - const checkMandatoryParameters = () => { - if (antennaModelA !== '0' && antennaModelB !== '0' && antennaGainA !== 0 && antennaGainB !== 0) { - updateMandatoryParameters(true); - } else { - updateMandatoryParameters(false); - } - }; - const updateAntennaName = async (antennaA: string | null, antennaB: string | null) => { - antennaDb.forEach(antenna => { - if (antennaA === antenna.modelName) { - updateAntennaParameters(antenna, null); - } - if (antenna.modelName === antennaB) { - updateAntennaParameters(null, antenna); - } - }); - - }; - - useEffect(() => checkMandatoryParameters(), [antennaModelA, antennaModelB]); - - return ( -
- - Site A - Site B - - - - - - --Antenna-- - - { - antennaModelA === '' && *Required - } - - - - --Antenna-- - - { - antennaModelB === '' && *Required - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ); - -}); -AntennaView.displayName = 'Antenna'; -export default AntennaView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/attenuations.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/attenuations.tsx deleted file mode 100644 index 4015f06..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/attenuations.tsx +++ /dev/null @@ -1,298 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { FC, useEffect } from 'react'; - -import FormControl from '@mui/material/FormControl'; -import FormControlLabel from '@mui/material/FormControlLabel'; -import FormHelperText from '@mui/material/FormHelperText'; -import Grid from '@mui/material/Grid'; -import InputLabel from '@mui/material/InputLabel'; -import MenuItem from '@mui/material/MenuItem'; -import Radio from '@mui/material/Radio'; -import RadioGroup from '@mui/material/RadioGroup'; -import Select from '@mui/material/Select'; -import Stack from '@mui/material/Stack'; -import makeStyles from '@mui/styles/makeStyles'; - - -import { attenuationMandatoryParametersAction, UpdateAttenuationMethodAction, UpdateRainMethodAction, UpdateRainValAction, UpdateWorstMonthAction } from '../actions/atmosphericLossAction'; -import { UpdatePolAction } from '../actions/linkAction'; -import { UpdateRainMethodDisplayAction } from '../actions/viewAction'; -import OutlinedDiv from './outlinedDiv'; -import { TextFieldwithAdornment } from './textFieldwithAdornment'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - - -const styles = makeStyles({ - - stack: { - display: 'flex', - justifyContent: 'center', - marginTop: '5', - paddingTop: '15px', - alignItems:'center', - }, - grid: { - display: 'flex', - flexDirection: 'column', - width: '500px', - }, - formStyle: { - paddingTop: '10px', - width: '40%', - }, - waterAbsorptionStyle: { - display: 'flex', - placeSelf: 'flex-end', - width: '35%', - paddingRight: '62px', - }, - textFieldwithAdornment: { - paddingTop: '10px', - width: '80%', - }, - insideGridStack: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'space-around', - }, - centerColumn: { - display: 'flex', - justifyContent: 'center', - marginTop: '5', - }, - -}); - -const AttenuationView: FC = (() => { - const classes = styles(); - const dispatch = useApplicationDispatch(); - const rainAtt = useSelectApplicationState(state => state.microwave.atmosphere.rainAtt); - const rainVal = useSelectApplicationState(state => state.microwave.atmosphere.rainVal); - const absorptionOxygen = useSelectApplicationState(state => state.microwave.atmosphere.absorptionOxygen); - const absorptionWater = useSelectApplicationState(state => state.microwave.atmosphere.absorptionWater); - const worstMonth = useSelectApplicationState(state => state.microwave.atmosphere.worstMonth); - const rainMethod = useSelectApplicationState(state => state.microwave.atmosphere.rainMethod); - const attenuationMethod = useSelectApplicationState(state => state.microwave.atmosphere.attenuationMethod); - const rainDisplay = useSelectApplicationState(state => state.microwave.view.rainDisplay); - const fsl = useSelectApplicationState(state => state.microwave.atmosphere.fsl); - const polarization = useSelectApplicationState(state => state.microwave.link.polarization); - - const updateRainValue = async (rainRate: number) => dispatch(new UpdateRainValAction(rainRate)); - const updateRainMethod = (rainMethodSelect: string) => dispatch(new UpdateRainMethodAction(rainMethodSelect)); - - const updateAttenuationMethod = (attenuationMethodSelect: string) => dispatch(new UpdateAttenuationMethodAction(attenuationMethodSelect)); - const updateRainMethodDisplay = (rainMethodDisplay: boolean) => dispatch(new UpdateRainMethodDisplayAction(rainMethodDisplay)); - const updateWorstMonth = (worstMonthSelect: string) => { - if (worstMonthSelect === 'Annual') { - dispatch(new UpdateWorstMonthAction(false)); - } else dispatch(new UpdateWorstMonthAction(true)); - }; - const updatePolarization = (polarizationSelect: 'HORIZONTAL' | 'VERTICAL' | null) => dispatch(new UpdatePolAction(polarizationSelect)); - const updateMandatoryParameters = (mandatoryParametersPresent: boolean) => dispatch(new attenuationMandatoryParametersAction(mandatoryParametersPresent)); - - - const checkMandatoryParameters = () => { - let error: boolean = false; - if (rainVal !== 0 && rainMethod.length > 0 && attenuationMethod.length > 0) { - error = true; - } - if (rainVal === 0 && rainMethod === 'ITURP8377' && attenuationMethod.length > 0) { - error = true; - } - updateMandatoryParameters(error); - }; - - useEffect(() => { - checkMandatoryParameters(); - }, [rainVal, rainMethod, attenuationMethod]); - - - const setRainValue = async (rainfall: number) => { - await updateRainValue(rainfall); - }; - const handleSelectChange = async (event: any) => { - if (event.target.name === 'rainmethod') { - await updateRainMethod(event.target.value as any); - if (await event.target.value === 'ITURP8377') { - updateRainMethodDisplay(false); - } else { - updateRainMethodDisplay(true); - } - - } else if (event.target.name === 'absorptionmethod') { - await updateAttenuationMethod(event.target.value as any); - } - }; - - const onRadioSelect = (e: any) => { - - if (e.target.name === 'worstmonth') { - updateWorstMonth(e.target.value); - } else if (e.target.name === 'polarization') { - updatePolarization(e.target.value); - } - }; - - - - return ( -
-
- - } label="Annual" - onChange={onRadioSelect} /> - } label="Worst Month" - onChange={onRadioSelect} /> - -
-
- -
- - - - - - --Rain Method-- - - {rainMethod.length === 0 && * Required } - - - } - label="Horizontal" - onChange={onRadioSelect} - /> - } - label="Vertical" - onChange={onRadioSelect} - /> - - - - { - await setRainValue(Number(e.target.value)); - }} - value={rainVal} - /> - - - - - - - - - - - --Absorption Method-- - - {(attenuationMethod.length === 0) && * Required } - - - - - - - - - -
- ); -}); - -export default AttenuationView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/channelListDialog.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/channelListDialog.tsx deleted file mode 100644 index c26743e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/channelListDialog.tsx +++ /dev/null @@ -1,316 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useEffect, FC } from 'react'; - -import CloseIcon from '@mui/icons-material/Close'; -import makeStyles from '@mui/styles/makeStyles'; -import { InputProps } from '@mui/material/Input'; -import Dialog from '@mui/material/Dialog'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; -import DialogContent from '@mui/material/DialogContent'; -import DialogActions from '@mui/material/DialogActions'; -import IconButton from '@mui/material/IconButton'; -import Box from '@mui/material/Box'; -import Stack from '@mui/material/Stack'; -import Button from '@mui/material/Button'; -import Checkbox from '@mui/material/Checkbox'; -import FormControl from '@mui/material/FormControl'; -import Select from '@mui/material/Select'; -import MenuItem from '@mui/material/MenuItem'; -import FormHelperText from '@mui/material/FormHelperText'; -import TextField from '@mui/material/TextField'; - -import MaterialTable, { ColumnType, MaterialTableCtorType } from '../../../../../framework/src/components/material-table'; -import { ChannelTable } from '../model/bandPlan'; -import { TextFieldwithAdornment } from './textFieldwithAdornment'; -import ConnectionInfo from './connectionInfo'; - - -type PropTypes = InputProps & { - style?: React.CSSProperties; - linkId: number; - open: boolean; - close(): void; - row: ChannelTable[]; - updatechannels(data: ChannelTable[], totalBandwidthMHz: number): void; - frequencyPlanSiteA: 'HIGH' | 'LOW'; - frequencyPlanSiteB: 'HIGH' | 'LOW'; - band: number; - selectedElementProp: ChannelTable[]; -}; - -const ChannelSelectTable = MaterialTable as MaterialTableCtorType; -const styles = makeStyles({ - closeIcon: { - position: 'absolute', - top: 0, - right: 0, - color: 'black', - }, - closeButton: { - marginTop: 10, position: 'absolute', top: '750px', right: '50px', - }, - applyButton: { - marginTop: 10, position: 'absolute', top: '750px', right: '160px', - }, - tables: { - height: '700px', - }, - dialogContent: { - height: '900px', - }, - summary: { - position: 'absolute', right: '160px', - }, - error: { - height: '200px', - }, -}); - -export const ChannelListDialog: FC = ({ open, row, close, updatechannels, linkId, band, frequencyPlanSiteA, frequencyPlanSiteB, selectedElementProp }) => { - - const [polarizationAlert, setPolarizationAlert] = React.useState(false); - const [selectedElements, setSelectedElements] = React.useState(selectedElementProp); - const [totalBandwidthMHz, setTotalBandwidthMHz] = React.useState(0); - - const classes = styles(); - - const onChange = (tableRow: ChannelTable, checked: boolean) => { - - if (checked) { - setSelectedElements(selectedElements.filter((x) => x.name !== tableRow.name)); - if (tableRow.polarization.length !== 0) { - if (tableRow.polarization === 'XPOL') { - setTotalBandwidthMHz(totalBandwidthMHz - 2 * tableRow.bandwidthMHz); - } else setTotalBandwidthMHz(totalBandwidthMHz - tableRow.bandwidthMHz); - } - - - } else { - tableRow.polarization = ''; - setSelectedElements([...selectedElements, tableRow]); - // setTotalBandwidthMHz(totalBandwidthMHz + tableRow.bandwidthMHz); - } - }; - - const onClose = () => { - close(); - }; - - const onSave = () => { - let checker = false; - selectedElements.forEach(channel => { - if (channel.polarization === '') { - checker = true; - setPolarizationAlert(true); - } - }); - if (!checker) { - setPolarizationAlert(false); - updatechannels(selectedElements, totalBandwidthMHz); - close(); - } - }; - - - const setChannelPolarization = (tableRow: ChannelTable, polarization: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | '') => { - - if (tableRow.polarization === 'HORIZONTAL' || tableRow.polarization === 'VERTICAL') { - if (polarization === 'XPOL') { - setTotalBandwidthMHz(totalBandwidthMHz + tableRow.bandwidthMHz); - } else setTotalBandwidthMHz(totalBandwidthMHz); - } else if (tableRow.polarization === '') { - if (polarization === 'XPOL') { - setTotalBandwidthMHz(totalBandwidthMHz + 2 * tableRow.bandwidthMHz); - } else { - setTotalBandwidthMHz(totalBandwidthMHz + tableRow.bandwidthMHz); - } - } else if (polarization === 'XPOL') { - setTotalBandwidthMHz(totalBandwidthMHz ); - } else { - debugger; - setTotalBandwidthMHz(totalBandwidthMHz - tableRow.bandwidthMHz); - } - - - tableRow.polarization = polarization; - setSelectedElements(selectedElements.map(x => { - if (x.keyId === tableRow.keyId) { - return tableRow; - } else return x; - })); - }; - - useEffect(() => { - let bandwidthList: number[] = []; - row.forEach(x => { - selectedElementProp.forEach(tableRow => { - if (tableRow.keyId === x.keyId) { - if (tableRow.polarization === 'XPOL') { - bandwidthList.push(2 * x.bandwidthMHz); - } else bandwidthList.push(x.bandwidthMHz); - } - }); - }); - row.map(eachRow => { - selectedElements.forEach(selectedRow => { - if (eachRow.keyId === selectedRow.keyId) { - eachRow.polarization = selectedRow.polarization; - } - }); - }); - setTotalBandwidthMHz(bandwidthList.reduce((partialSum, a) => partialSum + a, 0)); - }, []); - - - - return ( - <> - onClose()} open={open} fullWidth maxWidth={'lg'} > - - - Channel - - -
- Channel Select for link : {linkId} - - x.name)} - /> - - -
- - - - onClose()} - size="large"> - - - - {row !== null ? - <> - - - ( i.name === rowData.name).length > 0} - value={rowData.name} onClick={() => onChange(rowData, selectedElements.filter(i => i.name === rowData.name).length > 0)} />), width: 8, - }, - { property: 'bandwidthMHz', title: 'Bandwidth (MHz)', type: ColumnType.numeric, width: 3 }, - { property: 'centerFrequencyHigh', title: 'Frequency ' + frequencyPlanSiteA + '(MHz)', type: ColumnType.numeric, width: 3 }, - { property: 'centerFrequencyLow', title: 'Frequency ' + frequencyPlanSiteB + '(MHz)', type: ColumnType.numeric, width: 3 }, - { - property: 'polarization', type: ColumnType.custom, title: 'Polarization', customControl: ({ rowData }) => ( - - - - {selectedElements.filter(i => i.name === rowData.name).length > 0 && rowData.polarization.length === 0 && *Required } - - - ), - }, - { property: 'availability', title: 'Availability', type: ColumnType.text, width: 3 }, - { property: 'xPolCondition', title: 'XPol', type: ColumnType.text, width: 3 }, - ]} /> - - - - - - - - - : null - - } -
- -
- - { - polarizationAlert && - - - - - - setPolarizationAlert(false)} - size="large"> - - - - - - - - - - } - - - - - - ); -}; -export default ChannelListDialog; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/connectionInfo.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/connectionInfo.tsx deleted file mode 100644 index 87f7eca..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/connectionInfo.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; - -import makeStyles from '@mui/styles/makeStyles'; -import { InputProps } from '@mui/material/Input'; -import Paper from '@mui/material/Paper'; -import Typography from '@mui/material/Typography'; - - -type PropTypes = InputProps & { - message : string; - messageType: string; - reachable: boolean; -}; -const ConnectionInfo: FC = (props : PropTypes) => { - const connectionStyles = makeStyles({ - pasperStyle: { - padding: 5, width: 230, position: 'absolute', top: '40%', left: '40%', - }, - wrappingDiv: { - display: 'flex', flexDirection: 'column', - }, - componentDiv: { - 'alignSelf': 'center', marginBottom: 5, - }, - }); - const classes = connectionStyles(); - return ( - (props.reachable === false) ? - -
-
- - - {props.messageType} - -
- {props.message} -
-
: null - - ); -}; - - -export default ConnectionInfo; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/frequencyChannel.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/frequencyChannel.tsx deleted file mode 100644 index 59e5a4c..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/frequencyChannel.tsx +++ /dev/null @@ -1,386 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useEffect, FC, useState } from 'react'; - -import makeStyles from '@mui/styles/makeStyles'; -import Stack from '@mui/material/Stack'; -import InputLabel from '@mui/material/InputLabel'; -import FormControl from '@mui/material/FormControl'; -import Select from '@mui/material/Select'; -import MenuItem from '@mui/material/MenuItem'; -import FormHelperText from '@mui/material/FormHelperText'; -import Grid from '@mui/material/Grid'; -import RadioGroup from '@mui/material/RadioGroup'; -import FormControlLabel from '@mui/material/FormControlLabel'; -import Radio from '@mui/material/Radio'; -import TextField from '@mui/material/TextField'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import Paper from '@mui/material/Paper'; -import DialogActions from '@mui/material/DialogActions'; -import IconButton from '@mui/material/IconButton'; -import CloseIcon from '@mui/icons-material/Close'; -import CircularProgress from '@mui/material/CircularProgress'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import { UpdateFrequencyPlanAction } from '../actions/linkAction'; -import { frequencyMandatoryParametersAction, ResetAction, updateFrequencyBand, UpdateTotalBandwidthAction } from '../actions/radioActions'; -import OutlinedDiv from './outlinedDiv'; -import { getAllBands, UpdateChannelQuery, UpdateChannelListLoadingAction, UpdateRegionRegulatorAction, UpdateChannelListAction } from '../actions/bandPlanAction'; -import { ChannelTable, RegionRegulator } from '../model/bandPlan'; -import ChannelListDialog from './channelListDialog'; -import ConnectionInfo from './connectionInfo'; -import { TextFieldwithAdornment } from './textFieldwithAdornment'; - -const styles = makeStyles({ - fitContent: { - width: 'fit-content', - }, - column: { - width: '220px', - }, - container: { - display: 'flex', flexDirection: 'column', width: 'column', - }, - component: { - flexDirection: 'row', justifyContent: 'space-around', - }, - centerColumn: { - display: 'flex', - alignItems: 'center', - marginTop: '5', - }, - channelRow: { - flexDirection: 'row', justifyContent: 'space-evenly', - }, - loading: { - position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999, - - }, - closeIcon: { - marginTop: 20, top: '-75px', right: '-40px', - }, -}); - -const FrequencyChannelView: FC = (() => { - const [isOpenDialog, setOpenDialog] = useState(false); - const band = useSelectApplicationState(state => state.microwave.radio.band); - const frequencyPlanA = useSelectApplicationState(state => state.microwave.bandPlan.frequencyPlanA); - const frequencyPlanB = useSelectApplicationState(state => state.microwave.bandPlan.frequencyPlanB); - const bandList = useSelectApplicationState(state => state.microwave.bandPlan.bandList); - const regionRegulatorList = useSelectApplicationState(state => state.microwave.bandPlan.regionRegulatorList); - const regulator = useSelectApplicationState(state => state.microwave.bandPlan.region); - const processing = useSelectApplicationState(state => state.microwave.bandPlan.channelListLoading); - const linkId = useSelectApplicationState(state => state.microwave.link.linkId); - const channelListQuery = useSelectApplicationState(state => state.microwave.bandPlan.channelListQuery); - const allChannels = useSelectApplicationState(state => state.microwave.bandPlan.allChannels); - const totalBandwidthMHz = useSelectApplicationState(state => state.microwave.radio.totalBandwidthMHz); - const frequencyPlanProcessing = useSelectApplicationState(state => state.microwave.bandPlan.frequencyPlanProcessing); - const savedChannels = useSelectApplicationState(state => state.microwave.bandPlan.savedChannels); - const dispatch = useApplicationDispatch(); - - const updateFrequency = (bandKeyId: string) => dispatch(updateFrequencyBand(bandKeyId)); - const updateFrequencyPlan = (planA: 'HIGH' | 'LOW', planB: 'HIGH' | 'LOW') => dispatch(new UpdateFrequencyPlanAction(planA, planB)); - const updateMandatoryParameters = (mandatoryParameters: boolean) => dispatch(new frequencyMandatoryParametersAction(mandatoryParameters)); - const updateRegion = (region: RegionRegulator) => { - dispatch(new UpdateRegionRegulatorAction(region)); - dispatch(new ResetAction()); - }; - const getBandList = (bandplanKeyId: string) => dispatch(getAllBands(bandplanKeyId)); - const channelList = async (regionId: string, bandKeyId: string) => dispatch(UpdateChannelQuery(regionId, bandKeyId)); - const updatechannelsAndBandwidth = (channels: ChannelTable[], bandwidthMHz: number) => { - dispatch(new UpdateChannelListAction(channels)); - dispatch(new UpdateTotalBandwidthAction(bandwidthMHz)); - }; - const updateChannelListLoading = (proccessing: boolean) => dispatch(new UpdateChannelListLoadingAction(proccessing)); - - const classes = styles(); - - const frequencyChange = async (frequency: number) => { - if (frequency !== band.frequency) { - bandList.forEach(x => { - if (x.name === frequency.toString()) { - updateFrequency(x.keyId); - } - }); - - } - - }; - const regionChange = async (regionAsString: string) => { - if (regionAsString !== regulator.name) { - regionRegulatorList.forEach(async region => { - if (regionAsString === region.name) { - await updateRegion(region); - getBandList(region.keyId); - } - }); - } - - }; - const onRadioSelect = (e: any) => { - if (e.target.name === 'site-a-frequency-plan') { - if (e.target.value === 'HIGH') { - updateFrequencyPlan(e.target.value, 'LOW'); - } else { - updateFrequencyPlan(e.target.value, 'HIGH'); - } - } else if (e.target.name === 'site-b-frequency-plan') { - if (e.target.value === 'HIGH') { - updateFrequencyPlan('LOW', e.target.value); - } else { - updateFrequencyPlan('HIGH', e.target.value); - } - } - }; - - - const checkMandatoryParameters = () => { - if (band.frequency !== 0) { - updateMandatoryParameters(true); - } else { - updateMandatoryParameters(false); - } - }; - const handleClickOpen = (show: boolean) => { - setOpenDialog(show); - }; - const getChannelList = async () => { - - bandList.forEach(x => { - if (x.keyId === band.keyId) { - channelList(regulator.keyId, band.keyId); - } - }); - handleClickOpen(true); - }; - const handleDialogClose = () => { - updateChannelListLoading(true); - setOpenDialog(false); - - }; - const updatechannels = (selectedChannels: ChannelTable[], bandwidthMHz: number) => { - updatechannelsAndBandwidth(selectedChannels, bandwidthMHz); - - }; - useEffect(() => { - checkMandatoryParameters(); - }, [band.frequency]); - - return ( -
- {frequencyPlanProcessing ? - -
- -
-
- : -
- - - --Region-- - - {band.frequency == 0 && *Required } - - - - - --Band (GHz) -- - - {band.frequency == 0 && *Required } - - - - - - - - - - } label="High" onChange={onRadioSelect} /> - } label="Low" onChange={onRadioSelect} /> - - - - - - - } label="High" onChange={onRadioSelect} /> - } label="Low" onChange={onRadioSelect} /> - - - - - - x.polarization === 'XPOL' ? x.name + '[xpol]' : x.name)} - /> - - - - - - x.polarization === 'XPOL' ? x.name + '[xpol]' : x.name)} - /> - -
- {isOpenDialog && - <> - {processing ? - - - - - Channel Select - - - - - - - -
- -

Processing ...

-
-
-
-
-
- : - <> - {channelListQuery.length > 0 ? - - - - : -
- - - - Channel - - - - - - - - - - - -
- - } - - } - - } - -
-
- } -
- ); - -}); -FrequencyChannelView.displayName = 'Frequency'; -export default FrequencyChannelView; - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/linkTable.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/linkTable.tsx deleted file mode 100644 index 5f07bbd..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/linkTable.tsx +++ /dev/null @@ -1,123 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { FC, useEffect } from 'react'; - -import { Loader } from '../../../../../framework/src/components/material-ui/loader'; - -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../../framework/src/components/material-table'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { Link } from '../../lineOfSight/model/lineOfSightLatLon'; -import { getLinkDetails } from '../../lineOfSight/service/lineOfSightHeightService'; -import { createLinkTableActions, createLinkTableProperties } from '../handlers/linkTableHandler'; -import MenuItem from '@mui/material/MenuItem'; -import Typography from '@mui/material/Typography'; - - - -const LinkTable = MaterialTable as MaterialTableCtorType; - - -let initialSorted = false; - -const LinkTableComponent: FC = (() => { - - const linkTableProperties = createLinkTableProperties(useSelectApplicationState(state => state)); - const loading = linkTableProperties.loading; - const dispatch = useApplicationDispatch(); - const linkTableActions = createLinkTableActions(dispatch); - const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path)); - - useEffect(() => { - if (!initialSorted) { - initialSorted = true; - linkTableActions.onHandleRequestSort('id'); - } else { - linkTableActions.onRefresh(); - } - }, []); - - const getContextMenu = (rowData: any) => { - return [ - { - navigateToApplication('microwave', `calculateLink/?linkId=${rowData.id}`); - }}> - Calculate Link - , - { - await getLinkDetails(rowData.id).then((data: Link) => { - let heightPart = `&amslA=${data.siteA.amslM}&antennaHeightA=${data.siteA.radioAntenna.operationalParameters.agl}&amslB=${data.siteB.amslM}&antennaHeightB=${data.siteB.radioAntenna.operationalParameters.agl}`; - navigateToApplication('microwave', `lineOfSightMap/los?lat1=${data.siteA.lat}&lon1=${data.siteA.lon}&lat2=${data.siteB.lat}&lon2=${data.siteB.lon}${heightPart}`); - }); - }}> - Line Of Sight - , - ]; - }; - - return ( -
-
- {loading && ( -
- -

Loading...

-
- ) - } -
- { - return <>{rowData.siteA.id}; - }, - }, - { - property: 'siteB', title: 'SiteB', type: ColumnType.custom, - customControl: ({ rowData }) => { - return <>{rowData.siteB.id}; - }, - }, - { property: 'operationalState', title: 'operational State', type: ColumnType.text }, - { property: 'operatorId', title: 'Operator Id', type: ColumnType.text }, - { property: 'lifecycleState', title: 'life Cycle State', type: ColumnType.text }, - ]} - idProperty="id" {...linkTableActions} {...linkTableProperties} - createContextMenu={(rowData) => { - return getContextMenu(rowData); - }} /> -
- ); -}); - - -export default LinkTableComponent; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/location.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/location.tsx deleted file mode 100644 index 0b88a89..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/location.tsx +++ /dev/null @@ -1,262 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; - -import TextField from '@mui/material/TextField'; -import Typography from '@mui/material/Typography'; -import makeStyles from '@mui/styles/makeStyles'; -import Stack from '@mui/material/Stack'; - -import { useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { LatLonToDMS } from '../utils/geoConverter'; - -import { TextFieldwithAdornment } from './textFieldwithAdornment'; -import ManualLocationEnter from './manualLocationEntr'; - -const styles = makeStyles({ - column: { - width: '220px', - }, - container: { - display: 'flex', flexDirection: 'column', width: 'column', - }, - component: { - flexDirection: 'row', justifyContent: 'space-around', - }, - centerColumn: { - display: 'flex', - alignItems: 'center', - marginTop: '5', - }, -}); - - -const LocationView: React.FC = (() => { - const linkId = useSelectApplicationState(state => state.microwave.link.linkId); - const lat1 = useSelectApplicationState(state => state.microwave.site.lat1); - const lon1 = useSelectApplicationState(state => state.microwave.site.lon1); - const lat2 = useSelectApplicationState(state => state.microwave.site.lat2); - const lon2 = useSelectApplicationState(state => state.microwave.site.lon2); - const formView = useSelectApplicationState(state => state.microwave.view.formView); - const siteA = useSelectApplicationState(state => state.microwave.site.siteNameA); - const siteB = useSelectApplicationState(state => state.microwave.site.siteNameB); - const distance = useSelectApplicationState(state => state.microwave.link.distance); - const amslA = useSelectApplicationState(state => state.microwave.site.amslA); - const amslB = useSelectApplicationState(state => state.microwave.site.amslB); - const siteAId = useSelectApplicationState(state => state.microwave.site.siteIdA); - const siteBId = useSelectApplicationState(state => state.microwave.site.siteIdB); - const azimuthDegSiteA = useSelectApplicationState(state => state.microwave.site.azimuthA); - const azimuthDegSiteB = useSelectApplicationState(state => state.microwave.site.azimuthB); - const tiltDegSiteA = useSelectApplicationState(state => state.microwave.site.tiltDegA); - const tiltDegSiteB = useSelectApplicationState(state => state.microwave.site.tiltDegB); - - - const classes = styles(); - - return ( - <> - - {!formView && - - } -
- - - - - - Site A - - Site B - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - ); - -}); -export default LocationView; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/manualLocationEntr.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/manualLocationEntr.tsx deleted file mode 100644 index 9d2c104..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/manualLocationEntr.tsx +++ /dev/null @@ -1,164 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { useState } from 'react'; - -import Stack from '@mui/material/Stack'; -import TextField from '@mui/material/TextField'; -import Typography from '@mui/material/Typography'; -import makeStyles from '@mui/styles/makeStyles'; - -import { locationMandatoryAction, UpdateLatLonAction } from '../actions/siteAction'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - - - - - - -const styles = makeStyles({ - row: { flexDirection: 'column', display: 'flex', width: '60%', marginLeft: '10px' }, -}); - -const ManualLocationEnter: React.FC = (() => { - - const [latitude1Error, setLatitude1Error] = useState(''); - const [latitude2Error, setLatitude2Error] = useState(''); - const [longitude1Error, setLongitude1Error] = useState(''); - const [longitude2Error, setLongitude2Error] = useState(''); - - const lat1 = useSelectApplicationState(state => state.microwave.site.lat1); - const lon1 = useSelectApplicationState(state => state.microwave.site.lon1); - const lat2 = useSelectApplicationState(state => state.microwave.site.lat2); - const lon2 = useSelectApplicationState(state => state.microwave.site.lon2); - // const latitude1Error = useSelectApplicationState(state => state.microwave.error.latitude1Error); - // const latitude2Error = useSelectApplicationState(state => state.microwave.error.latitude2Error); - // const longitude1Error = useSelectApplicationState(state => state.microwave.error.longitude1Error); - // const longitude2Error = useSelectApplicationState(state => state.microwave.error.longitude2Error); - const loadingComplete = useSelectApplicationState(state => state.microwave.view.loadingComplete); - - - const dispatch = useApplicationDispatch(); - const updateLatLon = (updateLat1: number, updateLon1: number, updateLat2: number, updateLon2: number) => dispatch(new UpdateLatLonAction(updateLat1, updateLon1, updateLat2, updateLon2)); - const updateMandatoryParameters = (mandatory: boolean) => dispatch(new locationMandatoryAction(mandatory)); - - const classes = styles(); - - const checkMandatoryParameters = () => { - if (latitude1Error === '' && longitude1Error === '' && latitude1Error === '' && longitude1Error === '') { - updateMandatoryParameters(true); - } else updateMandatoryParameters(false); - }; - React.useEffect(() => { - checkMandatoryParameters(); - }, [loadingComplete]); - - const changeLatLon = (e: any) => { - - if (e.target.id == 'Lat1') { - updateLatLon(e.target.value, lon1, lat2, lon2); - } - if (e.target.id == 'Lon1') { - updateLatLon(lat1, e.target.value, lat2, lon2); - } - if (e.target.id == 'Lat2') { - updateLatLon(lat1, lon1, e.target.value, lon2); - } - if (e.target.id == 'Lon2') { - updateLatLon(lat1, e.target.value, lat2, e.target.value); - } - }; - - const handleChange = (e: any) => { - - if (e.target.id === 'Lat1') { - if (e.target.value > 90 || e.target.value < -90) { - setLatitude1Error('Enter a number between -90 to 90'); - } else { - changeLatLon(e); - setLatitude1Error(''); - } - } else if (e.target.id === 'Lat2') { - if (e.target.value > 90 || e.target.value < -90) { - setLatitude2Error('Enter a number between -90 to 90'); - } else { - changeLatLon(e); - setLatitude2Error(''); - } - } else if (e.target.id === 'Lon1') { - if (e.target.value > 180 || e.target.value < -180) { - setLongitude1Error('Enter a number between -180 to 180'); - } else { - changeLatLon(e); - setLongitude1Error(''); - } - } else if (e.target.id === 'Lon2') { - if (e.target.value > 180 || e.target.value < -180) { - setLongitude2Error('Enter a number between -180 to 180'); - } else { - changeLatLon(e); - setLongitude2Error(''); - } - } - checkMandatoryParameters(); - }; - - - return ( - - - Site A - Site B - - - - 0 || latitude1Error!.length > 0} - onChange={(e: any) => { - handleChange(e); - }} /> - 0 || longitude1Error!.length > 0} - onChange={(e: any) => { - handleChange(e); - }} /> - - - - 0 || latitude2Error!.length > 0} - onChange={(e: any) => { - handleChange(e); - }} /> - 0 || longitude2Error!.length > 0} - onChange={(e: any) => { - handleChange(e); - }} /> - - - - - ); -}); -export default ManualLocationEnter; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/missingInformation.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/missingInformation.tsx deleted file mode 100644 index 6698e4a..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/missingInformation.tsx +++ /dev/null @@ -1,45 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; - -import Paper from '@mui/material/Paper'; -import Typography from '@mui/material/Typography'; -import { useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - - -const MissingInformation: FC = (() => { - const isCalculationServerReachable = useSelectApplicationState(state => state.microwave.view.reachable); - const formView = useSelectApplicationState(state => state.microwave.view.formView); - return ( - (isCalculationServerReachable && formView) ? -
-
Link Information Missing
- -
-
: null - - ); -}); - - -export default MissingInformation; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/outlinedDiv.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/outlinedDiv.tsx deleted file mode 100644 index 806035f..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/outlinedDiv.tsx +++ /dev/null @@ -1,48 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { CSSProperties, FC } from 'react'; - -import TextField from '@mui/material/TextField'; -import { InputProps } from '@mui/material/Input'; - -type PropTypes = InputProps & { - label: string; - style?: CSSProperties; -}; - -const InputComponent : FC = ({ ...other }) =>
; - -export const OutlinedDiv: FC = ({ label, children, style }) => { - return ( - - ); -}; -export default OutlinedDiv; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/radio.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/radio.tsx deleted file mode 100644 index 6421964..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/radio.tsx +++ /dev/null @@ -1,597 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { FC, useEffect, useState } from 'react'; - -import CloseIcon from '@mui/icons-material/Close'; -import Divider from '@mui/material/Divider'; -import makeStyles from '@mui/styles/makeStyles'; -import Stack from '@mui/material/Stack'; -import Typography from '@mui/material/Typography'; -import FormControl from '@mui/material/FormControl'; -import InputLabel from '@mui/material/InputLabel'; -import Select from '@mui/material/Select'; -import MenuItem from '@mui/material/MenuItem'; -import FormHelperText from '@mui/material/FormHelperText'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import Paper from '@mui/material/Paper'; -import DialogActions from '@mui/material/DialogActions'; -import IconButton from '@mui/material/IconButton'; - - - -import { adaptiveModulationInputCreator, UpdateAdaptiveModulationProcessing } from '../../linkCalculator/actions/adaptiveModulationAction'; -import { radioMandatoryParametersAction, UpdateEnabeldAdaptiveModulations, UpdateModulationAction, updateRadioAttributes, UpdateModulationParametersAction, UpdateTxPowerAction } from '../actions/radioActions'; -import { Modulation } from '../model/modulation'; -import AdaptiveModulationDialog from './adaptiveModulationDialog'; -import { Radio } from '../model/radio'; -import { isNumber } from '../utils/math'; -import { TextFieldwithAdornment } from './textFieldwithAdornment'; -import ConnectionInfo from './connectionInfo'; -import CircularProgress from '@mui/material/CircularProgress'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - - - - - - - - - - - - - -const styles = makeStyles({ - modulationControl: { width: '230px' }, - adaptiveModulationButton: { paddingTop: '10px', width: '250px' }, - radioResultBox: { display: 'flex', flexDirection: 'row', justifyContent: 'space-around' }, - loading: { - position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999, - }, - pasperStyle: { - padding: 5, width: 230, position: 'absolute', top: '40%', left: '40%', - }, - componentDiv: { - 'alignSelf': 'center', marginBottom: 5, - }, - wrappingDiv: { - display: 'flex', flexDirection: 'column', - }, - closeIcon: { - marginTop: 20, top: '-75px', right: '-40px', - }, - container: { - display: 'flex', flexDirection: 'column', width: 'column', - }, - component: { - flexDirection: 'row', justifyContent: 'space-around', - }, - textField: { - width: '85%', - }, - column: { - width: '220px', - }, -}); - -const RadioView: FC = (() => { - const [isOpenDialog, setOpenDialog] = useState(false); - const [adaptiveModulationSite, setAdaptiveModulationSite] = useState(''); - const classes = styles(); - const radioNameList = useSelectApplicationState(state => state.microwave.radio.radioNameList); - const rxPowerA = useSelectApplicationState(state => state.microwave.radio.rxPowerA); - const rxPowerB = useSelectApplicationState(state => state.microwave.radio.rxPowerB); - const systemOperatingMarginA = useSelectApplicationState(state => state.microwave.radio.systemOperatingMarginA); - const systemOperatingMarginB = useSelectApplicationState(state => state.microwave.radio.systemOperatingMarginB); - const radioModelA = useSelectApplicationState(state => state.microwave.radio.radioNameA); - const radioModelB = useSelectApplicationState(state => state.microwave.radio.radioNameB); - const radioTxPowerA = useSelectApplicationState(state => state.microwave.radio.txPowerA); - const radioTxPowerB = useSelectApplicationState(state => state.microwave.radio.txPowerB); - const radioParameters = useSelectApplicationState(state => state.microwave.radio.radioParameters); - const radioBandwidthA = useSelectApplicationState(state => state.microwave.radio.radioBandwidthA); - const radioBandwidthB = useSelectApplicationState(state => state.microwave.radio.radioBandwidthB); - const modulationListA = useSelectApplicationState(state => state.microwave.radio.modulationListA); - const modulationListB = useSelectApplicationState(state => state.microwave.radio.modulationListB); - const radioModulationA = useSelectApplicationState(state => state.microwave.radio.modulationA); - const radioModulationB = useSelectApplicationState(state => state.microwave.radio.modulationB); - const modulationParametersA = useSelectApplicationState(state => state.microwave.radio.modulationParametersA); - const modulationParametersB = useSelectApplicationState(state => state.microwave.radio.modulationParametersB); - const adaptiveModulationTableBtoA = useSelectApplicationState(state => state.microwave.radio.adaptiveModulationTableBtoA); - const adaptiveModulationTableAtoB = useSelectApplicationState(state => state.microwave.radio.adaptiveModulationTableAtoB); - const enabledAdaptiveModulations = useSelectApplicationState(state => state.microwave.radio.enabledAdaptiveModulations); - const rxThresholdBER3A = useSelectApplicationState(state => state.microwave.radio.thresholdBER3A); - const rxThresholdBER6A = useSelectApplicationState(state => state.microwave.radio.thresholdBER6A); - const rxThresholdBER3B = useSelectApplicationState(state => state.microwave.radio.thresholdBER3B); - const rxThresholdBER6B = useSelectApplicationState(state => state.microwave.radio.thresholdBER6B); - const processing = useSelectApplicationState(state => state.microwave.radio.processing); - const admTableMessage = useSelectApplicationState(state => state.microwave.radio.admMessage); - const admTableStatus = useSelectApplicationState(state => state.microwave.radio.admStatus); - const radios = useSelectApplicationState(state => state.microwave.radio.radioParameters); - - const dispatch = useApplicationDispatch(); - - const UpdateTxPower = async (txPowerA: number | null, txPowerB: number | null) => dispatch(new UpdateTxPowerAction(txPowerA, txPowerB)); - const updateRadio = async (radioA: string | null, radioB: string | null) => dispatch(updateRadioAttributes(radioA ? radioA : radioB, radioB ? radioB : radioA, radios)); - const updateMandatoryParameters = (parametersComplete: boolean) => dispatch(new radioMandatoryParametersAction(parametersComplete)); - const updateRadioModulation = async (modulationA: string | null, modulationB: string | null) => dispatch(new UpdateModulationAction(modulationA, modulationB)); - const updateModulationParameters = (newModulationParametersA: Modulation | null, newModulationParametersB: Modulation | null) => dispatch(new UpdateModulationParametersAction(newModulationParametersA, newModulationParametersB)); - const adaptiveModulation = async () => dispatch(adaptiveModulationInputCreator()); - const updateADMlist = (admList: any) => dispatch(new UpdateEnabeldAdaptiveModulations(admList.map((x: any) => x.modulation))); - const resetAdapativeModulationTableProcessing = () => dispatch(new UpdateAdaptiveModulationProcessing(true)); - const handleClickOpen = (show: boolean) => { - setOpenDialog(show); - }; - - const calculateAdaptiveModulation = async () => { - handleClickOpen(true); - await adaptiveModulation(); - }; - - const checkMandatoryParameters = () => { - - if (radioModelA.length > 0 && radioModelB.length > 0) { - if (radioModulationA.length > 0 && radioModulationB.length > 0) { - if (isNumber(radioTxPowerA) || radioTxPowerA === 0) { - if (isNumber(radioTxPowerB) || radioTxPowerB === 0) { - if (Number(modulationParametersA?.txMax!)) { - if (Number(modulationParametersB?.txMax!)) { - updateMandatoryParameters(true); - } - } - } - } else updateMandatoryParameters(false); - } - } - }; - - useEffect(() => { - checkMandatoryParameters(); - }, [radioModelA, radioModelB, radioModulationA, radioModulationB, radioTxPowerA, radioTxPowerB, modulationParametersA?.txMax, modulationParametersB?.txMax]); - - - - const handleDialogClose = () => { - resetAdapativeModulationTableProcessing(); - setOpenDialog(false); - - }; - - const setModulationParameters = (modulationA: string | null, modulationB: string | null) => { - updateRadioModulation(modulationA, modulationB); - - radioParameters.forEach(async (element: Radio) => { - if (radioModelA !== null && radioModelA === element.modelName) { - Object.entries(element.operationalParameters?.modulations!).forEach((elementModulation) => { - if (elementModulation[0] === modulationA) { - updateModulationParameters(elementModulation[1] as any, null); - } - }); - } - if (radioModelB !== null && radioModelB === element.modelName) { - Object.entries(element.operationalParameters?.modulations!).forEach((elementModulation) => { - if (elementModulation[0] === modulationB) { - updateModulationParameters(null, elementModulation[1] as any); - } - }); - } - }); - }; - - - const selectModulation = async (modulationA: string | null, modulationB: string | null) => { - setModulationParameters(modulationA ? modulationA : modulationB, modulationB ? modulationB : modulationA); - }; - const updateTxPower = async (txPowerA: number | null, txPowerB: number | null) => { - await UpdateTxPower(txPowerA, txPowerB); - }; - - const updateADMModulation = (modulationList: string[]) => { - let admList: { modulation: string; parameter: Modulation | null }[] = []; - radioParameters.forEach(y => { - if (y.modelName === radioModelA) { - modulationList.forEach(modulation => { - let entry: { modulation: string; parameter: Modulation | null } = { modulation: '', parameter: null }; - entry.modulation = modulation; - const parameter: any = y.operationalParameters?.modulations!; - if (parameter[modulation]) { - entry.parameter = parameter[modulation]; - admList.push(entry); - } - }); - } - }); - updateADMlist(admList); - }; - return ( -
- - - - Site A - - Site B - - - - - - - --Radio-- - - { - radioModelA === '' && *Required - } - - - - --Radio-- - - { - radioModelB === '' && *Required - } - - - - - - - - - - - - - --Reference Modulation-- - - { - radioModulationA === '' && *Required - } - - - - --Reference Modulation-- - - { - radioModulationB === '' && *Required - } - - - - - - - - - - - - -
- {isOpenDialog && - <> - {processing ? - - - - - - Adaptive Modulation - - - - - - - -
- -

Processing ...

-
-
-
-
-
- : - <> - {admTableStatus === 200 ? - - - - - - : -
- - - - Adaptive Modulation - - - - - - - - - - - -
- - } - - } - - } - -
- - - { - updateTxPower(Number(e.target.value), null); - }} - /> - { - updateTxPower(null, Number(e.target.value)); - }} - /> - -
-
- - - - - - - - - - - -
- -
- - - - - - - - - - -
-
-
- - ); - -}); - -export default RadioView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/textFieldwithAdornment.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/textFieldwithAdornment.tsx deleted file mode 100644 index 346200d..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/textFieldwithAdornment.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import Input, { InputProps } from '@mui/material/Input'; -import FormControl from '@mui/material/FormControl'; -import InputLabel from '@mui/material/InputLabel'; - -import FormHelperText from '@mui/material/FormHelperText'; - -type TextFieldProps = InputProps & { - label: string; - andornmentUnit: string; - error: boolean; - errorText: string; - -}; - -export const TextFieldwithAdornment : FC = (props: TextFieldProps) => { - - const { id, label, errorText, error, style, andornmentUnit, ...otherProps } = props; - - - return ( - - {label} - - {errorText} - - ); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/waveguide.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/waveguide.tsx deleted file mode 100644 index c368c2a..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/components/waveguide.tsx +++ /dev/null @@ -1,328 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect, useState } from 'react'; - -import makeStyles from '@mui/styles/makeStyles'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - - -import { UpdateNewWaveguideParametersAction, waveguideMandatoryAction } from '../actions/waveguideActions'; -import { Waveguide } from '../model/waveguide'; -import { TextFieldwithAdornment } from './textFieldwithAdornment'; -import Stack from '@mui/material/Stack'; -import Typography from '@mui/material/Typography'; -import FormControl from '@mui/material/FormControl'; -import InputLabel from '@mui/material/InputLabel'; -import Select from '@mui/material/Select'; -import MenuItem from '@mui/material/MenuItem'; -import FormHelperText from '@mui/material/FormHelperText'; -import TextField from '@mui/material/TextField'; - - - - -const waveguideStyles = makeStyles({ - siteLabel: { - marginTop: '10px', - }, - column: { - width: '220px', - }, - container: { - display: 'flex', flexDirection: 'column', width: 'column', - }, - component: { - flexDirection: 'row', justifyContent: 'space-around', - }, -}); - - - - -const WaveguideView: FC = (() => { - const [enterWaveguideLengthA, setEnterWaveguideLengthA] = useState(false); - const [enterWaveguideLengthB, setEnterWaveguideLengthB] = useState(false); - - const waveguideLossA = useSelectApplicationState(state => state.microwave.waveguide.waveguideLossA); - const waveguideLossB = useSelectApplicationState(state => state.microwave.waveguide.waveguideLossB); - const waveguideSiteA = useSelectApplicationState(state => state.microwave.waveguide.waveguideNameA); - const waveguideSiteB = useSelectApplicationState(state => state.microwave.waveguide.waveguideNameB); - const waveguidelengthA = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthDisplayA); - const waveguidelengthB = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthDisplayB); - const waveguideTypeA = useSelectApplicationState(state => state.microwave.waveguide.waveguideTypeA); - const waveguideTypeB = useSelectApplicationState(state => state.microwave.waveguide.waveguideTypeB); - const waveguideParameters = useSelectApplicationState(state => state.microwave.waveguide.waveguideParameters); - const waveguideLengthACalculate = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthACalculate); - const waveguideLengthBCalculate = useSelectApplicationState(state => state.microwave.waveguide.waveguideLengthBCalculate); - const waveguideNameList = useSelectApplicationState(state => state.microwave.waveguide.waveguideNameList); - - const dispatch = useApplicationDispatch(); - - const updateMandatoryParameters = (mandatoryParameters: boolean) => dispatch(new waveguideMandatoryAction(mandatoryParameters)); - const updateWaveguideParameters = (waveguideParametersA: Waveguide | null, waveguideParametersB: Waveguide | null) => dispatch(new UpdateNewWaveguideParametersAction(waveguideParametersA, waveguideParametersB)); - - const classes = waveguideStyles(); - const updateWaveguide = async (waveguideA: string | null, waveguideB: string | null) => { - let waveguideAParameters: Waveguide; - let waveguideBParameters: Waveguide; - - waveguideParameters.forEach(async (element: Waveguide) => { - if (waveguideA !== null && waveguideA === element.modelName) { - - waveguideAParameters = element; - await updateWaveguideParameters(waveguideAParameters, waveguideBParameters); - - if (element.operationalParameters?.type === 'rigid') - setEnterWaveguideLengthA(false); - else - setEnterWaveguideLengthA(true); - } - if (waveguideB !== null && waveguideB === element.modelName) { - waveguideBParameters = element; - await updateWaveguideParameters(waveguideAParameters, waveguideBParameters); - - if (element.operationalParameters?.type === 'rigid') setEnterWaveguideLengthB(false); - else { - setEnterWaveguideLengthB(true); - } - } - }); - - }; - - const onChangeWaveguideLength = async (waveguideLengthA: number | null, waveguideLengthB: number | null) => { - - - let waveguideLengthAstate: number = waveguidelengthA; - let waveguideLengthBstate: number = waveguidelengthB; - let waveguideLengthACalculated = waveguideLengthACalculate; - let waveguideLengthBCalculated = waveguideLengthBCalculate; - if (waveguideLengthA && waveguideLengthA !== waveguideLengthAstate) { - - waveguideLengthAstate = waveguideLengthA; - waveguideLengthACalculated = waveguideLengthA; - - } - if (waveguideLengthB && waveguideLengthB !== waveguideLengthBstate) { - waveguideLengthBstate = waveguideLengthB; - waveguideLengthBCalculated = waveguideLengthB; - } - type Subset = { - [attr in keyof Waveguide]?: Waveguide[attr] extends object ? Subset : Waveguide[attr]; - }; - type Nested = { - [value in keyof Subset]?: Waveguide[value] extends object ? Nested : Subset; - }; - let waveguideAParameters: Nested | null = null; - let waveguideBParameters: Nested | null = null; - waveguideParameters.forEach(x => { - if (x.modelName === waveguideSiteA) { - - waveguideAParameters = { ...x, operationalParameters: { length: waveguideLengthAstate, type: x.operationalParameters?.type }, calculationParameters: { waveguideLength: waveguideLengthACalculated } }; - - } - - if (x.modelName === waveguideSiteB) { - - waveguideBParameters = { ...x, operationalParameters: { length: waveguideLengthBstate, type: x.operationalParameters?.type }, calculationParameters: { waveguideLength: waveguideLengthBCalculated } }; - - } - }); - - updateWaveguideParameters(waveguideAParameters, waveguideBParameters); - - }; - - const checkMandatoryParameters = () => { - if (waveguideTypeA === 'rigid') { - if (waveguidelengthA !== 0) { - updateMandatoryParameters(true); - } else updateMandatoryParameters(false); - } - if (waveguideTypeB === 'rigid') { - if (waveguidelengthB !== 0) { - updateMandatoryParameters(true); - } else updateMandatoryParameters(false); - } - if (waveguideTypeA === 'flexible_twistable') { - if (waveguideTypeB === 'flexible_twistable') { - updateMandatoryParameters(true); - } - } - }; - - useEffect(() => { - checkMandatoryParameters(); - - }, [waveguidelengthA, waveguidelengthB]); - - useEffect(() => { - if (waveguideTypeA === 'rigid') { - setEnterWaveguideLengthA(false); - } else setEnterWaveguideLengthA(true); - if (waveguideTypeB === 'rigid') { - setEnterWaveguideLengthB(false); - } else setEnterWaveguideLengthB(true); - checkMandatoryParameters(); - - }, [waveguideSiteA, waveguideSiteB]); - - - return ( - -
- - - - Site A - Site B - - - - - - - --Waveguide-- - - { - waveguideSiteA === '' && *Required - } - - - - - --Waveguide-- - - { - waveguideSiteB === '' && *Required - } - - - - - - - - { - - onChangeWaveguideLength(Number(e.target.value), null); - }} - /> - { - - onChangeWaveguideLength(null, Number(e.target.value)); - }} - /> - - - - - - -
- - ); - -}); - -export default WaveguideView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/antennaHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/antennaHandler.ts deleted file mode 100644 index 2e0dd15..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/antennaHandler.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { antennaMandatoryAction, UpdateAntennaAction, UpdateAntennaDBAction } from '../actions/antennaActions'; -import { UpdateCalculationResultAction } from '../actions/commonActions'; -import { FirstMandatoryCheckAction } from '../actions/errorAction'; -import { ResetAction, UpdateDeviceListsOnBandChangeAction, UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { ResetFormAction } from '../actions/viewAction'; -import { Antenna } from '../model/antenna'; - -export type antennaState = { - antenna: Antenna[]; - antennaIdSiteA: number; - antennaIdSiteB: number; - eirpA: number; - eirpB: number; - antennaGainA: number; - antennaGainB: number; - antennaNameA: string; - antennaNameB: string; - antennaNameList: string[]; - antennaMandatoryParameters: boolean; - antennaHeightA: number; - antennaHeightB: number; - -}; - -const initialState: antennaState = { - antennaIdSiteA: 0, - antennaIdSiteB: 0, - antenna: [], - eirpA: 0, - eirpB: 0, - antennaGainA: 0, - antennaGainB: 0, - antennaNameA: '', - antennaNameB: '', - antennaNameList: [], - antennaMandatoryParameters: true, - antennaHeightA: 0, - antennaHeightB: 0, - -}; - -export const AntennaHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof UpdateAntennaAction) { - if (action.antennaA && action.antennaA.operationalParameters) { - state = { ...state, antennaNameA: action.antennaA.modelName, antennaGainA: action.antennaA.operationalParameters.gain, antennaIdSiteA: action.antennaA.id }; - } - if (action.antennaB && action.antennaB.operationalParameters) { - state = { ...state, antennaNameB: action.antennaB.modelName, antennaGainB: action.antennaB.operationalParameters.gain, antennaIdSiteB: action.antennaB.id }; - } - } else if (action instanceof ResetFormAction) { - state = Object.assign({}, initialState, { antennaMandatoryParameters: false }); - } else if (action instanceof UpdateAntennaDBAction) { - state = Object.assign({}, state, { antenna: action.antenna, antennaNameList: action.antenna.map(x => { return x.modelName; }) }); - } else if (action instanceof FirstMandatoryCheckAction) { - if (state.antennaNameA !== '' && state.antennaNameB !== '' && state.antennaGainA !== 0 && state.antennaGainB !== 0) { - state = Object.assign({}, state, { ...state, antennaMandatoryParameters: true }); - } else state = Object.assign({}, state, { antennaMandatoryParameters: false }); - } else if (action instanceof antennaMandatoryAction) { - state = Object.assign({}, state, { antennaMandatoryParameters: action.antennaMandatoryParameters }); - } else if (action instanceof ResetAction) { - state = { ...state, antennaNameA: '', antennaNameB: '', antennaIdSiteA: 0, antennaIdSiteB: 0, antennaGainA: 0, antennaGainB: 0 }; - } else if (action instanceof UpdateDevicesOnFirstLoad) { - - state = { ...state, antennaNameList: action.antennas.map(e => e.modelName), antenna: action.antennas, - antennaHeightA: action.linkAttributes.siteA.radioAntenna?.operationalParameters?.agl!, - antennaHeightB: action.linkAttributes.siteB.radioAntenna?.operationalParameters?.agl! }; - action.antennas.map(antenna => { - - if (antenna.modelName === action.linkAttributes.siteA.radioAntenna?.modelName) { - state = { ...state, antennaNameA: antenna.modelName, antennaGainA: antenna.operationalParameters?.gain!, antennaIdSiteA: antenna.id }; - } - if (antenna.modelName === action.linkAttributes.siteB.radioAntenna?.modelName) { - state = { ...state, antennaNameB: antenna.modelName, antennaGainB: antenna.operationalParameters?.gain!, antennaIdSiteB: antenna.id }; - } - }); - } else if (action instanceof UpdateDeviceListsOnBandChangeAction) { - state = { ...state, antennaNameList: action.antennas.map(e => e.modelName), antenna: action.antennas }; - } else if (action instanceof UpdateCalculationResultAction) { - if (action.result.linkBudget) { - state = Object.assign({}, state, { ...state, eirpA: action.result.linkBudget.eirpA, eirpB: action.result.linkBudget.eirpB }); - } - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/atmosphericLossHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/atmosphericLossHandler.ts deleted file mode 100644 index f9c612d..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/atmosphericLossHandler.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { attenuationMandatoryParametersAction, UpdateAttenuationMethodAction, UpdateRainMethodAction, UpdateRainValAction, UpdateWorstMonthAction } from '../actions/atmosphericLossAction'; -import { UpdateCalculationResultAction } from '../actions/commonActions'; -import { FirstMandatoryCheckAction } from '../actions/errorAction'; -import { UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { ResetFormAction } from '../actions/viewAction'; - - -export type atmosphericLossState = { - rainVal: number; - rainAtt: number; - absorptionWater: number; - absorptionOxygen: number; - month: string; - fsl: number; - rainMethod: string; - attenuationMethod: string; - worstMonth: boolean; - attenuationMandatoryParameters: boolean; -}; - -const initialState: atmosphericLossState = { - fsl: 0, - rainVal: 0, - rainAtt: 0, - absorptionWater: 0, - absorptionOxygen: 0, - month: '', - rainMethod: '', - attenuationMethod: '', - worstMonth: false, - attenuationMandatoryParameters: true, - -}; -export const AtmosphericLossHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof UpdateRainValAction) { - state = Object.assign({}, state, { rainVal: action.rainVal }); - } else if (action instanceof ResetFormAction) { - state = Object.assign({}, initialState, { attenuationMandatoryParameters:false }); - } else if (action instanceof UpdateRainMethodAction) { - state = Object.assign({}, state, { rainMethod: action.rainMethod, rainVal: 0, rainAtt: 0 }); - } else if (action instanceof UpdateAttenuationMethodAction) { - state = Object.assign({}, state, { attenuationMethod: action.attenuationMethod, absorptionWater: 0, absorptionOxygen: 0 }); - } else if (action instanceof UpdateWorstMonthAction) { - state = Object.assign({}, state, { worstMonth: action.worstMonth }); - } else if (action instanceof attenuationMandatoryParametersAction) { - state = Object.assign({}, state, { attenuationMandatoryParameters: action.attenuationMandatoryParameters }); - } else if (action instanceof UpdateCalculationResultAction) { - if (action.result.rainLoss) { - state = Object.assign({}, state, { rainVal: action.result.rainLoss.rainFall.rainrate.toFixed(2), rainAtt: action.result.rainLoss.rainAttenuation, month: action.result.rainLoss.rainFall.period }); - } - if (action.result.absorptionLoss) { - state = Object.assign({}, state, { absorptionOxygen: action.result.absorptionLoss.oxygenLoss, absorptionWater: action.result.absorptionLoss.oxygenLoss }); - } - if (action.result.freeSpaceLoss) { - state = Object.assign({}, state, { fsl: action.result.freeSpaceLoss.fspl }); - } - } else if (action instanceof UpdateDevicesOnFirstLoad) { - state = Object.assign({}, state, { - rainMethod: action.linkAttributes.operationalParameters.rainModel == null ? state.rainMethod : action.linkAttributes.operationalParameters.rainModel, - attenuationMethod: action.linkAttributes.operationalParameters.absorptionMethod == null ? state.attenuationMethod : action.linkAttributes.operationalParameters.absorptionMethod, - worstMonth: action.linkAttributes.operationalParameters.calculationPeriod === 'ANNUAL' ? false : true, - }); - - } else if (action instanceof FirstMandatoryCheckAction) { - if (state.attenuationMethod !== '' && state.rainMethod !== '' ) { - state = Object.assign({}, state, { attenuationMandatoryParameters : true }); - } else state = Object.assign({}, state, { attenuationMandatoryParameters : false }); - } - return state; - -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/bandPlanHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/bandPlanHandler.ts deleted file mode 100644 index e7eff6f..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/bandPlanHandler.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { UpdateChannelListAction, UpdateChannelListLoadingAction, UpdateChannelListQueryAction, UpdateFrequencyPlans, UpdateRegionRegulatorAction, ResetChannelTableAction } from '../actions/bandPlanAction'; -import { UpdateFrequencyPlanAction } from '../actions/linkAction'; -import { UpdateBandList, UpdateRegionRegulatorListAction } from '../actions/queryActions'; -import { ResetAction, UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { Channel, ChannelTable, FrequencyPlan, RegionRegulator } from '../model/bandPlan'; -import { RadioBand } from '../model/topologyTypes'; - - - -export type bandPlanState = { - region: RegionRegulator; - channelListQuery: Channel[]; - bandList: RadioBand[]; - channelListLoading: boolean; - regionRegulatorList: RegionRegulator[]; - allChannels: ChannelTable[]; - siteAFrequencyPlan: FrequencyPlan[]; - siteBFrequencyPlan: FrequencyPlan[]; - frequencyPlanA: 'HIGH' | 'LOW'; - frequencyPlanB: 'HIGH' | 'LOW'; - frequencyPlanProcessing: boolean; - savedChannels: ChannelTable[] ; -}; - -const initialState: bandPlanState = { - region: { - name: '', keyId: '-1', country: '', regulatorName: '', - }, - channelListQuery: [], - bandList: [], - channelListLoading: true, - allChannels: [], - regionRegulatorList: [], - siteAFrequencyPlan: [], - siteBFrequencyPlan: [], - frequencyPlanA: 'HIGH', - frequencyPlanB: 'LOW', - frequencyPlanProcessing: true, - savedChannels: [], -}; - -export const bandPlanHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof UpdateBandList) { - state = Object.assign({}, state, { bandList: action.bandList }); - } else if (action instanceof UpdateRegionRegulatorListAction) { - state = Object.assign({}, state, { regionRegulatorList: action.regionRegulatorList }); - } else if (action instanceof UpdateRegionRegulatorAction) { - state = { ...state, region: action.region }; - } - if (action instanceof UpdateChannelListQueryAction) { - let table: ChannelTable[] = []; - - action.channelList.forEach(x => { - table.push({ - name: x.name, - bandwidthMHz: x.bandwidthMHz.bandwidthMHz, - centerFrequencyHigh: x.centerFrequencyHigh, - centerFrequencyLow: x.centerFrequencyLow, - availability: x.availability.name, - xPolCondition: x.xPolCondition.name, - keyId: x.keyId, - polarization: '', - }); - }); - - state = { - ...state, - channelListQuery: action.channelList!, - allChannels: table, - }; - - } else if (action instanceof UpdateChannelListLoadingAction) { - state = { ...state, channelListLoading: action.channelListLoading }; - } else if (action instanceof UpdateFrequencyPlanAction) { - state = Object.assign({}, state, { frequencyPlanA: action.frequencyPlanA, frequencyPlanB: action.frequencyPlanB, frequencyPlanProcessing: false }); - } else if (action instanceof UpdateChannelListAction) { - - state = { ...state, savedChannels: action.channels }; - } else if (action instanceof ResetAction) { - state = { ...state, savedChannels: [] }; - } else if (action instanceof UpdateDevicesOnFirstLoad) { - state.regionRegulatorList.map(x => { - if (x.keyId === action.linkAttributes.operationalParameters.bandplanKeyId) { - state = { ...state, region: x }; - } - }); - } else if (action instanceof UpdateFrequencyPlans) { - state = { ...state, siteAFrequencyPlan: action.siteAFrequencyPlan, siteBFrequencyPlan: action.siteBFrequencyPlan }; - } else if (action instanceof ResetChannelTableAction) { - state = { ...state, channelListQuery : [], allChannels : [] }; - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/errorHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/errorHandler.ts deleted file mode 100644 index 8e06060..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/errorHandler.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { UpdateAttenuationMethodErrorAction, UpdateFrequencyErrorAction, UpdateLatitudeErrorAction, UpdateLongitudeErrorAction, UpdateRainMethodErrorAction } from '../actions/errorAction'; -import { IActionHandler } from '../../../../../framework/src/flux/action'; - -export type errorState = { - latitude1Error: string | null; - latitude2Error: string | null; - longitude1Error: string | null; - longitude2Error: string | null; - frequencyError : string | null; - rainMethodError: string | null; - attenuationMethodError : string | null; -}; - -const initialState: errorState = { - latitude1Error: '', - latitude2Error: '', - longitude1Error: '', - longitude2Error: '', - frequencyError : '', - rainMethodError: '', - attenuationMethodError : '', -}; - -export const ErrorHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof UpdateLatitudeErrorAction) { - state = Object.assign({}, state, { latitude1Error: action.error1, latitude2Error: action.error2 }); - } else if (action instanceof UpdateLongitudeErrorAction) { - state = Object.assign({}, state, { longitude1Error: action.error1, longitude2Error: action.error2 }); - } else if (action instanceof UpdateFrequencyErrorAction) { - state = Object.assign({}, state, { frequencyError: action.error }); - } else if (action instanceof UpdateRainMethodErrorAction) { - state = Object.assign({}, state, { rainMethodError: action.error }); - } else if (action instanceof UpdateAttenuationMethodErrorAction) { - state = Object.assign({}, state, { attenuationMethodError: action.error }); - } - - return state; -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/linkHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/linkHandler.ts deleted file mode 100644 index 2cbfed8..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/linkHandler.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { UpdateDistanceAction, UpdatePolAction } from '../actions/linkAction'; -import { UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { ResetFormAction } from '../actions/viewAction'; - - -export type linkState = { - - polarization: 'HORIZONTAL' | 'VERTICAL' | null; - distance: number; - linkId: number; -}; - -const initialState: linkState = { - - distance: 0, - polarization: null, - linkId:0, -}; - -export const LinkHandler: IActionHandler = (state = initialState, action) => { - - - if (action instanceof UpdateDistanceAction) { - state = Object.assign({}, state, { distance: action.distance }); - } else if (action instanceof UpdatePolAction) { - state = Object.assign({}, state, { polarization: action.polarization }); - } else if (action instanceof ResetFormAction) { - state = Object.assign({}, initialState, {}); - } else if (action instanceof UpdateDevicesOnFirstLoad) { - state = Object.assign({}, state, { - distance: action.linkAttributes.lengthKm, - polarization : action.linkAttributes.operationalParameters.rainPolarity, - linkId: action.linkAttributes.id, - }); - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/linkTableHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/linkTableHandler.ts deleted file mode 100644 index b501f52..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/linkTableHandler.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal, IExternalTableState } from '../../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../../framework/src/utilities/elasticSearch'; - -import { LinkDetails } from '../model/linkTable'; -export interface ILinkTableState extends IExternalTableState { } - -// create elastic search material data fetch handler -const linkTableSearchHandler = createSearchDataHandler('microwave-link', true, { 'type': 'microwave' }); - -export const { - actionHandler: linkTableActionHandler, - createActions: createLinkTableActions, - createProperties: createLinkTableProperties, - createPreActions: createLinkTablePreActions, - reloadAction: linkTableReloadAction, - - // set value action, to change a value -} = createExternal(linkTableSearchHandler, appState => appState.microwave.linkTable); - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/queryHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/queryHandler.ts deleted file mode 100644 index dd0f502..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/queryHandler.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; - -import { UpdateModelTypesAction } from '../actions/queryActions'; -import { UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { linkBeingSavedAction, linkSavedSuccessfulAction } from '../actions/saveLinkAction'; - -import { Link } from '../model/link'; -import { ModelType } from '../model/topologyTypes'; - -export type queryState = { - - modelTypeList: string[]; - linkAttributes: Link; - linkSave: any; - modelTypes:ModelType[]; - savingComplete: boolean; - linkSaving: boolean; -}; - -const initialState: queryState = { - - modelTypeList: [], - linkAttributes: { - id: 0, name: '', type: '', operator: '', - lengthKm: 0, - siteA: { - lat: 0, lon: 0, id: 0, name: '', amslM: 0, azimuthDeg: 0, tiltDeg: 0, - radioAntenna: { modelId: 0, id: 0, modelName: '', operationalParameters: { agl: 0 }, gainDb: 0, tiltDeg: 0 }, - radio: { id: 0, modelId: 0, modelName: '', operationalParameters: { transmissionPower: null, modulationType: '', enabledAdmModulations: [] } }, - waveguide: { modelId: 0, id: 0, modelName: '', type: '', lengthM: 0, lossDbPerM: 0, operationalParameters: { waveguideLength: 0 } }, - - }, - siteB: { - lat: 0, lon: 0, id: 0, name: '', amslM: 0, azimuthDeg: 0, tiltDeg: 0, - radioAntenna: { id: 0, modelId: 0, modelName: '', operationalParameters: { agl: 0 }, gainDb: 0, tiltDeg: 0 }, - radio: { id: 0, modelId: 0, modelName: '', operationalParameters: { transmissionPower: null, modulationType: '', enabledAdmModulations: [] } }, - waveguide: { modelId: 0, id: 0, modelName: '', type: '', lengthM: 0, lossDbPerM: 0, operationalParameters: { waveguideLength: 0 } }, - - }, - operationalParameters: { bandKeyId: '0', rainPolarity: '', rainModel: '', absorptionMethod: '', calculationPeriod: '', rainRate: 0, inheritedFrequencyPlanA:'', inheritedFrequencyPlanB:'', bandplanKeyId:'0', selectedChannelList:[] }, - - }, - linkSave: [], - - modelTypes: [{ - name: '', id: -1, description: '', - }], - savingComplete: false, - linkSaving: false, -}; - -export const QueryHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof UpdateDevicesOnFirstLoad) { - state = Object.assign({}, state, { linkAttributes: action.linkAttributes }); - } else if (action instanceof linkSavedSuccessfulAction) { - state = Object.assign({}, state, { linkSave: action.saved, savingComplete: true, linkSaving: false }); - } else if (action instanceof UpdateModelTypesAction) { - state = Object.assign({}, state, { modelTypes: action.ModelTypes }); - } else if (action instanceof linkBeingSavedAction) { - state = Object.assign({}, state, { linkSaving: action.saving, savingComplete: false }); - } - - return state; -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/radioHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/radioHandler.ts deleted file mode 100644 index 1251b1e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/radioHandler.ts +++ /dev/null @@ -1,327 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { AdaptiveModulationTable } from '../model/adaptiveModulationTable'; -import { UpdateCalculationResultAction } from '../actions/commonActions'; -import { FirstMandatoryCheckAction } from '../actions/errorAction'; -import { - frequencyMandatoryParametersAction, radioBandwidthAction, radioMandatoryParametersAction, ResetAction, - UpdateDeviceListsOnBandChangeAction, UpdateDevicesOnFirstLoad, UpdateEnabeldAdaptiveModulations, - UpdateFrequencyAction, UpdateModulationAction, UpdateModulationListAction, UpdateRadioAction, UpdateRadioEverything, UpdateRadioIdAction, - UpdateRadioListAction, UpdateRadioParametersAction, UpdateModulationParametersAction, UpdateRxPowerAction, UpdateRxSensitivityAction, UpdateSomAction, - UpdateTxPowerAction, - UpdateTotalBandwidthAction, -} from '../actions/radioActions'; -import { Modulation } from '../model/modulation'; -import { Radio } from '../model/radio'; -import { ResetFormAction } from '../actions/viewAction'; -import { UpdateAdaptiveModulationProcessing, UpdateAdaptiveModulationTableAction } from '../actions/adaptiveModulationAction'; - -export type radioState = { - systemOperatingMarginA: number; - systemOperatingMarginB: number; - txPowerA: number; - txPowerB: number; - thresholdBER3A: number | null; - thresholdBER6A: number | null; - thresholdBER3B: number | null; - thresholdBER6B: number | null; - rxPowerA: number; - rxPowerB: number; - band: { - frequency: number; - keyId:string; - }; - radioNameA: string; - radioNameB: string; - radioMandatoryParameters: boolean; - frequencyMandatoryParameters: boolean; - radioParameters: Radio[]; - radioBandwidthA: number; - radioBandwidthB: number; - modulationListA: string[]; - modulationListB: string[]; - radioNameList: string[]; - modulationA: string; - modulationB: string; - radioIdSiteA: number; - radioIdSiteB: number; - modulationParametersA: Modulation | null; - modulationParametersB: Modulation | null; - adaptiveModulationTableAtoB: AdaptiveModulationTable[] | null | undefined; - adaptiveModulationTableBtoA: AdaptiveModulationTable[] | null | undefined; - enabledAdaptiveModulations: string[]; - processing: boolean; - admStatus: number; - admMessage: string; - totalBandwidthMHz: number; -}; - -const initialState: radioState = { - systemOperatingMarginA: 0, - systemOperatingMarginB: 0, - txPowerA: 0, - txPowerB: 0, - thresholdBER3A: 0, - thresholdBER6A: 0, - thresholdBER3B: 0, - thresholdBER6B: 0, - radioNameList: [], - rxPowerA: 0, - rxPowerB: 0, - band: { - frequency: 0, - keyId:'0', - }, - radioNameA: '', - radioNameB: '', - radioMandatoryParameters: true, - frequencyMandatoryParameters: true, - radioParameters: [], - radioBandwidthA: 0, - radioBandwidthB: 0, - modulationListA: [], - modulationListB: [], - modulationA: '', - modulationB: '', - radioIdSiteA: 0, - radioIdSiteB: 0, - modulationParametersA: { - capE1: '', - dfm56QAM: '', - fktb: '', - minDelay: '', - minSigBw: '', - minSigHt: '', - modDsOffset: '', - netFilterDf: '', - nonMinDelay: '', - nonMinSigBw: '', - nonMinSigHt: '', - rslDist: '', - rslMin: '', - rxMin: '', - rxThr3BER: 0, - rxThr6BER: 0, - throughput: '', - txMax: '', - txMin: '', - xpif: '', - }, - modulationParametersB: { - capE1: '', - dfm56QAM: '', - fktb: '', - minDelay: '', - minSigBw: '', - minSigHt: '', - modDsOffset: '', - netFilterDf: '', - nonMinDelay: '', - nonMinSigBw: '', - nonMinSigHt: '', - rslDist: '', - rslMin: '', - rxMin: '', - rxThr3BER: 0, - rxThr6BER: 0, - throughput: '', - txMax: '', - txMin: '', - xpif: '', - }, - adaptiveModulationTableAtoB: [], - adaptiveModulationTableBtoA: [], - enabledAdaptiveModulations: [], - processing: true, - admStatus: 0, - admMessage: '', - totalBandwidthMHz: 0, -}; - - -export const RadioHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof UpdateFrequencyAction) { - state = Object.assign({}, state, { band:{ frequency: action.frequency, keyId: '$' + action.frequency.toString() } }); - - } else if (action instanceof UpdateTxPowerAction) { - state = Object.assign({}, state, { txPowerA: action.txPowerA || state.txPowerA, txPowerB: action.txPowerB || state.txPowerB }); - } else if (action instanceof UpdateRxSensitivityAction) { - state = Object.assign({}, state, { - thresholdBER3A: action.thresholdBER3A == null ? state.thresholdBER3A : action.thresholdBER3A, - thresholdBER6A: action.thresholdBER6A == null ? state.thresholdBER6A : action.thresholdBER6A, - thresholdBER3B: action.thresholdBER3B == null ? state.thresholdBER3B : action.thresholdBER3B, - thresholdBER6B: action.thresholdBER6B == null ? state.thresholdBER6B : action.thresholdBER6B, - }); - } else if (action instanceof UpdateRxPowerAction) { - state = Object.assign({}, state, { rxPowerA: action.rxPowerA, rxPowerB: action.rxPowerB }); - } else if (action instanceof UpdateSomAction) { - state = Object.assign({}, state, { systemOperatingMarginA: action.somA, systemOperatingMarginB: action.somB }); - } else if (action instanceof ResetFormAction) { - state = Object.assign({}, initialState, { radioMandatoryParameters: false, frequencyMandatoryParameters: false }); - } else if (action instanceof UpdateRadioListAction) { - state = Object.assign({}, state, { radioNameList: action.radioNameList }); - } else if (action instanceof UpdateRadioAction) { - state = Object.assign({}, state, { radioNameA: action.radioNameA == null ? state.radioNameA : action.radioNameA, radioNameB: action.radioNameB == null ? state.radioNameB : action.radioNameB }); - } else if (action instanceof radioMandatoryParametersAction) { - state = Object.assign({}, state, { radioMandatoryParameters: action.radioMandatoryParameters }); - } else if (action instanceof frequencyMandatoryParametersAction) { - state = Object.assign({}, state, { frequencyMandatoryParameters: action.frequencyMandatoryParameters }); - } else if (action instanceof UpdateRadioParametersAction) { - state = Object.assign({}, state, { radioParameters: action.radioParameters }); - } else if (action instanceof radioBandwidthAction) { - state = Object.assign({}, state, { radioBandwidthA: action.radioBandwidthA == null ? state.radioBandwidthA : action.radioBandwidthA, radioBandwidthB: action.radioBandwidthB == null ? state.radioBandwidthB : action.radioBandwidthB }); - } else if (action instanceof UpdateModulationListAction) { - state = Object.assign({}, state, { modulationListA: action.modulationListA == null ? state.modulationListA : action.modulationListA, modulationListB: action.modulationListB == null ? state.modulationListB : action.modulationListB }); - } else if (action instanceof UpdateModulationAction) { - state = Object.assign({}, state, { - modulationA: action.modulationA == null ? state.modulationA : action.modulationA, - modulationB: action.modulationB == null ? state.modulationB : action.modulationB, - enabledAdaptiveModulations: [action.modulationA], - }); - } else if (action instanceof UpdateModulationParametersAction) { - state = Object.assign({}, state, { - modulationParametersA: action.modulationParametersA == null ? state.modulationParametersA : action.modulationParametersA, - modulationParametersB: action.modulationParametersB == null ? state.modulationParametersB : action.modulationParametersB, - txPowerA: action.modulationParametersA?.txMax || state.txPowerA, txPowerB: action.modulationParametersB?.txMax || state.txPowerB, - thresholdBER3A: action.modulationParametersA?.rxThr3BER || state.thresholdBER3A, thresholdBER6A: action.modulationParametersA?.rxThr6BER || state.thresholdBER6A, - thresholdBER3B: action.modulationParametersB?.rxThr3BER || state.thresholdBER3B, thresholdBER6B: action.modulationParametersB?.rxThr6BER || state.thresholdBER6B, - }); - } else if (action instanceof UpdateRadioIdAction) { - state = Object.assign({}, state, { radioIdSiteA: action.radioIdSiteA == null ? state.radioIdSiteA : action.radioIdSiteA, radioIdSiteB: action.radioIdSiteB == null ? state.radioIdSiteB : action.radioIdSiteB }); - } else if (action instanceof UpdateAdaptiveModulationTableAction) { - state = Object.assign({}, state, { adaptiveModulationTableAtoB: action.adaptiveModulationTableAtoB, adaptiveModulationTableBtoA: action.adaptiveModulationTableBtoA, admMessage: action.message, admStatus: action.status, processing: false }); - } else if (action instanceof ResetAction) { - state = { - ...state, radioIdSiteA: 0, radioIdSiteB: 0, radioNameA: '', radioNameB: '', radioBandwidthA: 0, - radioBandwidthB: 0, modulationA: '', modulationB: '', rxPowerA: 0, rxPowerB: 0, txPowerA: 0, txPowerB: 0, thresholdBER3A: 0, - thresholdBER3B: 0, thresholdBER6A: 0, thresholdBER6B: 0, modulationListA: [], modulationListB: [], totalBandwidthMHz : 0, - }; - } else if (action instanceof UpdateDevicesOnFirstLoad) { - state = { - ...state, band:{ frequency: Number(action.linkAttributes.operationalParameters.bandKeyId.replace('$', '')), keyId: action.linkAttributes.operationalParameters.bandKeyId }, - radioNameList: action.radioList.map(e => e.modelName), - radioParameters: action.radioList, - enabledAdaptiveModulations: action.linkAttributes.siteA.radio?.operationalParameters.enabledAdmModulations!, - }; - action.radioList.map(radio => { - if (radio.modelName === action.linkAttributes.siteA.radio?.modelName) { - state = { - ...state, radioNameA: radio.modelName, - modulationListA: Object.keys(radio.operationalParameters?.modulations!), - radioIdSiteA: radio.id, - radioBandwidthA: Number(radio.operationalParameters?.bandwith), - }; - if (action.linkAttributes.siteA.radio?.operationalParameters.modulationType) { - Object.entries(radio.operationalParameters?.modulations!).map(modulationParameters => { - if (modulationParameters[0] === action.linkAttributes.siteA.radio?.operationalParameters.modulationType) { - const modulationParametersA: any = modulationParameters[1]; - state = { - ...state, - thresholdBER3A: modulationParametersA.rxThr3BER, - thresholdBER6A: modulationParametersA.rxThr6BER, - }; - } - }); - } - } - if (radio.modelName === action.linkAttributes.siteB.radio?.modelName) { - state = { - ...state, radioNameB: radio.modelName, - modulationListB: Object.keys(radio.operationalParameters?.modulations!), - radioIdSiteB: radio.id, - radioBandwidthB: Number(radio.operationalParameters?.bandwith), - }; - if (action.linkAttributes.siteB.radio?.operationalParameters.modulationType) { - Object.entries(radio.operationalParameters?.modulations!).map(modulationParameters => { - if (modulationParameters[0] === action.linkAttributes.siteB.radio?.operationalParameters.modulationType) { - const modulationParametersB: any = modulationParameters[1]; - state = { - ...state, - thresholdBER3B: modulationParametersB.rxThr3BER, - thresholdBER6B: modulationParametersB.rxThr6BER, - }; - } - }); - } - } - }); - if (action.linkAttributes.siteA.radio?.operationalParameters?.modulationType) { - state = { - ...state, - modulationA: action.linkAttributes.siteA.radio?.operationalParameters?.modulationType, - txPowerA: action.linkAttributes.siteA.radio.operationalParameters.transmissionPower!, - }; - } - if (action.linkAttributes.siteB.radio?.operationalParameters?.modulationType) { - state = { - ...state, - modulationB: action.linkAttributes.siteB.radio?.operationalParameters?.modulationType, - txPowerB: action.linkAttributes.siteB.radio.operationalParameters.transmissionPower!, - }; - } - } else if (action instanceof UpdateCalculationResultAction) { - if (action.result.linkBudget) { - state = Object.assign({}, state, { - systemOperatingMarginA: action.result.linkBudget.systemOperatingMarginA, systemOperatingMarginB: action.result.linkBudget.systemOperatingMarginB, - rxPowerA: action.result.linkBudget.receivedPowerA, rxPowerB: action.result.linkBudget.receivedPowerB, - }); - } - } else if (action instanceof FirstMandatoryCheckAction) { - if (state.band.frequency !== 0) { - state = { ...state, frequencyMandatoryParameters: true }; - } else state = Object.assign({}, state, { frequencyMandatoryParameters: false }); - if (state.radioNameA !== '' && state.radioNameB !== '' && state.modulationA !== '' && state.modulationB !== '' && state.txPowerA !== null && state.txPowerB !== null) { - state = { ...state, radioMandatoryParameters: true }; - } else state = Object.assign({}, state, { radioMandatoryParameters: false }); - } else if (action instanceof UpdateRadioEverything) { - if (action.transport.operationalParametersA) { - state = { - ...state, radioBandwidthA: Number(action.transport.operationalParametersA?.bandwith), - modulationListA: action.transport.modulationListA!, - radioIdSiteA: action.transport.radioIdSiteA!, - modulationA: initialState.modulationA, - txPowerA: initialState.txPowerA, - thresholdBER3A: initialState.thresholdBER3A, - thresholdBER6A: initialState.thresholdBER6A, - }; - } - if (action.transport.operationalParametersB) { - state = { - ...state, radioBandwidthB: Number(action.transport.operationalParametersB?.bandwith), - modulationListB: action.transport.modulationListB!, - radioIdSiteB: action.transport.radioIdSiteB!, - modulationB: initialState.modulationB, - txPowerB: initialState.txPowerB, - thresholdBER3B: initialState.thresholdBER3B, - thresholdBER6B: initialState.thresholdBER6B, - }; - } - } else if (action instanceof UpdateDeviceListsOnBandChangeAction) { - state = { ...state, radioNameList: action.radioList.map(e => e.modelName), radioParameters: action.radioList, txPowerA: 0, txPowerB: 0 }; - } else if (action instanceof UpdateEnabeldAdaptiveModulations) { - state = { ...state, enabledAdaptiveModulations: action.enabledAdaptiveModulations }; - } else if (action instanceof UpdateAdaptiveModulationProcessing) { - state = { ...state, processing: action.processing }; - } else if (action instanceof UpdateTotalBandwidthAction) { - state = { ...state, totalBandwidthMHz: action.totalBandwidthMHz }; - } - - return state; -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/rootHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/rootHandler.ts deleted file mode 100644 index 10bddc3..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/rootHandler.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -import { combineActionHandler } from '../../../../../framework/src/flux/middleware'; - -import { AntennaHandler, antennaState } from './antennaHandler'; -import { AtmosphericLossHandler, atmosphericLossState } from './atmosphericLossHandler'; -import { errorState } from './errorHandler'; -import { LinkHandler, linkState } from './linkHandler'; -import { QueryHandler, queryState } from './queryHandler'; -import { RadioHandler, radioState } from './radioHandler'; -import { SiteHandler, siteState } from './siteHandler'; -import { ViewHandler, viewState } from './viewHandler'; -import { WaveguideHandler, waveguideState } from './waveguideHandler'; -import { ErrorHandler } from './errorHandler'; -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { UpdateTabAction } from '../actions/commonActions'; -import { TabId } from '../model/tabId'; -import { ILinkTableState, linkTableActionHandler } from './linkTableHandler'; -import { IMap, mapHandler } from '../../lineOfSight/handlers/lineOfSightMapHandler'; -import { bandPlanHandler, bandPlanState } from './bandPlanHandler'; - -interface IMicrowaveAppStateStore { - antenna: antennaState; - atmosphere: atmosphericLossState; - link: linkState; - radio: radioState; - site: siteState; - view: viewState; - waveguide: waveguideState; - query: queryState; - error: errorState; - currentTab: TabId; - linkTable: ILinkTableState; - bandPlan: bandPlanState; - map: IMap; -} - - -declare module '../../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - microwave: IMicrowaveAppStateStore; - } -} - -export const TabHandler: IActionHandler = (state = 'linkTable', action) => { - if (action instanceof UpdateTabAction) { - state = action.openTab; - } - return state; -}; -const appHandler = { - antenna: AntennaHandler, - atmosphere: AtmosphericLossHandler, - link: LinkHandler, - radio: RadioHandler, - site: SiteHandler, - view: ViewHandler, - waveguide: WaveguideHandler, - query: QueryHandler, - error: ErrorHandler, - currentTab: TabHandler, - linkTable: linkTableActionHandler, - map: mapHandler, - bandPlan: bandPlanHandler, -}; - -export const RootHandler = combineActionHandler(appHandler); -export default RootHandler; - - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/siteHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/siteHandler.ts deleted file mode 100644 index 00a2225..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/siteHandler.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { FirstMandatoryCheckAction } from '../actions/errorAction'; -import { UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { locationMandatoryAction, UpdateLatLonAction } from '../actions/siteAction'; -import { ResetFormAction } from '../actions/viewAction'; - - -export type siteState = { - lat1: number; - lon1: number; - lat2: number; - lon2: number; - siteIdA:number; - siteIdB:number; - locationMandatoryParameters: boolean; - siteNameA: string; - siteNameB: string; - amslA: number; - amslB: number; - azimuthA: number; - azimuthB: number; - tiltDegA: number; - tiltDegB: number; -}; - -const initialState: siteState = { - lat1: 0, - lon1: 0, - lat2: 0, - lon2: 0, - siteIdA:0, - siteIdB:0, - locationMandatoryParameters: true, - siteNameA: '', - siteNameB: '', - amslA: 0, - amslB: 0, - azimuthA: 0, - azimuthB: 0, - tiltDegA: 0, - tiltDegB: 0, -}; - -export const SiteHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof UpdateLatLonAction) { - state = Object.assign({}, state, { lat1: action.lat1, lon1: action.lon1, lat2: action.lat2, lon2: action.lon2 }); - } - if (action instanceof ResetFormAction) { - state = Object.assign({}, initialState, { locationMandatoryParameters:false }); - } else if (action instanceof locationMandatoryAction) { - state = Object.assign({}, state, { locationMandatoryParameters: action.locationMandatoryParameters }); - } else if (action instanceof UpdateDevicesOnFirstLoad) { - state = Object.assign({}, state, { - lat1: action.linkAttributes.siteA.lat, lon1: action.linkAttributes.siteA.lon, - lat2: action.linkAttributes.siteB.lat, lon2: action.linkAttributes.siteB.lon, - siteIdA: action.linkAttributes.siteA.id, siteIdB:action.linkAttributes.siteB.id, - siteNameA:action.linkAttributes.siteA.name, siteNameB:action.linkAttributes.siteB.name, - amslA : action.linkAttributes.siteA.amslM, amslB: action.linkAttributes.siteB.amslM, - azimuthA : action.linkAttributes.siteA.azimuthDeg, azimuthB: action.linkAttributes.siteB.azimuthDeg, - tiltDegA: action.linkAttributes.siteA.tiltDeg, tiltDegB: action.linkAttributes.siteB.tiltDeg, - }); - } else if (action instanceof FirstMandatoryCheckAction) { - if (state.lat1 !== 0 && state.lon1 !== 0 && state.lat2 !== 0 && state.lon2 !== 0) { - state = Object.assign({}, state, { locationMandatoryParameters : true }); - } else state = Object.assign({}, state, { locationMandatoryParameters : false }); - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/viewHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/viewHandler.ts deleted file mode 100644 index 3473923..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/viewHandler.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { isCalculationServerReachableAction, PluginDoneLoadingAction, ResetFormAction, UpdateRainMethodDisplayAction } from '../actions/viewAction'; - - -export type viewState = { - formView: boolean; - reachable: boolean; - rainDisplay: boolean; - loadingComplete : boolean; - processing: boolean; -}; - -const initialState: viewState = { - formView: true, - reachable: true, - rainDisplay: false, - loadingComplete : false, - processing : true, -}; - -export const ViewHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof UpdateDevicesOnFirstLoad) { - if (action.linkAttributes) { - state = Object.assign({}, state, { formView: true }); - } - } else if (action instanceof isCalculationServerReachableAction) { - state = Object.assign({}, state, { reachable: action.reachable }); - } else if (action instanceof ResetFormAction) { - state = Object.assign({}, state, { formView: false, processing : false }); - } else if (action instanceof UpdateRainMethodDisplayAction) { - state = Object.assign({}, state, { rainDisplay: action.rainDisplay }); - } else if (action instanceof PluginDoneLoadingAction) { - state = Object.assign({}, state, { loadingComplete: action.loadingComplete, processing: false }); - } - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/waveguideHandler.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/waveguideHandler.ts deleted file mode 100644 index dc473c7..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/handlers/waveguideHandler.ts +++ /dev/null @@ -1,154 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../../framework/src/flux/action'; -import { UpdateCalculationResultAction } from '../actions/commonActions'; -import { FirstMandatoryCheckAction } from '../actions/errorAction'; -import { ResetAction, UpdateDeviceListsOnBandChangeAction, UpdateDevicesOnFirstLoad } from '../actions/radioActions'; -import { ResetFormAction } from '../actions/viewAction'; -import { UpdateNewWaveguideParametersAction, UpdateWaveguideIdAction, UpdatewaveguideListAction, - UpdateWaveguideLossAction, updateWaveguideNameAction, UpdateWaveguideParametersAction, updateWaveguideTypeAction, waveguideMandatoryAction } from '../actions/waveguideActions'; -import { Waveguide } from '../model/waveguide'; - - -export type waveguideState = { - waveguideLossA: number; - waveguideLossB: number; - waveguideNameA: string | null; - waveguideNameB: string | null; - waveguideMandatoryParameters: boolean; - waveguideLengthDisplayA: number; - waveguideLengthDisplayB: number; - waveguideTypeA: string; - waveguideTypeB: string; - waveguideIdSiteA: number; - waveguideIdSiteB: number; - waveguideParameters: Waveguide[]; - waveguideLengthACalculate: number ; - waveguideLengthBCalculate: number ; - waveguideNameList: string[]; -}; - -const initialState: waveguideState = { - waveguideLossA: 0, - waveguideLossB: 0, - waveguideNameA: '', - waveguideNameB: '', - waveguideMandatoryParameters: true, - waveguideLengthDisplayA: 0, - waveguideLengthDisplayB: 0, - waveguideTypeA: '', - waveguideTypeB: '', - waveguideIdSiteA: 0, - waveguideIdSiteB: 0, - waveguideParameters: [], - waveguideLengthACalculate: 0, - waveguideLengthBCalculate: 0, - waveguideNameList: [], - -}; - -export const WaveguideHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof UpdateWaveguideLossAction) { - state = Object.assign({}, state, { waveguideLossA: action.waveguideLossA, waveguideLossB: action.waveguideLossB }); - } else if (action instanceof UpdatewaveguideListAction) { - state = Object.assign({}, state, { waveguideList: action.waveguideListName }); - } else if (action instanceof updateWaveguideNameAction) { - state = Object.assign({}, state, { waveguideNameA: action.waveguideNameA == null ? state.waveguideNameA : action.waveguideNameA, waveguideNameB: action.waveguideNameB == null ? state.waveguideNameB : action.waveguideNameB }); - } else if (action instanceof waveguideMandatoryAction) { - state = Object.assign({}, state, { waveguideMandatoryParameters: action.waveguideMandatoryParameters }); - } else if (action instanceof UpdateWaveguideIdAction) { - state = Object.assign({}, state, { waveguideIdSiteA: action.waveguideIdSiteA == null ? state.waveguideIdSiteA : action.waveguideIdSiteA, waveguideIdSiteB: action.waveguideIdSiteB == null ? state.waveguideIdSiteB : action.waveguideIdSiteB }); - } else if (action instanceof updateWaveguideTypeAction) { - state = Object.assign({}, state, { waveguideTypeA: action.waveguideTypeA == null ? state.waveguideTypeA : action.waveguideTypeA, waveguideTypeB: action.waveguideTypeB == null ? state.waveguideTypeB : action.waveguideTypeB }); - } else if (action instanceof UpdateWaveguideParametersAction) { - state = Object.assign({}, state, { waveguideParameters: action.waveguide }); - } else if (action instanceof ResetAction) { - state = Object.assign({}, state, { waveguideIdSiteA: 0, waveguideIdSiteB: 0, waveguideNameA: '', waveguideNameB: '', waveguideLengthDisplayA: 0, waveguideLengthDisplayB: 0, waveguideLossA: 0, waveguideLossB: 0, waveguideTypeA: '', waveguideTypeB: '' }); - } else if (action instanceof UpdateDevicesOnFirstLoad) { - - state = { ...state, waveguideNameList: action.waveguideList.map(x => x.modelName), waveguideParameters: action.waveguideList }; - if (action.linkAttributes.siteA.waveguide?.operationalParameters) { - state = { ...state, waveguideLengthACalculate : action.linkAttributes.siteA.waveguide?.operationalParameters.waveguideLength }; - - } - if (action.linkAttributes.siteB.waveguide?.operationalParameters) { - state = { ...state, waveguideLengthBCalculate : action.linkAttributes.siteB.waveguide?.operationalParameters.waveguideLength }; - } - action.waveguideList.forEach(element => { - - if (element.modelName === action.linkAttributes.siteA.waveguide?.modelName) { - state = { - ...state, waveguideTypeA: element.operationalParameters?.type!, - waveguideNameA: element.modelName, - waveguideIdSiteA: element.id, - waveguideLengthDisplayA: element.operationalParameters?.length!, - - }; - if (element.operationalParameters?.type! === 'rigid') { - state = { ...state, waveguideLengthDisplayA : action.linkAttributes.siteA.waveguide.operationalParameters?.waveguideLength === null ? element.operationalParameters?.length! : action.linkAttributes.siteA.waveguide.operationalParameters?.waveguideLength!, - }; - } else { - state = { ...state, waveguideLengthACalculate: -1, - }; - } - } - if (element.modelName === action.linkAttributes.siteB.waveguide?.modelName) { - state = { - ...state, - waveguideTypeB: element.operationalParameters?.type!, - waveguideLengthDisplayB: element.operationalParameters?.length!, - waveguideNameB: element.modelName, - waveguideIdSiteB: element.id, - }; - if (element.operationalParameters?.type! === 'rigid') { - state = { ...state, waveguideLengthDisplayB : action.linkAttributes.siteB.waveguide.operationalParameters?.waveguideLength === null ? element.operationalParameters?.length! : action.linkAttributes.siteB.waveguide.operationalParameters?.waveguideLength!, - }; - } else { - state = { ...state, waveguideLengthBCalculate:-1, - }; - } - } - }); - } else if (action instanceof UpdateDeviceListsOnBandChangeAction) { - state = { ...state, waveguideNameList: action.waveguideList.map(e => e.modelName), waveguideParameters: action.waveguideList }; - } else if (action instanceof UpdateNewWaveguideParametersAction) { - if (action.waveguideParametersA && action.waveguideParametersA.operationalParameters) { - - state = { ...state, waveguideNameA: action.waveguideParametersA?.modelName, waveguideIdSiteA: action.waveguideParametersA?.id, - waveguideLengthDisplayA: action.waveguideParametersA?.operationalParameters.length, waveguideTypeA: action.waveguideParametersA.operationalParameters.type, - waveguideLengthACalculate: action.waveguideParametersA.operationalParameters.type === 'rigid' ? action.waveguideParametersA.calculationParameters?.waveguideLength! : -1 }; - } - if (action.waveguideParametersB && action.waveguideParametersB.operationalParameters) { - state = { ...state, waveguideNameB: action.waveguideParametersB?.modelName, waveguideIdSiteB: action.waveguideParametersB?.id, - waveguideLengthDisplayB: action.waveguideParametersB?.operationalParameters.length, waveguideTypeB: action.waveguideParametersB.operationalParameters.type, - waveguideLengthBCalculate: action.waveguideParametersB.operationalParameters.type === 'rigid' ? action.waveguideParametersB.calculationParameters?.waveguideLength! : -1 }; - } - } else if (action instanceof UpdateCalculationResultAction) { - if (action.result.waveguideLoss) { - state = Object.assign({}, state, { waveguideLossA: action.result.waveguideLoss.waveguideLossA, waveguideLossB: action.result.waveguideLoss.waveguideLossB }); - } - } else if (action instanceof FirstMandatoryCheckAction) { - if (state.waveguideNameA !== '' && state.waveguideNameB !== '' && state.waveguideLengthDisplayA !== 0 && state.waveguideLengthDisplayB !== 0) { - state = Object.assign({}, state, { waveguideMandatoryParameters: true }); - } else state = Object.assign({}, state, { waveguideMandatoryParameters: false }); - } else if (action instanceof ResetFormAction) { - state = { ...initialState, waveguideMandatoryParameters:false }; - } - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/adaptiveModulationInput.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/adaptiveModulationInput.ts deleted file mode 100644 index 19bdd14..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/adaptiveModulationInput.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type AdaptiveModulationInput = { - linkId: number; - linkOperationalParameters: { - bandKeyId: string; - bandplanKeyId: string; - polarization: string; - absorptionMethod: string; - calculationPeriod: string; - rainRate: number; - rainModel: string; - }; - siteA: { - radioModelId: number; - waveguideModelId: number; - radioAntennaModelId: number; - modulationType: string; - transmissionPower: number; - waveguideLength: number | null; - agl: number; - }; - siteB: { - radioModelId: number; - waveguideModelId: number; - radioAntennaModelId: number; - modulationType: string; - transmissionPower: number; - waveguideLength: number | null; - agl: number; - }; -}; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/adaptiveModulationTable.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/adaptiveModulationTable.ts deleted file mode 100644 index 0ebf5c9..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/adaptiveModulationTable.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type AdaptiveModulationResponse = { - aToB: AdaptiveModulationTable[]; - bToA: AdaptiveModulationTable[]; -}; -export type AdaptiveModulationTable = { - modulation: string; - dataRate: number; - 'receiverThresholdBER-3': number; - 'receiverThresholdBER-6': number; - receivedSignalLevel: number; - 'linkMarginBER-3': number; - 'linkMarginBER-6': number; - 'txPowerMin':number; - 'txPowerMax':number; - 'rainAvailabilityBER-3': number; - 'rainAvailabilityBER-6' : number; - 'multipathAvailabilityBER-3': number; - 'multipathAvailabilityBER-6' : number; -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/antenna.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/antenna.ts deleted file mode 100644 index b364842..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/antenna.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Antenna = { - modelId: number; - id:number; - modelName: string; - type: { - id: number; - name: string; - description: string; - } | null; - operationalParameters: AntennaOperationalParameters | null; - calculationParameters : AntennaCalculationPrameters | null; -}; -export type AntennaOperationalParameters = { - style: string; - xpol: string; - band: number; - diameter: string; - agl: number; - amsl:number; - gain: number; - xpd: string; - ipi: string; - fbRation: string; -}; -export type AntennaCalculationPrameters = { - -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/bandPlan.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/bandPlan.ts deleted file mode 100644 index 308f325..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/bandPlan.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type RegionRegulator = { - country: string; - keyId: string; - name: string; - regulatorName: string; -}; - -// export type ChannelQuery = { -// data: Channel[]; -// message?: string; -// status: number; -// }; -export type Channel = { - keyId: string; - number: number; - name: string; - channelSpacing: ChannelSpacing; - bandwidthMHz: BandwidthMhz; - centerFrequencyHigh: number; - centerFrequencyLow: number; - xPolCondition: XpolCondition; - availability: Availability; - description: string; - polarization: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | ''; -}; - -export type ChannelTable = { - keyId: string; - name: string; - bandwidthMHz: number; - centerFrequencyHigh: number; - centerFrequencyLow: number; - availability: string; - xPolCondition: string; - polarization: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | ''; -}; -export type ChannelSpacing = { - id: number; - name: string; -}; -export type BandwidthMhz = { - id: number; - name: string; - bandwidthMHz: number; -}; -export type XpolCondition = { - id: number; - name: string; -}; -export type Availability = { - id: number; - name: string; -}; - -export type FrequencyPlan = { - configuration: string; - id: number; - siteId: number; - band: { - keyId: string; - name: string; - duplexspacingMHz: number; - }; - status: string; - comment: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/calculationResult.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/calculationResult.ts deleted file mode 100644 index 740ee5e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/calculationResult.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Absorption, FreeSpaceLoss, LinkBudget, RainLoss } from './topologyTypes'; -import { WaveguideLoss } from './waveguide'; - -export class CalculationResult { - rainLoss: RainLoss | undefined; - - freeSpaceLoss: FreeSpaceLoss | undefined; - - absorptionLoss: Absorption | undefined; - - waveguideLoss: WaveguideLoss | undefined; - - linkBudget: LinkBudget | undefined; - -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/link.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/link.ts deleted file mode 100644 index e81fe64..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/link.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - - -type Site = { - lon: number; - lat: number; - id: number; - tiltDeg: number; - name: string; - amslM: number | null; - radioAntenna: Antenna | null; - azimuthDeg: number; - radio: Radio | null; - waveguide: Waveguide | null; - -}; -type LinkOperationalParameters = { - rainPolarity: string; - rainModel: string; - rainRate: number; - absorptionMethod:string; - calculationPeriod: string; - bandKeyId: string; - bandplanKeyId: string; - selectedChannelList: string[]; - inheritedFrequencyPlanA: 'INHERIT' | 'INVERTED' | ''; - inheritedFrequencyPlanB: 'INHERIT' | 'INVERTED' | ''; -}; -export type Link = { - id: number; - name: string; - operator: string; - lengthKm: number; - type: string; - siteA: Site; - siteB: Site; - operationalParameters : LinkOperationalParameters; -}; - -type Radio = { - id: number; - modelId: number; - modelName : string; - operationalParameters: { - modulationType: string; - transmissionPower: number | null; - enabledAdmModulations : string[]; - }; -}; - -type Antenna = { - gainDb: number; - id: number; - modelId: number; - modelName: string; - tiltDeg: number; - operationalParameters: { - agl : number; - }; -}; - -type Waveguide = { - id: number; - modelId: number; - modelName: string; - lengthM: number; - lossDbPerM: number; - type: string; - operationalParameters: { - waveguideLength : number; - }; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/linkTable.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/linkTable.ts deleted file mode 100644 index 31fbb1b..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/linkTable.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -export type LinkDetails = { - administrativeState: string; - deviceA: { id: number; nodeId: string; uuid: string }; - deviceB: { id: number; nodeId: string; uuid: string }; - id: number; - labels: []; - lifecycleState: string; - name: string; - operationalState: string; - operatorId: string; - siteA: { - areaId: string; - areaName: string; - id: number; - latitude: number; - longitude: number; - name: string; - operatorId: string; - uuid: string; - }; - siteB: { - areaId: string; - areaName: string; - id: number; - latitude: number; - longitude: number; - name: string; - operatorId: string; - uuid: string; - }; - type: string; - uuid: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/modulation.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/modulation.ts deleted file mode 100644 index 5c997b4..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/modulation.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Modulation = { - capE1: string; - dfm56QAM: string; - fktb: string; - minDelay: string; - minSigBw: string; - minSigHt: string; - modDsOffset: string; - netFilterDf: string; - nonMinDelay: string; - nonMinSigBw: string; - nonMinSigHt: string; - rslDist: string; - rslMin: string; - rxMin: string; - rxThr3BER: number; - rxThr6BER: number; - throughput: string; - txMax: string; - txMin: string; - xpif: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/radio.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/radio.ts deleted file mode 100644 index 785fdac..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/radio.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Modulation } from './modulation'; - -export type Radio = { - id: number; - modelId:number; - modelName: string; - type: { - id: number; - name: string; - description: string; - } | null; - operationalParameters: RadioOperationalParameters | null; - calculationParameters: RadioCalculationPrameters | null; -}; - -export type RadioOperationalParameters = { - modulations: Modulation; - C0I: string; - band: string; - bandwith: string; - cir: string; - eth: string; - lagE1: string; - lagEth: string; - mpls: string; - pdh: string; - rxMax: string; - sdh: string; - xpic: string; -}; - -export type RadioEverything = { - operationalParametersA : RadioOperationalParameters | null; - operationalParametersB : RadioOperationalParameters | null; - modulationListA: string[] | null; - modulationListB: string[] | null; - radioIdSiteA: number | null; - radioIdSiteB: number | null; -}; - -export type RadioCalculationPrameters = { - transmissionPower:number; - referenceModulation:string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/tabId.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/tabId.ts deleted file mode 100644 index ca4fd84..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/tabId.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - - -export type TabId = 'linkTable' | 'linkCalculation' | 'lineOfSight'; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/topologyTypes.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/topologyTypes.ts deleted file mode 100644 index db16687..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/topologyTypes.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// export type TopologyTypes ={ -// rainLoss : RainLoss, -// freeSpaceLoss: FreeSpaceLoss, -// absorption : Absorption -// } - -export type RainLoss = { - rainAttenuation: number; - rainFall: { - rainrate: number; - period: string; - }; -}; - - -export type FreeSpaceLoss = { - fspl: number; -}; - -export type Absorption = { - oxygenLoss: number; - waterLoss: number; - totalAbsorptionLoss: number; - period: string; -}; - - -export type LinkBudget = { - systemOperatingMarginA: number; - systemOperatingMarginB: number; - eirpA: number; - eirpB: number; - receivedPowerA: number; - receivedPowerB: number; -}; - -export type Distance = { - distanceInKm: number; -}; - -export type RadioBand = { - keyId: string; - name: string; - duplexspacingMHz: number; - centerFrequencyMHz: number; -}; - -export type Model = { - modelId: number; - id: number; - modelName: string; - operationalParameters: any; - calculationParameters: any; - type: { id: number; name: string; description: string }; - band: RadioBand; -}; - -export type ModelType = { - id: number; - name: string; - description: string; -}; - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/updateLink.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/updateLink.ts deleted file mode 100644 index 4d427b6..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/updateLink.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - type Site = { - modulationType: string; - transmissionPower: number; - waveguideLength: number | null; - agl: number; - radioModelId: number; - waveguideModelId: number; - radioAntennaModelId: number; - enabledAdmModulations: string[]; - - }; - type LinkOperationalParameters = { - rainPolarity: string; - rainModel: string; - rainRate: number; - absorptionMethod: string; - calculationPeriod: string; - bandKeyId: string; - bandplanKeyId: string; - selectedChannelList: SaveChannel[]; - }; - -export type UpdateLink = { - siteA: Site; - siteB: Site; - linkOperationalParameters: LinkOperationalParameters; -}; - -export type SaveChannel = { - channelKeyId : string; - channelPolarizationEnum: 'HORIZONTAL' | 'VERTICAL' | 'XPOL' | ''; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/waveguide.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/waveguide.ts deleted file mode 100644 index 7ba1e9a..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/model/waveguide.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -export type Waveguide = { - modelId: number; - id: number; - modelName: string; - type: { - id: number; - name: string; - description: string; - } | null; - operationalParameters: WaveguideOperationalParameters | null; - calculationParameters: WaveguideCalculationPrameters | null; -}; -export type WaveguideLoss = { - waveguideLossPerMeter: number; - waveguideLossdB: number; - waveguideName: string; - waveguideLength: number; - waveguideType: string; - waveguideLossA: number; - waveguideLossB: number; - -}; - -export type WaveguideOperationalParameters = { - band: string; - type: string; - shape: string; - length: number; - loss: string; - -}; - -export type WaveguideCalculationPrameters = { - waveguideLength: number; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/service/dataService.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/service/dataService.ts deleted file mode 100644 index d0d81e6..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/service/dataService.ts +++ /dev/null @@ -1,158 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -// Put Button handler stuff, REST Calls -import { requestRest, requestRestExt } from '../../../../../framework/src/services/restService'; - -import { Link } from '../model/link'; -import { AdaptiveModulationInput } from '../model/adaptiveModulationInput'; -import { AdaptiveModulationResponse } from '../model/adaptiveModulationTable'; -import { Absorption, Distance, FreeSpaceLoss, LinkBudget, ModelType, RadioBand, RainLoss } from '../model/topologyTypes'; -import { WaveguideLoss } from '../model/waveguide'; -import { Channel } from '../model/bandPlan'; - -const LINKCALCULATOR_BASE_URL = '/topology/linkcalculator'; -const MICROWAVE_URL = '/topology/microwave'; -const NETWORK_URL = MICROWAVE_URL + '/network'; - -const dataService = { - bandPlanRegulators : () => { - return requestRest((MICROWAVE_URL + '/bandplans/')); - }, - - getModels : (bandKeyId: string, modelTypeName: string) => { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/query/modellist/' + modelTypeName + '/' + bandKeyId); - return result; - }, - - rainAttenuation : (lat1: any, lon1: any, lat2: any, lon2: any, bandKeyId: string, polarization: string, worstmonth: boolean) => { - if (!worstmonth) { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/rain/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + polarization.toUpperCase() + '/' + 'ANNUAL'); - return result; - } else { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/rain/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + polarization.toUpperCase() + '/' + 'WORSTMONTH'); - return result; - } - }, - - manualRain : (rainfall: number, bandKeyId: string, distance: number, polarization: string) => { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/rain/' + '/manual/' + rainfall + '/' + bandKeyId + '/' + distance + '/' + polarization.toUpperCase()); - return result; - }, - - - FSL : (distance: number, bandKeyId: string) => { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/fsl/' + distance + '/' + bandKeyId); - return result; - }, - - AbsorptionAtt : (lat1: number, lon1: number, lat2: number, lon2: number, bandKeyId: string, worstmonth: boolean, absorptionMethod: string) => { - if (!worstmonth) { - - const result = requestRest(LINKCALCULATOR_BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + absorptionMethod); - return result; - } else { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/absorption/annual/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + bandKeyId + '/' + absorptionMethod); - return result; - } - }, - - linkBudget : (lat1: number, lon1: number, lat2: number, lon2: number, bandKeyId: string, absorptionMethod: string, - polarization: string, antennaGainA: number, antennaGainB: number, waveguideLossA: number, waveguideLossB: number, transmissionPowerA: number, - transmissionPowerB: number, rxSensitivityA: number, rxSensitivityB: number) => { - - const url = LINKCALCULATOR_BASE_URL + '/linkbudget/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2 + '/' + - absorptionMethod + '/' + polarization.toUpperCase() + '/' + antennaGainA + '/' + antennaGainB + '/' + - waveguideLossA + '/' + waveguideLossB + '/' + transmissionPowerA + '/' + transmissionPowerB + '/' + rxSensitivityA + '/' + rxSensitivityB; - - - const result = requestRest(url + '?bandKeyId=' + bandKeyId); - return result; - }, - - updateAutoDistance : (lat1: number, lon1: number, lat2: number, lon2: number) => { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/distance/' + lat1 + ',' + lon1 + ',' + lat2 + ',' + lon2); - return result; - }, - - waveguideLoss : (waveguideIdSiteA: number, waveguideIdSiteB: number, waveguideLengthA: number, waveguideLengthB: number) => { - - const result = requestRest(LINKCALCULATOR_BASE_URL + '/waveguide/' + waveguideIdSiteA + '/' + waveguideIdSiteB + '/' + waveguideLengthA + '/' + waveguideLengthB); - return result; - }, - - adaptiveModulationTable : async (adaptiveModulationInput: AdaptiveModulationInput) => { - const result = requestRestExt(LINKCALCULATOR_BASE_URL + '/link/' + adaptiveModulationInput.linkId + '/calculate/', { - method: 'POST', // or 'PUT' - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(adaptiveModulationInput), - }); - return result; - }, - - bandListQuery : async (bandplanKeyId: string) => { - const result = requestRestExt(MICROWAVE_URL + '/bandplans/' + bandplanKeyId + '/bands'); - return result; - }, - - modelTypeListQuery : async () => { - const result = requestRest(LINKCALCULATOR_BASE_URL + '/query/modeltypelist/'); - return result; - }, - - channelQuery : async (bandplanKeyId: string, bandKeyId: string) => { - - const response = await requestRestExt(MICROWAVE_URL + '/bandplans/' + bandplanKeyId + '/bands/' + bandKeyId + '/channels'); - return response; - }, - - saveLink : async (link: Link, id: number) => { - type Message = { 'message': string; saveFail: boolean }; - const response = await requestRestExt(LINKCALCULATOR_BASE_URL + '/link/' + id, { - method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(link), - }); - - if (response.status === 200) { - return response; - } else { - let message: Message = { message: '', saveFail: true }; - if (response.data?.message) { - message.message = 'Save failed ' + response.data.message; - return message; - } else { - message.message = 'Something went wrong ' + response.message; - return message; - } - - } - }, - - frequencyPlanQuery : (siteId: number) => { - const result = requestRestExt(NETWORK_URL + '/sites/' + siteId + '/frequencyplan'); - return result; - }, - -}; -export default dataService; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/service/processingService.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/service/processingService.ts deleted file mode 100644 index 1ec4733..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/service/processingService.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { Model } from '../model/topologyTypes'; -import { Radio, RadioEverything, RadioOperationalParameters } from '../model/radio'; -import { Waveguide } from '../model/waveguide'; -import { Antenna } from '../model/antenna'; - -export const getWaveguideList = (modelTypeList: Model[]) => { - let waveguides: Waveguide[] = []; - - modelTypeList.forEach(modeltype => { - if (modeltype.type?.name === 'radio-to-antenna-link') { - waveguides.push(modeltype); - - - } - }); - return waveguides; -}; -export const radioService = async (radioA: string | null, radioB: string | null, radios : Radio []) => { - let operationalParametersA: RadioOperationalParameters | null = null; - let operationalParametersB: RadioOperationalParameters | null = null; - let modulationListA: string[] = []; - let modulationListB: string[] = []; - let radioIdSiteA: number | null = null; - let radioIdSiteB: number | null = null; - - radios.forEach((element: Radio) => { - if (radioA !== null && radioA === element.modelName) { - operationalParametersA = element.operationalParameters; - - radioIdSiteA = element.id; - Object.keys(operationalParametersA?.modulations!).forEach((modulation) => { - if (modulation.endsWith('QAM') || modulation.endsWith('PSK')) { - modulationListA.push(modulation); - } - }); - } - }); - radios.forEach((element: Radio) => { - if (radioB !== null && radioB === element.modelName) { - operationalParametersB = element.operationalParameters; - radioIdSiteB = element.id; - - Object.keys(operationalParametersB?.modulations!).forEach((modulation) => { - if (modulation.endsWith('QAM') || modulation.endsWith('PSK')) { - modulationListB.push(modulation); - } - }); - } - }); - const transport: RadioEverything = { operationalParametersA, operationalParametersB, modulationListA, modulationListB, radioIdSiteA, radioIdSiteB }; - return transport; -}; -export const getRadioList = (modelTypeList: Model[] | undefined | null) => { - - let radios: Radio[] = []; - modelTypeList!.forEach(modeltype => { - if (modeltype.type.name === 'radio') { - - radios.push(modeltype); - } - }); - return radios; -}; -export const getAntennaList = (modelTypeList: Model[] | undefined | null) => { - let antennas: Antenna[] = []; - - modelTypeList!.forEach(element => { - - if (element.type.name === 'radio-antenna') { - antennas.push(element); - - - } - }); - - return antennas; -}; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/checkLink.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/checkLink.ts deleted file mode 100644 index 8eaf21d..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/checkLink.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { Link } from '../model/link'; - -export const check = (linktAttributes: Link):String => { - if (!linktAttributes) { - return 'Missing Link Attributes'; - } - var missingParameter:string = ''; - - const checkParameterNotExist = (val: number | null, message: string, description: string):string => { - //Check for null, undefined and NaN - return val == null || isNaN(val) ? message.concat(description + ':' + val) : message; - }; - missingParameter = checkParameterNotExist(linktAttributes.siteA.amslM, missingParameter, ' A-amslM'); - missingParameter = checkParameterNotExist(linktAttributes.siteB.amslM, missingParameter, ' B-amslM'); - missingParameter = checkParameterNotExist(linktAttributes.siteA.lat, missingParameter, ' A-lat'); - missingParameter = checkParameterNotExist(linktAttributes.siteA.lon, missingParameter, ' A-lon'); - missingParameter = checkParameterNotExist(linktAttributes.siteB.lat, missingParameter, ' B-lat'); - missingParameter = checkParameterNotExist(linktAttributes.siteB.lon, missingParameter, ' B-lon'); - - // for (var prop in linktAttributes.siteA.antenna) { - // if (prop !== null) { - // continue - // } else return false - // } - // for (var prop in linktAttributes.siteB.antenna) { - // if (prop !== null) { - // continue - // } else return false - // } - // for (var prop in linktAttributes.siteA.radio) { - // if (prop !== null) { - // continue - // } else return false - // } - // for (var prop in linktAttributes.siteB.radio) { - // if (prop !== null) { - // continue - // } else return false - // } - // for (var prop in linktAttributes.siteA.waveguide) { - // if (prop !== null) { - // continue - // } else return false - // } - // for (var prop in linktAttributes.siteB.waveguide) { - // if (prop !== null) { - // continue - // } else return false - // } - - if (missingParameter === '') { - return ''; - } else { - missingParameter = 'Missing parameters: '.concat(missingParameter); - console.log(missingParameter); - return missingParameter; - } -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/geoConverter.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/geoConverter.ts deleted file mode 100644 index b7cad62..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/geoConverter.ts +++ /dev/null @@ -1,34 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const LatLonToDMS = (value: number, isLon: boolean) => { - const absoluteValue = Math.abs(value); - const d = Math.floor(absoluteValue); - const m = Math.floor((absoluteValue - d) * 60); - const s = (absoluteValue - d - m / 60) * 3600; - const dms = `${d}° ${m}' ${s.toFixed(2)}"`; - - const sign = Math.sign(value); - - if (isLon) { - return (sign === -1 || sign === -0) ? dms + ' W' : dms + ' E'; - } else { - return (sign === -1 || sign === -0) ? dms + ' S' : dms + ' N'; - } -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/math.ts b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/math.ts deleted file mode 100644 index 4d60f01..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/utils/math.ts +++ /dev/null @@ -1,30 +0,0 @@ - -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const max = (a: T[], p: (v: T) => Number) => a.reduce((m, x) => p(m) > p(x) ? m : x, a[0]); -export const min = (a: T[], p: (v: T) => Number) => a.reduce((m, x) => p(m) < p(x) ? m : x, a[0]); - -export const isNumber = (value: number | null) =>{ - - if (!value) { - return false; - } else { - return !Number.isNaN(value); - } -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/views/linkCalculation.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/views/linkCalculation.tsx deleted file mode 100644 index 29b58d9..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/views/linkCalculation.tsx +++ /dev/null @@ -1,377 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { FC, useState } from 'react'; - -import Paper from '@mui/material/Paper'; -import Accordion from '@mui/material/Accordion'; -import Typography from '@mui/material/Typography'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import FormHelperText from '@mui/material/FormHelperText'; -import AccordionDetails from '@mui/material/AccordionDetails'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import { ExpandMoreOutlined } from '@mui/icons-material'; -import makeStyles from '@mui/styles/makeStyles'; -import CircularProgress from '@mui/material/CircularProgress'; -import Dialog from '@mui/material/Dialog'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import Stack from '@mui/material/Stack'; -import DialogActions from '@mui/material/DialogActions'; -import IconButton from '@mui/material/IconButton'; -import CloseIcon from '@mui/icons-material/Close'; - - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { saveLinkCallAsync } from '../actions/saveLinkAction'; -import { isCalculationServerReachableAction } from '../actions/viewAction'; -import ConnectionInfo from '../components/connectionInfo'; -import AntennaView from '../components/antenna'; -import AttenuationView from '../components/attenuations'; -import FrequencyChannelView from '../components/frequencyChannel'; -import LocationView from '../components/location'; -import RadioView from '../components/radio'; -import WaveguideView from '../components/waveguide'; -import MissingInformation from '../components/missingInformation'; -import { BASE_URL } from '../../pluginMicrowave'; -import { check } from '../utils/checkLink'; -import { calculateButtonAction } from '../actions/handleButtonAction'; - - - -const styles = makeStyles({ - sectionMargin: { - position: 'relative', background: 'rgb(187, 189, 191)', padding: '20px', overflow: 'auto', - }, - loading: { - position: 'absolute', top: 0, left: 0, width: '100%', height: '180px', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.7)', zIndex: 9999, - }, - outerDiv: { - paddingLeft: '15px', paddingRight: '15px', paddingTop: '0px', display: 'flex', flexDirection: 'column', flex: 1, - }, - accordionTitle: { - width: '33%', flexShrink: 0, - }, - justifyCenter: { - justifyContent: 'center', - }, - calculateButton: { - marginTop: 20, position: 'fixed', top: '150px', right: '70px', - }, - saveButton: { - marginTop: 20, position: 'fixed', top: '200px', right: '70px', - }, - saveResponseOk: { - marginTop: 65, position: 'fixed', top: '250px', right: '70px', - }, - serverResponse: { - marginTop: 65, position: 'fixed', top: '250px', right: '70px', color: 'red', - }, - paper: { - display: 'flex', flexDirection: 'row', - }, - buttonBox: { width: '170px' }, - closeIcon: { - marginTop: 20, top: '-75px', right: '-40px', - }, -}); - -const LinkCalculation: FC = (() => { - const attenuationMandatoryParameters = useSelectApplicationState( state=> state.microwave.atmosphere.attenuationMandatoryParameters); - const radioMandatoryParameters = useSelectApplicationState( state=> state.microwave.radio.radioMandatoryParameters); - const waveguideMandatoryParameters = useSelectApplicationState(state=> state.microwave.waveguide.waveguideMandatoryParameters); - const antennaMandatoryParameters = useSelectApplicationState( state=> state.microwave.antenna.antennaMandatoryParameters); - const frequencyMandatoryParameters = useSelectApplicationState( state=> state.microwave.radio.frequencyMandatoryParameters); - const locationMandatoryParameters = useSelectApplicationState( state=> state.microwave.site.locationMandatoryParameters); - const linkAttributes = useSelectApplicationState( state=> state.microwave.query.linkAttributes); - // const loadingComplete = useSelectApplicationState( state=> state.microwave.view.loadingComplete); - const processing = useSelectApplicationState( state=> state.microwave.view.processing); - // const formView = useSelectApplicationState( state=> state.microwave.view.formView); - const reachable = useSelectApplicationState( state=> state.microwave.view.reachable); - const save = useSelectApplicationState( state=> state.microwave.query.linkSave); - const isCalculationServerReachable = useSelectApplicationState( state=> state.microwave.view.reachable); - const savingComplete = useSelectApplicationState( state=> state.microwave.query.savingComplete); - const linkSaving = useSelectApplicationState( state=> state.microwave.query.linkSaving); - - const [isFrequencyAccordionOpen, setFrequencyAccordionOpen] = useState(false); - const [isAntennaAccordionOpen, setAntennaAccordionOpen] = useState(false); - const [isWaveguideAccordionOpen, setWaveguideAccordionOpen] = useState(false); - const [isRadioAccordionOpen, setRadioAccordionOpen] = useState(false); - const [isOpenDialog, setOpenDialog] = useState(false); - const dispatch = useApplicationDispatch(); - - const UpdateConectivity = (serverReachable: boolean) => dispatch(new isCalculationServerReachableAction(serverReachable)); - - - - const restCallsActionAsync = () => dispatch(calculateButtonAction()); - const saveCallsActionAsync = () => dispatch(saveLinkCallAsync()); - - const classes = styles(); - const handleDialogClose = () => setOpenDialog(false); - - const handleButton = (e: any) => { - if (e.target.value === 'CALCULATE') { - restCallsActionAsync(); - } - if (e.target.value === 'SAVE') { - setOpenDialog(true); - saveCallsActionAsync(); - } - }; - - React.useEffect(() => { - - }, []); - React.useEffect(() => { - fetch(BASE_URL + '/fsl/1/' + '$13') - .then(res => { if (res.ok) { UpdateConectivity(true); } else { UpdateConectivity(false); } }); - }, []); - - - return ( -
- - - - - { - reachable && - <> - {processing ? - - - - - Channel Select - - - - - - - -
- -

Processing ...

-
-
-
-
-
- : - <> - {(check(linkAttributes)) !== '' ? - : -
- - - } - aria-label="location-panel-header" - id="location-panel-header" - > - Location - {!locationMandatoryParameters && - < Typography > - * Required Fields Missing * - - } - - - - - - - - setFrequencyAccordionOpen(!isFrequencyAccordionOpen)}> - } - aria-label="frequeny-panel-header" - id="frequency-header" - > - Frequency and Channel - {!frequencyMandatoryParameters && - < Typography > - * Required Fields Missing * - - } - - - {isFrequencyAccordionOpen && - - } - - - setAntennaAccordionOpen(!isAntennaAccordionOpen)}> - } - aria-label="antenna-header" - id="antenna-header" - > - Antenna - {!antennaMandatoryParameters && - < Typography > - * Required Fields Missing * - - } - - - - - - setWaveguideAccordionOpen(!isWaveguideAccordionOpen)}> - } - aria-label="waveguide-header" - id="waveguide-header" - > - Waveguide - {!waveguideMandatoryParameters && - < Typography > - * Required Fields Missing * - - } - - - - - - setRadioAccordionOpen(!isRadioAccordionOpen)}> - } - aria-label="radio-header" - id="radio-header" - > - Radio - {!radioMandatoryParameters && - < Typography > - * Required Fields Missing * - - } - - - - - - - } - aria-label="attenuation-header" - id="attenuation-header" - > - Attenuation - {!attenuationMandatoryParameters && - < Typography > - * Required Fields Missing * - - } - - - - - - -
- } - - - -
- {isOpenDialog && - - <> - { - linkSaving ? - - - - - - Save - - - - - - - -
- -

Saving ...

-
-
-
-
-
- - : <> - { - save.saveFail ? - - - - - - - - - - : savingComplete && - save.status === 200 && - Link Saved - } - - } - - } -
-
- - } - - } -
-
- ); -}); - -export default LinkCalculation; diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/views/mainView.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/views/mainView.tsx deleted file mode 100644 index 647820e..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/linkCalculator/views/mainView.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect, useState, SyntheticEvent } from 'react'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - -import AppBar from '@mui/material/AppBar'; -import Tab from '@mui/material/Tab'; -import Tabs from '@mui/material/Tabs'; - -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; -import { useApplicationDispatch } from '../../../../../framework/src/flux/connect'; - -import LineOfSightMainView from '../../lineOfSight/views/lineOfSightMain'; -import { TabId } from '../model/tabId'; -import LinkCalculation from './linkCalculation'; -import LinkTableComponent from '../components/linkTable'; - -type mainComponentProps = RouteComponentProps & { activePanel: string }; - -export const MainView: FC = (props) => { - - const [panel, setPanel] = useState(props.activePanel); - const dispatch = useApplicationDispatch(); - const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path, '')); - - // const dispatch = useApplicationDispatch(); - // const updateTab =(value:TabId) => dispatch(new UpdateTabAction(value)) - - const changeTab = (event: SyntheticEvent, value: TabId) => { - setPanel(value); - }; - - const linkTableTab = () => { - navigateToApplication('microwave', ''); - }; - - const calculateLinkTab = () => { - navigateToApplication('microwave', 'calculateLink'); - }; - - const lineOfSightTab = () => { - navigateToApplication('microwave', 'lineOfSightMap'); - }; - - useEffect(() => { - if (panel == null) { - setPanel('linkTable'); - } - }, []); - - return ( - <> - - - - - - - - {panel === 'linkTable' - ? - : panel === 'linkCalculation' - ? - : panel === 'lineOfSight' - ? - : null - } - - ); -}; - -export default withRouter(MainView); \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/src/pluginMicrowave.tsx b/features/sdnr/odlux/odlux/apps/microwaveApp/src/pluginMicrowave.tsx deleted file mode 100644 index 4e7f9fe..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/src/pluginMicrowave.tsx +++ /dev/null @@ -1,213 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -// app configuration and main entry point for the app - -import React, { FC } from 'react'; -import applicationManager from '../../../framework/src/services/applicationManager'; -import { requestRest } from '../../../framework/src/services/restService'; - -import { Antenna } from './linkCalculator/model/antenna'; -import { Link } from './linkCalculator/model/link'; -import { Radio } from './linkCalculator/model/radio'; -import { ModelType } from './linkCalculator/model/topologyTypes'; -import { Waveguide } from './linkCalculator/model/waveguide'; - -import { Redirect, Route, RouteComponentProps, Switch, useLocation, withRouter } from 'react-router-dom'; -import { useApplicationDispatch } from '../../../framework/src/flux/connect'; -import { SetPassedInValues, SetReachableAction } from './lineOfSight/actions/lineOfSightCommonActions'; -import { TERRAIN_URL, TILE_URL } from './lineOfSight/config'; -import { isNumber } from './lineOfSight/utils/lineOfSightMath'; -import { FirstMandatoryCheckAction } from './linkCalculator/actions/errorAction'; -import { UpdateModelTypesAction, UpdateRegionRegulatorListAction } from './linkCalculator/actions/queryActions'; -import { UpdateDevicesOnFirstLoad } from './linkCalculator/actions/radioActions'; -import { PluginDoneLoadingAction, ResetFormAction } from './linkCalculator/actions/viewAction'; -import RootHandler from './linkCalculator/handlers/rootHandler'; -import dataService from './linkCalculator/service/dataService'; -import MainView from './linkCalculator/views/mainView'; -import { Channel, RegionRegulator } from './linkCalculator/model/bandPlan'; -import { getAllBands, getFrequencyplans, updateSavedChannels } from './linkCalculator/actions/bandPlanAction'; -import { SaveChannel } from './linkCalculator/model/updateLink'; - -const appIcon = require('./linkCalculator/assets/icons/microwaveAppIcon.svg'); // select app icon - -export const BASE_URL = '/topology/linkcalculator'; - - - - - -const useQuery = () => { - return new URLSearchParams(useLocation().search); -}; - -const MicrowaveRouteAdapter = ((props: RouteComponentProps<{ mountId?: string }>) => { - const dispatch = useApplicationDispatch(); - - const resetForm = () => dispatch(new ResetFormAction()); - const updateRegulatorList = (regionRegulatorList: RegionRegulator[]) => dispatch(new UpdateRegionRegulatorListAction(regionRegulatorList)); - const updateModelTypes = (modelTypes: ModelType[]) => dispatch(new UpdateModelTypesAction(modelTypes)); - const updateDevicesOnFirstLoad = async (antennas: Antenna[], radios: Radio[], waveguides: Waveguide[], linkAttributes: Link) => { - dispatch(await new UpdateDevicesOnFirstLoad(antennas, radios, waveguides, linkAttributes)); - dispatch(new FirstMandatoryCheckAction()); - dispatch(new PluginDoneLoadingAction(true)); - dispatch(getAllBands(linkAttributes.operationalParameters.bandplanKeyId)); - dispatch(getFrequencyplans(linkAttributes.siteA.id, linkAttributes.siteB.id, linkAttributes.operationalParameters.bandKeyId)); - - }; - const getSavedChannels = async (savedChannels: SaveChannel[], allChannels: Channel[]) => dispatch(updateSavedChannels(savedChannels, allChannels)); - let query = useQuery(); - // called when component finished mounting - - const extractLinkIDFromURL = (queryParam: URLSearchParams) => { - return queryParam.get('linkId'); - }; - - React.useEffect(() => { - const linkId = extractLinkIDFromURL(query); - const linkAttributes = requestRest(`${BASE_URL}/link/${linkId}`); - const regulators = dataService.bandPlanRegulators(); - - - const modelTypeListQuery = dataService.modelTypeListQuery(); - const queryArray = [regulators, modelTypeListQuery, linkAttributes]; - if (linkId) { - Promise.all(queryArray).then(async values => { - - let radios: Radio[] = []; - let antennas: Antenna[] = []; - let waveguides: Waveguide[] = []; - await dataService.getModels(values[2].operationalParameters.bandKeyId, 'radio')!.then((x: Radio[]) => { - radios = x; - }); - await dataService.getModels(values[2].operationalParameters.bandKeyId, 'radio-antenna')!.then((x: Antenna[]) => { - antennas = x; - }); - await dataService.getModels(values[2].operationalParameters.bandKeyId, 'radio-to-antenna-link')!.then((x: Waveguide[]) => { - waveguides = x; - }); - updateRegulatorList(values[0]); - updateModelTypes(values[1]); - - if (values[2].operationalParameters.selectedChannelList && values[2].operationalParameters.selectedChannelList.length > 0) { - const channelQueryPromise = await dataService.channelQuery(values[2].operationalParameters.bandplanKeyId, values[2].operationalParameters.bandKeyId); - if (channelQueryPromise.data) { - getSavedChannels(values[2].operationalParameters.selectedChannelList, channelQueryPromise.data); - } - } - - updateDevicesOnFirstLoad(antennas, radios, waveguides, values[2]); - - }); - } else { - resetForm(); - } - }, []); - - - React.useEffect(() => { - if (props.location.pathname === '/microwave' && props.location.search.length == 0) { - resetForm(); - } - }, [props.location.pathname, props.location.search]); - - return ( - - ); -}); - -type AppProps = RouteComponentProps; -const LineOfSightApplicationRouteAdapter: FC = () => { - const dispatch = useApplicationDispatch(); - const setPassedInValues = (values: (string | null)[]) => dispatch(SetPassedInValues(values)); - const setReachable = (reachable: boolean) => dispatch(new SetReachableAction(reachable)); - let query = useQuery(); - - /*** - * - * Checks if lat1, lon1, lat2, lon2 were passed in as url parameters - */ - const areMandatoryParamsPresent = (queryParams: URLSearchParams) => { - return isNumber(queryParams.get('lat1')) && isNumber(queryParams.get('lon1')) && isNumber(queryParams.get('lat2')) && isNumber(queryParams.get('lon2')); - }; - - const extractValuesFromURL = (queryParams: URLSearchParams) => { - return [queryParams.get('lat1'), queryParams.get('lon1'), queryParams.get('lat2'), queryParams.get('lon2'), queryParams.get('amslA'), queryParams.get('antennaHeightA'), query.get('amslB'), queryParams.get('antennaHeightB')]; - }; - - const extractAndDispatchUrlValues = () => { - //if mandatory values aren't there, do nothing - if (areMandatoryParamsPresent(query)) { - const values = extractValuesFromURL(query); - setPassedInValues(values); - } - }; - - const tryCheckConnection = () => { - const terrain = fetch(`${TERRAIN_URL}/`); - const tiles = fetch(`${TILE_URL}/10/0/0.png`); - - Promise.all([terrain, tiles]) - .then((result) => { - setReachable(result[0].ok && result[1].ok); - }) - .catch(error => { - console.error('services not reachable.'); - console.error(error); - setReachable(false); - }); - }; - - // called when component finshed mounting - React.useEffect(() => { - extractAndDispatchUrlValues(); - //check tiles/terrain connectivity - tryCheckConnection(); - - }, []); - - return ( - - ); -}; - -const App = withRouter((props: RouteComponentProps) => { - props.history.action = 'POP'; - return ( - - - - - - - - ); -}); - -export function register() { - applicationManager.registerApplication({ - name: 'microwave', - icon: appIcon, - rootActionHandler: RootHandler, - rootComponent: App, - menuEntry: 'Microwave', - }); -} - - - diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/tsconfig.json b/features/sdnr/odlux/odlux/apps/microwaveApp/tsconfig.json deleted file mode 100644 index 18956db..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - }, -} diff --git a/features/sdnr/odlux/odlux/apps/microwaveApp/webpack.config.js b/features/sdnr/odlux/odlux/apps/microwaveApp/webpack.config.js deleted file mode 100644 index 2a0c5f8..0000000 --- a/features/sdnr/odlux/odlux/apps/microwaveApp/webpack.config.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); -const proxyConf = require('../../proxy.conf'); - - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - microwaveApp: ["./pluginMicrowave.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "[name]", - libraryTarget: "umd2", - chunkFilename: "[name].js" - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - }, - { - test: /\.css$/i, - use: ["style-loader", "css-loader"], - }, { - //don't minify images - test: /\.(png|gif|jpg|svg)$/, - use: [{ - loader: 'url-loader', - options: { - limit: 10, - name: './images/[name].[ext]' - } - }] - }] - }, - - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release" ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ]) - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: proxyConf, - } - }]; -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/minimumApp/pom.xml b/features/sdnr/odlux/odlux/apps/minimumApp/pom.xml index 6f9d913..b25ca82 100644 --- a/features/sdnr/odlux/odlux/apps/minimumApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/minimumApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-minimumApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/.babelrc b/features/sdnr/odlux/odlux/apps/networkMapApp/.babelrc deleted file mode 100644 index 3d8cd12..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/README.md b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/README.md deleted file mode 100644 index b26fbc2..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/README.md +++ /dev/null @@ -1,29 +0,0 @@ -Copyright of icons is as followes: - - - -datacenter.png and lamp.png - -Taken from MS Word - -According to https://support.microsoft.com/en-us/office/insert-icons-in-microsoft-office-e2459f17-3996-4795-996e-b9a13486fa79 (date: October 9th, 2019) -"These icons are free to use; there's no royalty or copyright." - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/apartment.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/apartment.png deleted file mode 100644 index d4a1c5e..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/apartment.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/apartment.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/apartment.png.d.ts deleted file mode 100644 index bf398f5..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/apartment.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const apartment: string; -export default apartment; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/customize.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/customize.png deleted file mode 100644 index 91dbf68..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/customize.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/customize.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/customize.png.d.ts deleted file mode 100644 index 7bcffb2..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/customize.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const customize: string; -export default customize; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenter.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenter.png deleted file mode 100644 index eb2a627..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenter.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenter.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenter.png.d.ts deleted file mode 100644 index a58a9f5..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenter.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const datacenter: string; -export default datacenter; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenterred.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenterred.png deleted file mode 100644 index 5d5a6c5..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenterred.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenterred.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenterred.png.d.ts deleted file mode 100644 index 33f3061..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/datacenterred.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const datacenterred: string; -export default datacenterred; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factory.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factory.png deleted file mode 100644 index a38781b..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factory.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factory.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factory.png.d.ts deleted file mode 100644 index b5c4f19..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factory.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const factory: string; -export default factory; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factoryred.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factoryred.png deleted file mode 100644 index 959603a..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factoryred.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factoryred.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factoryred.png.d.ts deleted file mode 100644 index 1fac0a9..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/factoryred.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const factoryRed: string; -export default factoryRed; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lamp.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lamp.png deleted file mode 100644 index f5ea001..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lamp.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lamp.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lamp.png.d.ts deleted file mode 100644 index 9634b12..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lamp.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const lamp: string; -export default lamp; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lampred.png b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lampred.png deleted file mode 100644 index 4678ce9..0000000 Binary files a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lampred.png and /dev/null differ diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lampred.png.d.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lampred.png.d.ts deleted file mode 100644 index 12a8f91..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/icons/lampred.png.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const lampred: string; -export default lampred; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/package.json b/features/sdnr/odlux/odlux/apps/networkMapApp/package.json deleted file mode 100644 index eb50534..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "@odlux/transport-app", - "version": "0.1.0", - "description": "A react based modular UI to display event log from a database.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Aijana Schumann", - "license": "Apache-2.0", - "dependencies": { - "@fortawesome/free-solid-svg-icons": "5.6.3", - "@fortawesome/react-fontawesome": "0.1.14", - "@emotion/react": "^11.7.0", - "@emotion/styled": "^11.6.0", - "@mui/icons-material": "^5.2.0", - "@mui/material": "^5.2.2", - "@mui/styles": "^5.2.2", - "@odlux/framework": "*", - "history": "^4.9.0", - "maplibre-gl": "^3.0.0", - "object.values": "^1.1.1" - }, - "peerDependencies": { - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "@types/react": "17.0.37", - "@types/react-dom": "17.0.11", - "@types/react-router-dom": "5.1.7", - "jquery": "3.3.1", - "react": "17.0.2", - "react-dom": "17.0.2", - "react-router-dom": "5.2.0", - "react-split-pane": "0.1.92" - } -} diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/pom.xml b/features/sdnr/odlux/odlux/apps/networkMapApp/pom.xml deleted file mode 100644 index eb0b0ce..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - 4.0.0 - - org.o-ran-sc.oam-controller.features.sdnr.odlux - sdnr-odlux-app-networkMapApp - 1.7.0-SNAPSHOT - jar - - SDNR ODLUX :: ${project.artifactId} - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - - - dist - odlux - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - de.jacks-it-lab - frontend-maven-plugin - 1.7.2 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v16.17.0 - v1.22.19 - - - - yarn build - - yarn - - - run build - - - - - - - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/connectivityAction.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/connectivityAction.ts deleted file mode 100644 index 16df2ad..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/connectivityAction.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -export class IsTopologyServerReachableAction extends Action { - constructor(public reachable: boolean) { - super(); - } -} - -export class IsTileServerReachableAction extends Action { - constructor(public reachable: boolean) { - super(); - } -} - -export class IsBusyCheckingConnectivityAction extends Action { - constructor(public isBusy: boolean) { - super(); - } -} - -export const handleConnectionError = () => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { network: { connectivity: { isTopologyServerAvailable } } } = getState(); - if (isTopologyServerAvailable) { - dispatcher(new IsTopologyServerReachableAction(false)); - } -}; - -export const handleConnectionChange = (newState: boolean) => (dispatcher: Dispatch, _getState: () => IApplicationStoreState) => { - dispatcher(new IsTopologyServerReachableAction(newState)); -}; - -export const setTileServerReachableAction = (isReachable: boolean) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { network: { connectivity: { isTileServerAvailable } } } = getState(); - if (isReachable !== isTileServerAvailable) { - dispatcher(new IsTileServerReachableAction(isReachable)); - } -}; - -export const setTopologyServerReachableAction = (isReachable: boolean) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { network: { connectivity: { isTopologyServerAvailable } } } = getState(); - if (isReachable !== isTopologyServerAvailable) { - dispatcher(new IsTopologyServerReachableAction(isReachable)); - } -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/detailsAction.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/detailsAction.ts deleted file mode 100644 index d00d3ae..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/detailsAction.ts +++ /dev/null @@ -1,146 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { requestRest } from '../../../../framework/src/services/restService'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { Link, Site, Device, Service } from '../model/topologyTypes'; -import { HistoryEntry } from '../model/historyEntry'; -import { NetworkElementConnection } from '../model/networkElementConnection'; -import { dataService } from '../services/dataService'; -import { highlightElementAction } from './mapActions'; -import { handleConnectionError } from './connectivityAction'; - -import { SITEDOC_URL } from '../config'; - -export class SelectElementAction extends Action { - constructor(public data: Link | Site | Service) { - super(); - } -} - -export class ClearDetailsAction extends Action { -} - -export class AddToHistoryAction extends Action { - constructor(public entry: HistoryEntry) { - super(); - } -} - -export class ClearHistoryAction extends Action { -} - -export class IsBusyCheckingDeviceListAction extends Action { - constructor(public isBusy: boolean) { - super(); - } -} - -export class FinishedLoadingDeviceListAction extends Action { - constructor(public devices: Device[]) { - super(); - } -} - -export class ClearLoadedDevicesAction extends Action { -} - -export class InitializeLoadedDevicesAction extends Action { - constructor(public devices: Device[]) { - super(); - } -} - -export class IsSitedocReachableAction extends Action { - constructor(public isReachable: boolean) { - super(); - } -} - -export const UpdateDetailsView = (nodeId: string) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { network: { details: { checkedDevices } } } = getState(); - if (checkedDevices !== null) { - const index = checkedDevices.findIndex(item => item.name === nodeId); - if (index !== -1) - requestRest('/rests/operational/network-topology:network-topology/topology/topology-netconf/node/' + nodeId, { method: 'GET' }) - .then(result => { - if (result !== null) { - checkedDevices[index].status = result.node[0]['netconf-node-topology:connection-status']; - } else { - checkedDevices[index].status = 'Not connected'; - } - dispatcher(new FinishedLoadingDeviceListAction(checkedDevices)); - }); - } -}; - -export const CheckDeviceList = (list: Device[]) => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - - const { network: { details: { isBusyCheckingDeviceList } } } = getState(); - - if (isBusyCheckingDeviceList) return; - dispatcher(new IsBusyCheckingDeviceListAction(true)); - - const ids: string[] = list - .filter(el => el.name && el.name.length > 0) - .map((device) => { - return device.name; - }); - - const resultData = await dataService.getAdditionalInfoOnDevices(ids); - - if (resultData) { - resultData.forEach((data: NetworkElementConnection) => { - - const index = list.findIndex(el => { return el.name === data.id; }); - if (index !== -1) { - list[index].status = data.status; - list[index].type = data['device-type']; - } - }); - } - - dispatcher(new FinishedLoadingDeviceListAction(list)); - dispatcher(new IsBusyCheckingDeviceListAction(false)); -}; - -export const CheckSitedocReachability = () => async (dispatcher: Dispatch) => { - requestRest(SITEDOC_URL + '/app/versioninfo').then(response => { - console.log(response); - if (response) { - dispatcher(new IsSitedocReachableAction(true)); - } else { - dispatcher(new IsSitedocReachableAction(false)); - } - }); -}; - -export const LoadNetworkElementDetails = (type: string, id: string, zoomToElement = false) => async (dispatcher: Dispatch) => { - const response = await dataService.getDetailsData(type, id); - if (response !== null) { - dispatcher(new SelectElementAction(response)); - dispatcher(highlightElementAction(response, zoomToElement)); - dispatcher(new ClearHistoryAction()); - } else { - dispatcher(handleConnectionError()); - } -}; - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/filterActions.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/filterActions.ts deleted file mode 100644 index 7f12c09..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/filterActions.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; - -export class SetFilterValueAction extends Action { - constructor(public value: string) { - super(); - } -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/mapActions.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/mapActions.ts deleted file mode 100644 index 58c4024..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/mapActions.ts +++ /dev/null @@ -1,196 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { Coordinate } from '../model/coordinates'; -import { BoundingBox } from '../model/boundingBox'; -import { Link, Site, Service, isLink, isService, isSite } from '../model/topologyTypes'; - -import { dataService } from '../services/dataService'; -import { URL_API } from '../config'; -import { updateMapLayers } from '../services/settingsService'; -import { calculateMidPoint } from '../utils/mapUtils'; - -export class HighlightLinkAction extends Action { - constructor(public link: Link) { - super(); - } -} - -export class HighlightSiteAction extends Action { - constructor(public site: Site) { - super(); - } -} - -export class HighlightServiceAction extends Action { - constructor(public service: Service) { - super(); - } -} - -export class RemoveHighlightingAction extends Action { -} - -export class ZoomToSearchResultAction extends Action { - constructor(public center: Coordinate, public start?: Coordinate, public end?: Coordinate, public zoom?: number) { - super(); - } -} - -export class ZoomToFinishedAction extends Action { -} - -export class AddAlarmAction extends Action { - constructor(public site: Site) { - super(); - } -} - -export class RemoveAlarmAction extends Action { - constructor(public site: Site) { - super(); - } -} - -export class SetCoordinatesAction extends Action { - constructor(public lat: string, public lon: string, public zoom: string) { - super(); - } -} - -export class SetStatistics extends Action { - constructor(public siteCount: string, public linkCount: string, public serviceCount: string) { - super(); - } -} - -export class SetIconSwitchAction extends Action { - constructor(public enable: boolean) { - super(); - } -} - -export class LayerChangedAction extends Action { - constructor(public layerName: string, public displayed: boolean, public isBaseLayer: boolean) { - super(); - } -} - -export class UpdateLayersVisibilityAction extends Action { - constructor(public layerVisibility: { [key: string]: boolean }) { - super(); - } -} - -export class LayersLoadedAction extends Action { - constructor(public layers: string[]) { - super(); - } -} - -export class OpenLayersAction extends Action { - constructor(public open: boolean) { - super(); - } -} - -export class OpenStatisticsAction extends Action { - constructor(public open: boolean) { - super(); - } -} - -export const updateLayerAsyncAction = (layerName: string, displayed: boolean, isBaseLayer = true) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - dispatcher(new LayerChangedAction(layerName, displayed, isBaseLayer)); - - const { network: { map: { layersContainer } } } = getState(); - const newLayerSettings = layersContainer.elements.reduce((acc, layer) => { - acc[layer.name] = layer.displayed; - return acc; - }, {} as { [key: string]: boolean }); - - return updateMapLayers(newLayerSettings).then(() => true); -}; - -export const loadLayers = () => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const currentLayers = getState().network.map.layersContainer.elements; - return dataService.getLabels().then(res => { - const data = (res || []).filter(i => i !== 'default'); - const filteredLayers = data.filter(i => !currentLayers.find(el => el.name == i)); - dispatcher(new LayersLoadedAction(filteredLayers)); - }).then(() => true); -}; - -// Not used as of right now -export const findSiteToAlarm = (alarmedNodeId: string) => (dispatcher: Dispatch) => { - - fetch(URL_API + '/sites/devices/' + alarmedNodeId) - .then(res => res.json()) - .then(result => { - dispatcher(new AddAlarmAction(result)); - }); -}; - -export const highlightElementAction = (data: Service | Link | Site, zoomToElement = false) => (dispatcher: Dispatch) => { - if (isSite(data)) { - dispatcher(new HighlightSiteAction(data)); - if (zoomToElement) { - dispatcher(new ZoomToSearchResultAction(data.location)); - } - } else if (isLink(data)) { - dispatcher(new HighlightLinkAction(data)); - if (zoomToElement) { - const midPoint = calculateMidPoint(data.siteA.lat, data.siteA.lon, data.siteB.lat, data.siteB.lon); - const startPoint = { lat: data.siteA.lat, lon: data.siteA.lon }; - const endPoint = { lat: data.siteB.lat, lon: data.siteB.lon }; - dispatcher(new ZoomToSearchResultAction(midPoint, startPoint, endPoint)); - } - } else if (isService(data)) { - dispatcher(new HighlightServiceAction(data)); - if (zoomToElement) { - const midPoint = calculateMidPoint(data.route[0].lat, data.route[0].lon, data.route[data.route.length - 1].lat, data.route[data.route.length - 1].lon); - const startPoint = { lat: data.route[0].lat, lon: data.route[0].lon }; - const endPoint = { lat: data.route[data.route.length - 1].lat, lon: data.route[data.route.length - 1].lon }; - dispatcher(new ZoomToSearchResultAction(midPoint, startPoint, endPoint)); - } - } -}; - -export const updateZoomAction = (zoom: string) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { network: { map: { coordinates: { lat, lon } } } } = getState(); - dispatcher(new SetCoordinatesAction(lat, lon, zoom)); -}; - -export const updateStatistics = (boundingBox: BoundingBox) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - - const { network: { map: { statistics: { links, sites, services } } } } = getState(); - - dataService.getStatistics(boundingBox.west, boundingBox.south, boundingBox.east, boundingBox.north) - .then(result => { - if (result) { - // do not dispatch if data didn't change - if (result.links !== links || result.sites !== sites || result.services !== services) { - dispatcher(new SetStatistics(result.sites, result.links, result.services)); - } - } - }); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/searchAction.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/searchAction.ts deleted file mode 100644 index 7885ce0..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/searchAction.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; - -export class SetSearchValueAction extends Action { - constructor(public value: string) { - super(); - } -} diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/settingsAction.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/settingsAction.ts deleted file mode 100644 index 75d1a36..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/settingsAction.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { NetworkMapSettings, NetworkMapThemes } from '../model/settings'; -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { getMapSettings, updateMapSettings } from '../services/settingsService'; -import { UpdateLayersVisibilityAction } from './mapActions'; - -export class SetMapSettingsAction extends Action { - - constructor(public settings: NetworkMapSettings) { - super(); - } -} - -export class SetThemeSettingsAction extends Action { - - constructor(public settings: NetworkMapThemes) { - super(); - } -} - -export class SetBusyLoadingAction extends Action { - - constructor(public busy: boolean) { - super(); - - } -} - -/** - * An async action that loads the settings from the backend. - * @returns void - */ -export const getSettings = () => async (dispatch: Dispatch) => { - dispatch(new SetBusyLoadingAction(true)); - - getMapSettings().then(result => { - if (result) { - if (result.networkMap) { - dispatch(new SetMapSettingsAction(result.networkMap)); - } - if (result.networkMapThemes) { - dispatch(new SetThemeSettingsAction(result.networkMapThemes)); - } - if (result.networkMapLayers) { - dispatch(new UpdateLayersVisibilityAction(result.networkMapLayers)); - } - } else { - console.warn('settings couldn\'t be loaded.'); - } - dispatch(new SetBusyLoadingAction(false)); - }); -}; - -/** - * An async action that updates and saves the settings on the backend. - * @param mapSettings The new settings. - * @returns void - */ -export const updateSettings = (mapSettings: NetworkMapSettings) => async (dispatcher: Dispatch) =>{ - - const result = await updateMapSettings(mapSettings); - dispatcher(new SetMapSettingsAction(mapSettings)); - - if (!result) { - console.warn('settings couldn\'t be saved.'); - } - -}; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/sitedocManagementAction.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/sitedocManagementAction.ts deleted file mode 100644 index 95c9c54..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/actions/sitedocManagementAction.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { SitedocOrderTask, UserListItem } from '../model/siteDocTypes'; -import { sitedocDataService } from '../services/sitedocDataService'; - -export class SetAllUsersAction extends Action { - constructor(public users: UserListItem[]) { - super(); - } -} - -export class SetTSSRAction extends Action { - constructor(public isTSSR: boolean) { - super(); - } -} - -export class UpdateNoteAction extends Action { - constructor(public note: string) { - super(); - } -} - -export class UpdateStateAction extends Action { - constructor(public state: string) { - super(); - } -} - -export class UpdateTasks extends Action { - constructor(public tasks: SitedocOrderTask[]) { - super(); - } -} - -export class ResetAction extends Action { - -} - -export class SelectUserAction extends Action { - constructor(public user: string) { - super(); - } -} - -export class SetSiteExists extends Action { - constructor(public exists: boolean) { - super(); - } -} - -export const getUsersAction = () => async (dispatcher: Dispatch) => { - const users = await sitedocDataService.getAllUsers(); - dispatcher(new SetAllUsersAction(users)); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/app.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/app.tsx deleted file mode 100644 index a897870..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/app.tsx +++ /dev/null @@ -1,166 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useEffect } from 'react'; -import { useLocation } from 'react-router-dom'; - -import SplitPane from 'react-split-pane'; -import makeStyles from '@mui/styles/makeStyles'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../framework/src/flux/connect'; - -import { Map } from './components/map/map'; -import Details from './components/details/details'; -import { RemoveHighlightingAction, SetCoordinatesAction, updateZoomAction } from './actions/mapActions'; -import { ClearHistoryAction, LoadNetworkElementDetails } from './actions/detailsAction'; - -const useQuery = () => { - return new URLSearchParams(useLocation().search); -}; - -const useStyles = makeStyles({ - networkMap: { - position: 'relative', - flex: 1, - height: '100%', - }, - resizer: { - background: '#000', - opacity: 0.2, - zIndex: 1, - MozBoxSizing: 'border-box', - WebkitBoxSizing: 'border-box', - boxSizing: 'border-box', - MozBackgroundClip: 'padding', - WebkitBackgroundClip: 'padding', - backgroundClip: 'padding-box', - - '&:hover': { - WebkitTransition: 'all 2s ease', - transition: 'all 2s ease', - }, - - '&.horizontal': { - height: 11, - margin: '-5px 0', - borderTop: '5px solid rgba(255, 255, 255, 0)', - borderBottom: '5px solid rgba(255, 255, 255, 0)', - cursor: 'row-resize', - width: '100%', - }, - - '&.horizontal:hover': { - borderTop: '5px solid rgba(0, 0, 0, 0.5)', - borderBottom: '5px solid rgba(0, 0, 0, 0.5)', - }, - - '&.vertical': { - width: 11, - margin: '0 -5px', - borderLeft: '5px solid rgba(255, 255, 255, 0)', - borderRight: '5px solid rgba(255, 255, 255, 0)', - cursor: 'col-resize', - }, - - '&.vertical:hover': { - borderLeft: '5px solid rgba(0, 0, 0, 0.5)', - borderRight: '5px solid rgba(0, 0, 0, 0.5)', - }, - - '&.disabled': { - cursor: 'not-allowed', - }, - - '&.disabled:hover': { - borderColor: 'transparent', - }, - }, -}); - -const MainView: FC = () => { - - const query = useQuery(); - - const [ newLatParam, newLonParam ] = query.get('center')?.split(',') ?? []; - const newZoomParam = query.get('zoom'); - - const newLat = newLatParam ? Number(newLatParam).toFixed(4) : undefined; - const newLon = newLonParam ? Number(newLonParam).toFixed(4) : undefined; - const newZoom = newZoomParam ? Number(newZoomParam).toFixed(2) : undefined; - - const newSiteId = query.get('siteId'); - const newLinkId = query.get('linkId'); - const newServiceId = query.get('serviceId'); - - const { lat, lon, zoom } = useSelectApplicationState(state => state.network.map.coordinates); - const selectedLink = useSelectApplicationState(state => state.network.map.selectedLink); - const selectedSite = useSelectApplicationState(state => state.network.map.selectedSite); - const selectedService = useSelectApplicationState(state => state.network.map.selectedService); - - const dispatch = useApplicationDispatch(); - - useEffect(() => { - const coordinateHasChanged = (newLat !== lat) || (newLon !== lon) || (newZoom !== zoom); - const atLeastOneCoordinateIsDefined = newLat || newLon || newZoom; - - if (coordinateHasChanged && atLeastOneCoordinateIsDefined) { - dispatch(new SetCoordinatesAction(newLat || lat, newLon || lon, newZoom || zoom)); - } - - const handleSelectedElement = async () => { - // network element has changed - if (!newSiteId && !newLinkId && !newServiceId) { - dispatch(new ClearHistoryAction()); - dispatch(new RemoveHighlightingAction()); - return; - } else if (newSiteId) { - if (selectedSite?.properties.id !== Number(newSiteId) || coordinateHasChanged) { - await dispatch(LoadNetworkElementDetails('site', newSiteId, !newLat && !newLon)); - } - } else if (newLinkId) { - if (selectedLink?.properties.id !== Number(newLinkId) || coordinateHasChanged) { - await dispatch(LoadNetworkElementDetails('link', newLinkId, !newLat && !newLon)); - } - } else if (newServiceId) { - if (selectedService?.properties.id !== Number(newServiceId) || coordinateHasChanged) { - await dispatch(LoadNetworkElementDetails('service', newServiceId, !newLat && !newLon)); - } - } - - if (newZoom) { - dispatch(updateZoomAction(newZoom)); - } - }; - - handleSelectedElement(); - - }, [newLat, newLon, newZoom, newSiteId, newLinkId, newServiceId]); - - const styles = useStyles(); - - return ( -
- - -
- -
- ); -}; - -export default MainView; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/assets/icons/networkMapAppIcon.svg b/features/sdnr/odlux/odlux/apps/networkMapApp/src/assets/icons/networkMapAppIcon.svg deleted file mode 100644 index 1abc667..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/assets/icons/networkMapAppIcon.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/customize/networkMapSetup.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/customize/networkMapSetup.tsx deleted file mode 100644 index e6210ed..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/customize/networkMapSetup.tsx +++ /dev/null @@ -1,311 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useEffect, useRef, useState, ChangeEvent, MouseEvent } from 'react'; - -import maplibregl from 'maplibre-gl'; -import 'maplibre-gl/dist/maplibre-gl.css'; - -import makeStyles from '@mui/styles/makeStyles'; -import Typography from '@mui/material/Typography/Typography'; -import TextField from '@mui/material/TextField/TextField'; -import Grid from '@mui/material/Grid/Grid'; -import Slider from '@mui/material/Slider/Slider'; -import InputLabel from '@mui/material/InputLabel/InputLabel'; -import FormControlLabel from '@mui/material/FormControlLabel/FormControlLabel'; -import Button from '@mui/material/Button/Button'; -import MenuItem from '@mui/material/MenuItem/MenuItem'; -import Select from '@mui/material/Select/Select'; -import Switch from '@mui/material/Switch/Switch'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { requestRest } from '../../../../../framework/src/services/restService'; -import { IApplicationStoreState } from '../../../../../framework/src/store/applicationStore'; -import { SettingsComponentProps } from '../../../../../framework/src/models/settings'; - -import { OSM_STYLE } from '../../config'; -import { updateSettings } from '../../actions/settingsAction'; -import { NetworkMapSettings } from '../../model/settings'; -import mapLayerService from '../../utils/mapLayers'; - -import { ThemeEntry } from './themeElement'; - -const defaultBoundingBox = '12.882544785787754,52.21421979821472,13.775455214211949,52.80406241672602'; - -const useStyles = makeStyles({ - sectionMargin: { - marginTop: '30px', - marginBottom: '15px', - }, - elementMargin: { - marginLeft: '10px', - }, - settingsTable: { - display: 'flex', flexDirection: 'row', flexGrow: 1, height: '100%', position: 'relative', - }, - settingsRow: { - width: '60%', flexDirection: 'column', position: 'relative', marginRight: '15px', - }, -}); - -type NetworkMapSetupProps = SettingsComponentProps; - -const NetworkMapSetup = (props: NetworkMapSetupProps) => { - - const mapRef = useRef(); - const mapContainerRef = useRef(null); - - const mapSettings = useSelectApplicationState((state: IApplicationStoreState) => state.network.settings.mapSettings); - const mapThemes = useSelectApplicationState((state: IApplicationStoreState) => state.network.settings.themes); - - const dispatch = useApplicationDispatch(); - const updateMapSettings = (newMapSettings: NetworkMapSettings) => dispatch(updateSettings(newMapSettings)); - - const [opacity, setOpacity] = useState(Number(mapSettings?.tileOpacity) || 100); - const [theme, setTheme] = useState(mapSettings?.styling?.theme || ''); - const [latitude, setLatitude] = useState(Number(mapSettings?.startupPosition?.latitude) || 52.5); - const [longitude, setLongitude] = useState(Number(mapSettings?.startupPosition?.longitude) || 13.35); - const [zoom, setZoom] = useState(Number(mapSettings?.startupPosition?.zoom) || 10); - const [areIconsEnabled, setEnableIcons] = useState(mapSettings?.areIconsEnabled || true); - - // used to make opacity available within the map event-listeners - // (hook state values are snapshotted at initialization and not updated afterwards / only updated inside other hooks, thus use a ref here) - const myOpacityRef = useRef(opacity); - const setOpacityState = (data: any) => { - myOpacityRef.current = data; - setOpacity(data); - }; - - const updateSampleData = () => { - const map = mapRef.current; - if (!map) { - return; - } - - // get data of bounding box from networkmap - - const links = requestRest('/topology/network/links/geojson/' + defaultBoundingBox); - const sites = requestRest('/topology/network/sites/geojson/' + defaultBoundingBox); - - Promise.all([links, sites]).then(results => { - if (map.getSource('lines')) { - (map.getSource('lines') as maplibregl.GeoJSONSource).setData(results[0]); - } - - if (map.getSource('points')) { - (map.getSource('points') as maplibregl.GeoJSONSource).setData(results[1]); - } - - if (map.getSource('selectedPoints')) { - (map.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData(results[1].features[0]); - } - }); - }; - - const recenterMap = () => { - const map = mapRef.current; - if (map && !isNaN(latitude) && !isNaN(longitude) && !isNaN(zoom)) - map.flyTo({ - center: [ - longitude, - latitude, - ], zoom: zoom, - essential: false, - }); - }; - - const setState = () => { - const map = mapRef.current; - if (!map) { - return; - } - - if (mapSettings?.styling) { - setTheme(mapSettings.styling.theme); - mapLayerService.changeTheme(map, mapSettings.styling.theme); - } - - if (mapSettings?.areIconsEnabled !== undefined) { - setEnableIcons(mapSettings!.areIconsEnabled); - } - - const propOpacity = mapSettings?.tileOpacity; - if (propOpacity) { - setOpacityState(propOpacity); - } - }; - - const styles = useStyles(); - const currentTheme = mapThemes.find(el => el.key === theme); - - useEffect(() => { - mapLayerService.availableThemes = mapThemes; - mapRef.current = new maplibregl.Map({ - container: mapContainerRef.current!, - style: OSM_STYLE as any, - center: [longitude, latitude], - zoom: zoom, - }); - - mapRef.current.on('load', () => { - mapLayerService.addBaseSources(mapRef.current!, null, null, null); - if (mapSettings?.styling?.theme !== theme) { - mapLayerService.addBaseLayers(mapRef.current!); - } else { - mapLayerService.addBaseLayers(mapRef.current!); - } - mapLayerService.changeMapOpacity(mapRef.current!, myOpacityRef.current); - updateSampleData(); - }); - - mapRef.current.on('moveend', () => { - const center = mapRef.current!.getCenter(); - setZoom(Number(mapRef.current!.getZoom().toFixed(4))); - setLatitude(Number(center.lat.toFixed(4))); - setLongitude(Number(center.lng.toFixed(4))); - }); - - }, []); - - useEffect(() => { - recenterMap(); - }, [latitude, longitude, zoom]); - - useEffect(() => { - setState(); - }, [mapSettings]); - - const handleOpacityChange = (event: Event, newValue: number) => { - setOpacity(newValue); - mapLayerService.changeMapOpacity(mapRef.current!, newValue); - }; - - const handleShowIconsChange = (event: ChangeEvent, newValue: boolean) => { - setEnableIcons(newValue); - }; - - const handleChangeTheme = (e: any) => { - - const newTheme = e.target.value; - setTheme(newTheme); - mapLayerService.changeTheme(mapRef.current!, newTheme); - }; - - const handleCancel = (e: MouseEvent) => { - e.preventDefault(); - props.onClose(); - }; - - const handleSaveSettings = async (e: MouseEvent) => { - e.preventDefault(); - - const updatedSettings: NetworkMapSettings = { - tileOpacity: opacity.toString(), - styling: { theme: theme }, - areIconsEnabled: areIconsEnabled, - startupPosition: { - latitude: latitude.toString(), - longitude: longitude.toString(), - zoom: zoom.toString(), - }, - }; - - await updateMapSettings(updatedSettings); - props.onClose(); - }; - - /** - * Style property names to readable text - * @param text property name - * @returns readable text - */ - const styleText = (text: string) => { - const textParts = text.split(/(?=[A-Z])/); //split on uppercase character - const newText = textParts.join(' '); - return newText.charAt(0).toUpperCase() + newText.slice(1); - }; - - return ( - <> -

Settings

-
-
- Startup Position -
- setLatitude(e.target.value as any)} style={{ marginLeft: 10 }} label="Latitude" /> - setLongitude(e.target.value as any)} style={{ marginLeft: 5 }} label="Longitude" /> - setZoom(e.target.value as any)} style={{ marginLeft: 5 }} label="Zoom" /> -
- - - Tile Opacity - - - 0 - - - - 100 - - - - Display icons - - } - label="Show icons" - labelPlacement="end" - /> - - Style of properties - - Theme - - {currentTheme && -
- { - ['site', 'selectedSite', 'fiberLink', 'microwaveLink'].map(el => ( - - )) - } -
- } -
- - -
-
-
-
- - ); -}; - -NetworkMapSetup.displayName = 'NetworkMapSetup'; - -export { NetworkMapSetup }; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/customize/themeElement.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/customize/themeElement.tsx deleted file mode 100644 index 8841723..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/customize/themeElement.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; -import { Typography } from '@mui/material'; - -type ThemeEntryProps = { - color: string; - text: string; -}; - -const ThemeEntry = (props: ThemeEntryProps) => { - const circleStyle = { - padding: 10, - margin: 20, - backgroundColor: props.color, - borderRadius: '50%', - width: 10, - height: 10, - left: 0, - top: 0, - }; - - return
-
- {props.text} -
; - -}; - -ThemeEntry.displayName = 'ThemeEntry'; - -export { ThemeEntry }; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/denseTable.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/denseTable.tsx deleted file mode 100644 index b2770d5..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/denseTable.tsx +++ /dev/null @@ -1,159 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, MouseEvent } from 'react'; -import Table from '@mui/material/Table'; -import TableBody from '@mui/material/TableBody'; -import TableCell from '@mui/material/TableCell'; -import TableHead from '@mui/material/TableHead'; -import TableRow from '@mui/material/TableRow'; -import Paper from '@mui/material/Paper'; - -import Tooltip from '@mui/material/Tooltip'; -import Button from '@mui/material/Button'; -import makeStyles from '@mui/styles/makeStyles'; - -const useStyles = makeStyles({ - denseTable: { - borderRadius: '0px', - }, - button: { - margin: 0, - padding: '6px 6px', - minWidth: 'unset', - }, -}); - -type DenseTableProps = { - actions?: boolean; - headers: string[]; - height: number; - hover: boolean; - ariaLabelRow: string; - ariaLabelColumn?: string[]; - verticalTable?: boolean; - navigate?(applicationName: string, path?: string): void; - onLinkClick?(id: string): void; data: any[]; - onClick?(id: string): void; -}; - -const DenseTable: FC = (props) => { - const { - ariaLabelRow, - data, - headers, - height, - hover, - ariaLabelColumn, - onClick = () => undefined, - navigate = () => undefined, - verticalTable, - } = props; - - const styles = useStyles(); - - const handleClick = (event: MouseEvent, id: string) => { - event.preventDefault(); - onClick(id); - }; - - return ( - -
- - - - { - headers.map((tableHeader) => ({tableHeader})) - } - - - - {data.map((row, index) => { - - const values = (typeof row === 'string' || row instanceof String) ? [row] : Object.keys(row).map(function (e) { return row[e]; }); - - return ( - handleClick(e, row.name)}> - { - values.map((value, i) => { - if (value !== undefined) { - - if (!verticalTable) { - const ariaLabel = ariaLabelColumn === undefined ? headers[i].toLowerCase() : ariaLabelColumn[i]; - if (ariaLabel.length > 0) { - return {value}; - } else { - return {value}; - } - } else { - // skip adding aria label to 'header' column - if (i === 0) { - return {value}; - } else { - const ariaLabel = props.ariaLabelColumn === undefined ? props.headers[index].toLowerCase() : props.ariaLabelColumn[index]; - return {value}; - } - } - } else - return null; - }) - } - { - props.actions && -
- - - - - - -
-
- } -
); - }) - } -
-
-
-
- ); -}; - -DenseTable.displayName = 'DenseTable'; - -export default DenseTable; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/details.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/details.tsx deleted file mode 100644 index b955789..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/details.tsx +++ /dev/null @@ -1,125 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; - -import makeStyles from '@mui/styles/makeStyles'; -import Breadcrumbs from '@mui/material/Breadcrumbs'; -import LinkComponent from '@mui/material/Link'; -import Paper from '@mui/material/Paper'; -import Typography from '@mui/material/Typography'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { AddToHistoryAction, ClearHistoryAction, SelectElementAction } from '../../actions/detailsAction'; -import { highlightElementAction } from '../../actions/mapActions'; - -import { HistoryEntry } from '../../model/historyEntry'; -import { Link, Site, Service, isService, isSite, isLink } from '../../model/topologyTypes'; - -import detailsUtils from '../../utils/detailsUtils'; - -import LinkDetails from './linkDetails'; -import ServiceDetails from './serviceDetails'; -import SiteDetails from './siteDetails'; - -const useStyles = makeStyles({ - mapDetails: { - background: '#bbbdbf', - padding: '20px', - alignSelf: 'stretch', - flex: '1 1 0', - }, - container: { - marginLeft: '15px', - marginTop: '5px', - }, - message: { - marginTop: '5px', - }, -}); - -const Details: React.FC = () => { - - const data = useSelectApplicationState(state => state.network.details.data); - const breadcrumbs = useSelectApplicationState(state => state.network.details.history); - - const dispatch = useApplicationDispatch(); - const displayElement = (element: Site | Link | Service) => dispatch(new SelectElementAction(element)); - const highlightElementOnMap = (element: Link | Site | Service) => dispatch(highlightElementAction(element)); - const addHistory = (newEntry: HistoryEntry) => dispatch(new AddToHistoryAction(newEntry)); - const clearHistory = () => dispatch(new ClearHistoryAction()); - - const [message, _setMessage] = React.useState('No data selected.'); - - const onLinkClick = async (id: string) => { - detailsUtils.loadData('link', id, (result) => { - displayElement(result); - highlightElementOnMap(result); - addHistory({ id: data!.name, data: data! as any }); - }); - }; - - const backClick = (e: any) => { - displayElement(breadcrumbs[0].data); - highlightElementOnMap(breadcrumbs[0].data); - clearHistory(); - e.preventDefault(); - }; - - const renderDetailPanel = (element: Site | Link | Service) => { - if (isSite(element)) { - return ; - } else if (isService(element)) { - return ; - } else if (isLink(element)) { - return ; - } - return null; - }; - - const panelId = data !== null ? (isSite(data) ? 'site-details-panel' : 'link-details-panel') : 'details-panel'; - - const styles = useStyles(); - - return ( -
- - { breadcrumbs.length > 0 - ? ( - - - {breadcrumbs[0].id} - - - {data?.name} - - - ) - : null - } - { data - ? renderDetailPanel(data) - : {message} - } - -
); -}; - -Details.displayName = 'MapDetails'; - -export default Details; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx deleted file mode 100644 index 4ecfe44..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/linkDetails.tsx +++ /dev/null @@ -1,152 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; - -import { AppBar, Button, Tab, Tabs, TextField, Typography } from '@mui/material'; - -import { useApplicationDispatch } from '../../../../../framework/src/flux/connect'; -import { AddErrorInfoAction } from '../../../../../framework/src/actions/errorActions'; - -import { Link } from '../../model/topologyTypes'; -import { LatLonToDMS } from '../../utils/mapUtils'; -import DenseTable from '../denseTable'; - -type MandatoryParametersLOS = { lat: number | null; lon: number | null; amsl: number | null; antennaHeight: number | null }; - -type LinkProps = { link: Link }; - -const LinkDetails: React.FC = (props) => { - - const dispatch = useApplicationDispatch(); - const showErrorMessage = (message: string) => dispatch(new AddErrorInfoAction({ title: 'Problem', message: message })); - - const [height, setHeight] = React.useState(330); - - const handleResize = () => { - - // table does not adhere to flex-box dimensions, so set height explicit - - const el = document.getElementById('link-details-panel')?.getBoundingClientRect(); - const el2 = document.getElementById('link-site-details')?.getBoundingClientRect(); - - if (el && el2) { - if (props.link?.feature?.properties?.subType === 'microwave') - setHeight(el!.height - el2!.y - 80); - else - setHeight(el!.height - el2!.y + 20); - } - }; - - //on mount - React.useEffect(() => { - handleResize(); - - //window.addEventListener("resize", handleResize); - }, []); - - React.useEffect(() => { - handleResize(); - }, [props.link]); - - const getEmptyProperties = (hint:string, data: any) => { - const entries = Object.entries(data); - const emptyProperties: string[] = entries.filter(propery => propery[1] === null || propery[1] === undefined).map(properties => hint + properties[0]); - return emptyProperties; - }; - - const checkLOSMandatoryParameters = (checkObject: { siteA: MandatoryParametersLOS; siteB: MandatoryParametersLOS }) => { - - const emptyA = getEmptyProperties('SiteA:', checkObject.siteA); - const emptyB = getEmptyProperties('SiteB:', checkObject.siteB); - const emptyValues = [...new Set([...emptyA, ...emptyB])]; - return emptyValues; - }; - - const handleCalculateLinkClick = (e: React.MouseEvent) => { - e.preventDefault(); - - const linkId = props.link.id; - const baseUrl = window.location.pathname.split('#')[0]; - window.open(`${baseUrl}#/microwave/calculateLink/?linkId=${linkId}`); - }; - - const handleLineOfSightClick = (e: React.MouseEvent) => { - e.preventDefault(); - - const siteA = props.link.siteA; - const siteB = props.link.siteB; - - const checkObject = { - siteA: { lat: siteA.lat, lon: siteA.lon, amsl: siteA.amsl, antennaHeight: siteA.antenna?.height }, - siteB: { lat: siteB.lat, lon: siteB.lon, amsl: siteB.amsl, antennaHeight: siteB.antenna?.height }, - }; - - var emptyValues = checkLOSMandatoryParameters(checkObject); - - if (emptyValues.length === 0) { - - let heightPart = `&amslA=${siteA.amsl}&antennaHeightA=${siteA.antenna.height}&amslB=${siteB.amsl}&antennaHeightB=${siteB.antenna.height}`; - const baseUrl = window.location.pathname.split('#')[0]; - window.open(`${baseUrl}#/microwave/lineofsightMap/los?lat1=${siteA.lat}&lon1=${siteA.lon}&lat2=${siteB.lat}&lon2=${siteB.lon}${heightPart}`); - } else { - showErrorMessage('Line of Sight App cannot be opened. Data is missing: ' + emptyValues); - } - }; - - const amslAvailable = props.link.siteA.amsl && props.link.siteB.amsl; - - const data = [ - { name: 'Site Id', val1: props.link.siteA.siteId, val2: props.link.siteB.siteId }, - { name: 'Site Name', val1: props.link.siteA.siteName, val2: props.link.siteB.siteName }, - { name: 'Latitude', val1: LatLonToDMS(props.link.siteA.lat), val2: LatLonToDMS(props.link.siteB.lat) }, - { name: 'Longitude', val1: LatLonToDMS(props.link.siteA.lon, true), val2: LatLonToDMS(props.link.siteB.lon, true) }, - props.link?.feature?.properties?.subType == 'microwave' && amslAvailable !== null && { name: 'Amsl in m', val1: props.link.siteA.amsl, val2: props.link.siteB.amsl }, - props.link?.feature?.properties?.subType == 'microwave' && amslAvailable !== null && props.link.siteA.antenna !== null && { name: 'Antenna height in m', val1: props.link.siteA.antenna.height, val2: props.link.siteB.antenna.height }, - props.link.siteA.azimuth != null && props.link.siteB.azimuth != null && { name: 'Azimuth in °', val1: props.link.siteA.azimuth.toFixed(2), val2: props.link.siteB.azimuth.toFixed(2) }, - ]; - - return (
- - {props.link.id} - { - props.link.name !== null ? - - : null - } - 0 ? props.link.operator : 'unknown'} label="Operator" /> - - - {props.link.polarization ? : null} - - - - - - - - { - props.link?.feature?.properties?.subType === 'microwave' && <> - - - - } -
); -}; - -export default LinkDetails; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/serviceDetails.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/serviceDetails.tsx deleted file mode 100644 index 48a8a37..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/serviceDetails.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; - -import Typography from '@mui/material/Typography/Typography'; -import TextField from '@mui/material/TextField/TextField'; - -import { Service } from '../../model/topologyTypes'; - -type ServiceDetailsProps = { service: Service }; - -const ServiceDetails: React.FC = (props) => { - - return ( -
- {props.service.id} - - - - { - props.service.backupForServiceId && - - } - - - - - -
); -}; - -export default ServiceDetails; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx deleted file mode 100644 index 34d9180..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/details/siteDetails.tsx +++ /dev/null @@ -1,258 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; - -import LanOutlinedIcon from '@mui/icons-material/LanOutlined'; -import { AppBar, Button, IconButton, Tab, Tabs, TextField, Typography } from '@mui/material'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { NavigateToApplication } from '../../../../../framework/src/actions/navigationActions'; -import { requestRest } from '../../../../../framework/src/services/restService'; - -import { CheckDeviceList, InitializeLoadedDevicesAction } from '../../actions/detailsAction'; -import { Address, Device, Site } from '../../model/topologyTypes'; -import StadokSite from '../../model/stadokSite'; -import { LatLonToDMS } from '../../utils/mapUtils'; - -import DenseTable from '../denseTable'; -import StadokDetailsPopup from '../stadok/stadokDetailsPopup'; - -const buildAddress = (address: Address) => { - switch (address.country) { - case 'de': - return `${address.streetAndNr}, ${address.zipCode !== null ? address.zipCode : ''} ${address.city}`; - - case 'us': - return `${address.streetAndNr}, ${address.city} ${address.zipCode !== null ? address.zipCode : ''}`; - - default: - console.log('address formatting for country {' + address.country + '} not recognized, defaulting.'); - return `${address.streetAndNr}, ${address.zipCode !== null ? address.zipCode : ''} ${address.city}`; - } -}; - -type PanelId = 'links' | 'nodes'; -type LinkRow = { name: string; azimuth?: string }; -type DeviceRow = { id: string; type: string; name: string; manufacturer: string; owner: string; status?: string; port: number[] }; - -type SiteDetailProps = { - site: Site; - onLinkClick(id: string): void; -}; - -const SiteDetails: React.FC = (props) => { - - const updatedDevices = useSelectApplicationState(state => state.network.details.checkedDevices); - const isSitedocReachable = useSelectApplicationState(state => state.network.details.isSitedocReachable); - - const dispatch = useApplicationDispatch(); - const initializeDevices = (devices: Device[]) => dispatch(new InitializeLoadedDevicesAction(devices)); - const loadDevices = async (networkElements: Device[]) => dispatch(CheckDeviceList(networkElements)); - const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path, '')); - - const [value, setValue] = React.useState('links'); - const [height, setHeight] = React.useState(330); - const [openPopup, setOpenPopup] = React.useState(false); - const [staSite, setStaSite] = React.useState(null); - - const hasFurtherInfo = props.site.furtherInformation !== null && props.site.furtherInformation.length > 0; - - const handleResize = () => { - //table currently likes to overflow the available area -> force set a height to the container - const el = document.getElementById('site-details-panel')?.getBoundingClientRect(); - const el2 = document.getElementById('site-tabs')?.getBoundingClientRect(); - - if (el && el2) { - if (!hasFurtherInfo) { - setHeight(el!.height - el2!.y - 10); - } else { - setHeight(el!.height - el2!.y - 65); - } - } - }; - - //on mount - React.useEffect(() => { - handleResize(); - window.addEventListener('resize', () => { handleResize(); }); - - return () => { - window.removeEventListener('resize', () => { handleResize(); }); - }; - }, []); - - // on update - React.useEffect(() => { - - if (props.site.devices !== null && props.site.devices.length > 0) { - - //TODO: why two? - initializeDevices(props.site.devices); - loadDevices(props.site.devices); - } - handleResize(); - - }, [props.site]); - - const onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => { - setValue(newValue); - }; - - const getFurtherInformation = (url: string) => { - - const request = requestRest(url, { method: 'GET' }); - request.then(result => { - if (result) { - setStaSite(result); - setOpenPopup(true); - } else { - console.error(result); - } - }); - }; - - const closePopup = () => { - setOpenPopup(false); - }; - - //prepare link table - - let hasAzimuth = false; - const linkRows: LinkRow[] = props.site.links?.map(link => { - if (link.azimuth !== null) { - hasAzimuth = true; - return { name: link.name, azimuth: link.azimuth.toFixed(2) }; - } else { - return { name: link.name ? link.name : link.id.toString() }; - } - }); - - const linkTableHeader = hasAzimuth ? ['Link Name', 'Azimuth in °'] : ['Link Name']; - - //prepare device table - const deviceRows: DeviceRow[] = updatedDevices?.map(device => { - return { - id: device.id, - name: device.name, - type: device.type ? device.type : 'unknown', - status: (device.status?.length == 0 || device.status === undefined || device.status === null) ? 'Not Connected' : device.status, - manufacturer: device.manufacturer, - owner: device.owner, - port: device.port, - }; - }); - - const addressString = props.site.address == null ? null : buildAddress(props.site.address); - - return (
- - {props.site.id} -
- { - const baseUrl = window.location.pathname.split('#')[0]; - const siteId = props.site.id + ''; - const url = `${baseUrl}#/siteManager/treeview/${siteId}`; - window.open(url); - }}> - - -
- - { - props.site.operator !== '' && props.site.operator !== null ? - : - - } - { - props.site?.feature?.properties?.layer !== undefined && props.site?.feature?.properties?.layer.length > 0 && - - } - { - addressString !== null && - - } - { - props.site.heightAmslInMeters !== undefined && props.site.heightAmslInMeters > 0 && - - } - { - props.site.antennaHeightAmslInMeters !== undefined && props.site.antennaHeightAmslInMeters > 0 && - - } - - - - - - - - - { - value === 'links' && - <> - { - props.site.links == null && - No links available. - } - { - props.site.links?.length > 0 && - - } - - } - { - value === 'nodes' && - <> - { - props.site.devices === null && - No nodes available. - } - { - props.site.devices?.length > 0 && updatedDevices !== null && - - } - - } - { - isSitedocReachable && - <> - { - hasFurtherInfo && - - } - - } - { - staSite !== null && openPopup && - } -
- ); -}; - - - -export default SiteDetails; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/connectionInfo.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/connectionInfo.tsx deleted file mode 100644 index e04906d..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/connectionInfo.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; -import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; - -import Paper from '@mui/material/Paper'; -import Typography from '@mui/material/Typography'; -import makeStyles from '@mui/styles/makeStyles'; -import Button from '@mui/material/Button'; - -import { useSelectApplicationState, useApplicationDispatch } from '../../../../../framework/src/flux/connect'; -import { IsTileServerReachableAction, IsTopologyServerReachableAction } from '../../actions/connectivityAction'; - -const useStyles = makeStyles({ - connectionInfo: { - padding: 5, - position: 'absolute', - top: 160, - width: 230, - left: '40%', - zIndex: 1, - }, - container: { - display: 'flex', - flexDirection: 'column', - }, - errorIcon:{ - 'alignSelf': 'center', - marginBottom: 5, - }, -}); - -const ConnectionInfo: React.FC = () => { - - const dispatch = useApplicationDispatch(); - - const isTopoServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable); - const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable); - - const handleClose = () => { - dispatch(new IsTopologyServerReachableAction(true)); - dispatch(new IsTileServerReachableAction(true)); - }; - - const styles = useStyles(); - - return ((!isTopoServerReachable || !isTileServerReachable) ? - -
-
- Connection Error -
- { - !isTileServerReachable - ? Tile data can't be loaded. - : null - } - { - !isTopoServerReachable - ? < Typography variant="body1" aria-label="network-data-unavailable"> Network data can't be loaded. - : null - } - -
-
: null - ); -}; - -ConnectionInfo.displayName = 'ConnectionInfo'; - -export { ConnectionInfo }; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/filterBar.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/filterBar.tsx deleted file mode 100644 index 69cefc8..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/filterBar.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React, { FC, useEffect, useState } from 'react'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import FilterIcon from '@mui/icons-material/FilterList'; -import makeStyles from '@mui/styles/makeStyles'; - -import { SetFilterValueAction } from '../../actions/filterActions'; -import Paper from '@mui/material/Paper'; -import InputBase from '@mui/material/InputBase'; -import Divider from '@mui/material/Divider'; -import IconButton from '@mui/material/IconButton'; - -const useStyles = makeStyles({ - filterBar: { - padding: '2px 4px', - position: 'absolute', - display: 'flex', - alignItems: 'center', - top: 70, - marginLeft: 5, - width: 400, - zIndex: 1, - }, - input: { - flex: 1, - marginLeft: 5, - }, - iconButton: { - padding: 10, - }, - divider: { - height: 28, - margin: 4, - }, -}); - -const FilterBar: FC = () => { - - const filterValue = useSelectApplicationState(state => state.network.filter.value); - - const dispatch = useApplicationDispatch(); - const onFilterChange = (value: string) => dispatch(new SetFilterValueAction(value)); - - const [filterText, setFilterText] = useState(filterValue); - - useEffect(() => { - setFilterText(filterValue); - }, [filterValue]); - - const handleFilterApply = () => { - onFilterChange(filterText); - }; - - const styles = useStyles(); - - return ( - - setFilterText(e.target.value)} - onKeyPress={(e) => { - if (e.key === 'Enter') { - e.preventDefault(); - e.stopPropagation(); - handleFilterApply(); - } - }} - readOnly={false} - /> - - - - - - ); -}; - -FilterBar.displayName = 'FilterBar'; - -export { FilterBar }; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/iconSwitch.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/iconSwitch.tsx deleted file mode 100644 index a74c9ff..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/iconSwitch.tsx +++ /dev/null @@ -1,101 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useEffect } from 'react'; -import { FormControlLabel, Switch } from '@mui/material'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import { SetIconSwitchAction } from '../../actions/mapActions'; -import { updateSettings } from '../../actions/settingsAction'; -import { NetworkMapSettings } from '../../model/settings'; - -type IconSwitchProps = { visible: boolean }; - -const IconSwitch: React.FC = (props) =>{ - - const areIconsEnabled = useSelectApplicationState(state => state.network.map.allowIconSwitch); - const settings = useSelectApplicationState(state => state.network.settings.mapSettings); - - const dispatch = useApplicationDispatch(); - const toggle = (enable:boolean) => dispatch(new SetIconSwitchAction(enable)); - const updateUserSettings = (mapSettings: NetworkMapSettings) => dispatch(updateSettings(mapSettings)); - - //??? TODO: look into please - //use ref to be available within map events - const iconsEnabledRef = React.useRef(areIconsEnabled); - - const setIconsEnabled = (data: boolean) => { - iconsEnabledRef.current = data; - }; - - const handleToggleChanged = () => { - setIconsEnabled(!areIconsEnabled); - toggle(!areIconsEnabled); - }; - - const handleDefaultValue = () => { - const settingsIconsEnabled = settings?.areIconsEnabled; - if (settingsIconsEnabled !== undefined) { - setIconsEnabled(settingsIconsEnabled); - toggle(settingsIconsEnabled); - } - }; - - const saveSettings = (data: any) => { - data.areIconsEnabled = iconsEnabledRef.current; - updateUserSettings(data); - }; - - const saveChanges = () => { - if (settings === null) { - saveSettings({ networkMap:{} }); - } else if (settings && iconsEnabledRef.current !== settings.areIconsEnabled) { - saveSettings(settings); - } - }; - - window.onbeforeunload = () => { //called right before browser refreshes or some such - saveChanges(); - }; - - useEffect(()=>{ - - handleDefaultValue(); - return () => { // executed on unmount - saveChanges(); - }; - }, []); - - useEffect(()=>{ - handleDefaultValue(); - }, [settings?.areIconsEnabled]); - - return ( - props.visible ? - } - label="Show icons" - labelPlacement="end" - /> : null); -}; - -IconSwitch.displayName = 'IconSwitch'; - -export { IconSwitch } ; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/layerSelection.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/layerSelection.tsx deleted file mode 100644 index d00a30d..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/layerSelection.tsx +++ /dev/null @@ -1,123 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { FC } from 'react'; - -import Accordion from '@mui/material/Accordion'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import AccordionDetails from '@mui/material/AccordionDetails'; -import Checkbox from '@mui/material/Checkbox'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import FormGroup from '@mui/material/FormGroup'; -import FormControlLabel from '@mui/material/FormControlLabel'; -import Typography from '@mui/material/Typography'; -import makeStyles from '@mui/styles/makeStyles'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import { loadLayers, OpenLayersAction, updateLayerAsyncAction } from '../../actions/mapActions'; - -const useStyles = makeStyles({ - mapLayer: { - position: 'absolute', - display: 'flex', - flexDirection: 'column', - top: 323, - width: 200, - marginLeft: 5, - zIndex: 1, - }, - title:{ - fontWeight: 'bold', - }, -}); - -const MapLayer : FC = () => { - - const elements = useSelectApplicationState(state => state.network.map.layersContainer.elements); - const isOpen = useSelectApplicationState(state => state.network.map.layersContainer.isOpen); - const areFurtherLayersAvailable = useSelectApplicationState(state => state.network.map.layersContainer.areFurtherLayersAvailable); - - const dispatch = useApplicationDispatch(); - const updateLayer = (name: string, displayed: boolean) => dispatch(updateLayerAsyncAction(name, displayed, true)); - const loadMapLayers = () => dispatch(loadLayers()); - const open = (newOpenState: boolean) => dispatch(new OpenLayersAction(newOpenState)); - - React.useEffect(() => { - loadMapLayers(); - }, []); - - const classes = useStyles(); - return ( - open(!isOpen)} className={classes.mapLayer}> - } - aria-label="map-layer-accordion"> - Layers - - - - { - elements.map((el, i) => el.base - ? { updateLayer(el.name, e.target.checked); }} - /> - } - label={el.name} - /> - : null, - ) - } - - { - areFurtherLayersAvailable - ? ( <> - Further Layers - - { - elements.map((el, i) => !el.base - ? { updateLayer(el.name, e.target.checked); }} - /> - } - label={el.name} - /> - : null, - ) - } - - ) - : null - } - - ); -}; - -MapLayer.displayName = 'MapLayer'; - -export default MapLayer; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/map.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/map.tsx deleted file mode 100644 index 3f66f3e..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/map.tsx +++ /dev/null @@ -1,791 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, memo, useCallback, useEffect, useRef, useState } from 'react'; -import makeStyles from '@mui/styles/makeStyles'; - -import maplibregl from 'maplibre-gl'; -import 'maplibre-gl/dist/maplibre-gl.css'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; -import { handleConnectionChange, IsBusyCheckingConnectivityAction, setTileServerReachableAction, setTopologyServerReachableAction } from '../../actions/connectivityAction'; -import { LoadNetworkElementDetails } from '../../actions/detailsAction'; -import { loadLayers, SetCoordinatesAction, updateStatistics, ZoomToFinishedAction } from '../../actions/mapActions'; -import { OSM_STYLE, URL_API } from '../../config'; -import { BoundingBox } from '../../model/boundingBox'; -import { Coordinate, MapCoordinate } from '../../model/coordinates'; -import { Feature } from '../../model/topologyTypes'; -import { dataService } from '../../services/dataService'; -import { addImages } from '../../services/mapImagesService'; -import mapLayerService from '../../utils/mapLayers'; -import { getUniqueFeatures, increaseBoundingBox } from '../../utils/mapUtils'; -import { ConnectionInfo } from './connectionInfo'; -import { FilterBar } from './filterBar'; -import MapLayer from './layerSelection'; -import MapControl from './mapControl'; -import MapPopup from './mapPopup'; -import SearchBar from './searchBar'; -import Statistics from './statistics'; - -const MAX_ZOOM = 18; -const MIN_ZOOM = 0; - -const LogLevel = +(localStorage.getItem('log.odlux.mapComponent') || 0); - -const NetworkFilterObserver: FC<{ value: string; onDidUpdate: (val: string) => void }> = ({ value, onDidUpdate }) => { - useEffect(() => { - onDidUpdate(value); - }, [value]); - return null; -}; - -type MapSelectionPopup = { - isOpen: boolean; - elements: Feature[]; - type: string; - position: { - left: number; - top: number; - }; -} | null; - -let map: maplibregl.Map; -let lastBoundingBox: maplibregl.LngLatBounds; - -const useStyles = makeStyles({ - map: { - display: 'flex', - position: 'relative', - height: '100%', - }, -}); - -type MapContext = { - furtherLayerNames: string[]; - areLayersLoaded: boolean; - isLoadingInProgress: boolean; - enqueuedBoundingBoxes: maplibregl.LngLatBounds[]; - isInitialLoadOfMap: boolean; -}; - -const Map: FC = memo(() => { - - const mapContext = useRef({ - furtherLayerNames: [], - enqueuedBoundingBoxes: [], - areLayersLoaded: false, - isLoadingInProgress: false, - isInitialLoadOfMap: false, - }); - - const networkFilter = useSelectApplicationState(state => state.network.filter); - const selectedLink = useSelectApplicationState(state => state.network.map.selectedLink); - const selectedSite = useSelectApplicationState(state => state.network.map.selectedSite); - const selectedService = useSelectApplicationState(state => state.network.map.selectedService); - const zoomToElement = useSelectApplicationState(state => state.network.map.zoomToElement); - - const { lat, lon, zoom } = useSelectApplicationState(state => state.network.map.coordinates); - - const isTopologyServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable); - const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable); - const isConnectivityCheckBusy = useSelectApplicationState(state => state.network.connectivity.isBusy); - const showIcons = useSelectApplicationState(state => state.network.map.allowIconSwitch); - const settings = useSelectApplicationState(state => state.network.settings); - const layers = useSelectApplicationState(state => state.network.map.layersContainer.elements); - - const dispatch = useApplicationDispatch(); - - const updateLayers = () => dispatch(loadLayers()); - const loadSelectedElement = (type: string, id: string) => dispatch(LoadNetworkElementDetails(type, id)); - const updateMapPosition = (pLat: string, pLon: string, pZoom: string) => dispatch(new SetCoordinatesAction(pLat, pLon, pZoom)); - const updateMapStatistics = (boundingBox: BoundingBox) => dispatch(updateStatistics(boundingBox)); - const setTileServerLoaded = (reachable: boolean) => dispatch(setTileServerReachableAction(reachable)); - const setTopologyServerLoaded = (reachable: boolean) => dispatch(setTopologyServerReachableAction(reachable)); - const connectionChanged = (newState: boolean) => dispatch(handleConnectionChange(newState)); - const setConnectivityCheck = (done: boolean) => dispatch(new IsBusyCheckingConnectivityAction(done)); - const zoomFinished = () => dispatch(new ZoomToFinishedAction()); - - const mapContainerRef = React.useRef(null); - const mapRef = React.useRef(); - - const [bearing, setBearing] = useState(0); - const [popup, setPopup] = useState(null); - - const updateTheme = () => { - mapLayerService.availableThemes = settings.themes; - if (settings.mapSettings?.styling?.theme) { - mapLayerService.selectedTheme = settings.mapSettings?.styling.theme; - } - }; - - const updateOpacity = () => { - if (settings.mapSettings && settings.mapSettings.tileOpacity) { - mapLayerService.changeMapOpacity(map, Number(settings.mapSettings.tileOpacity)); - } - }; - - const loadGeoJsonAndAddToMapLayer = async (layer: string, url: string) => { - - //No actions used because the geojson data is only used and needed for the map - //maybe move out into another map service - - const response = await dataService.getGeojsonData(url); - - if (response.status === 404 || response.status === 400) { - return true; - } - if (response.status !== 200) { - return false; - } - if (map.getSource(layer)) { - (map.getSource(layer) as maplibregl.GeoJSONSource).setData(response.data); - } - return true; - - }; - - /*** - * Load bounding box data and add it to the map - */ - const loadBBoxDataAndAddToMap = useCallback(async (startLat: number, startLon: number, endLat: number, endLon: number) => { - - if (LogLevel > 3) { - console.log(`MapComponent::loadBBoxDataAndAddToMap - lat: ${startLat}, lon: ${startLon}, lat2: ${endLat}, lon2: ${endLon}, networkFilter: ${networkFilter.value}`); - } - - const servicesLoaded = loadGeoJsonAndAddToMapLayer('services', `${URL_API}/services/geojson/${startLat},${startLon},${endLat},${endLon}?filter=${encodeURIComponent(networkFilter.value)}`); - const linksLoaded = loadGeoJsonAndAddToMapLayer('lines', `${URL_API}/links/geojson/${startLat},${startLon},${endLat},${endLon}?filter=${encodeURIComponent(networkFilter.value)}`); - const sitesLoaded = loadGeoJsonAndAddToMapLayer('points', `${URL_API}/sites/geojson/${startLat},${startLon},${endLat},${endLon}?filter=${encodeURIComponent(networkFilter.value)}`); - - const results = await Promise.all([servicesLoaded, linksLoaded, sitesLoaded]); - - mapContext.current.isLoadingInProgress = false; - - const areGeojsonEndpointsReachable = (results[0] && results[1] && results[2]); - - if (isTopologyServerReachable !== areGeojsonEndpointsReachable) { - connectionChanged(areGeojsonEndpointsReachable); - } - - if (LogLevel > 3) { - console.log(`MapComponent::loadBBoxDataAndAddToMap - loaded data for bbox: ${startLat},${startLon},${endLat},${endLon}`, results); - } - - return results; - }, [networkFilter.value]); - - const loadMapData = async (bbox: maplibregl.LngLatBounds, force = false) => { - - // Todo: (if we get the time) maybe split bounding box into smaller parts to increase loading speed - // currently the entire bbox gets loaded (-> potentially huge load) - - if (LogLevel > 3) { - console.log(`MapComponent::loadMapData - bbox: ${bbox.getNorth()}, ${bbox.getWest()}, ${bbox.getSouth()}, ${bbox.getEast()} : isLoadingInProgress: ${mapContext.current.isLoadingInProgress}`); - } - - try { - if (mapContext.current.isInitialLoadOfMap) { - mapContext.current.isInitialLoadOfMap = false; - - await loadBBoxDataAndAddToMap(lastBoundingBox.getWest(), lastBoundingBox.getSouth(), lastBoundingBox.getEast(), lastBoundingBox.getNorth()); - } else { - if (!mapContext.current.isLoadingInProgress) { // only load data if loading not in progress - mapContext.current.isLoadingInProgress = true; - - // new bbox is bigger than old one - if (bbox.contains(lastBoundingBox.getNorthEast()) && bbox.contains(lastBoundingBox.getSouthWest()) && lastBoundingBox !== bbox) { //if new bb is bigger than old one - - //calculate new boundingBox - const increasedBoundingBox = increaseBoundingBox(map); - lastBoundingBox = bbox; - await loadBBoxDataAndAddToMap(increasedBoundingBox.west, increasedBoundingBox.south, increasedBoundingBox.east, increasedBoundingBox.north); - - } else if (!force && lastBoundingBox.contains(bbox.getNorthEast()) && lastBoundingBox.contains(bbox.getSouthWest())) { // last one contains new one - // bbox is contained in last one, do nothing - mapContext.current.isLoadingInProgress = false; - - } else { // bbox is not fully contained in old one, extend - - lastBoundingBox.extend(bbox); - await loadBBoxDataAndAddToMap(lastBoundingBox.getWest(), lastBoundingBox.getSouth(), lastBoundingBox.getEast(), lastBoundingBox.getNorth()); - } - - mapContext.current.isLoadingInProgress = false; - - if (mapContext.current.enqueuedBoundingBoxes.length > 0) { // load last not loaded bounding box - loadMapData(mapContext.current.enqueuedBoundingBoxes.pop()!); - mapContext.current.enqueuedBoundingBoxes = []; - } - } else { - mapContext.current.enqueuedBoundingBoxes.push(bbox); - } - } - } catch (e) { - mapContext.current.isLoadingInProgress = false; - } - }; - - const isLayerVisible = (layer: string) => { - const layerEl = layers.find(el => el.name === layer); - return layerEl ? layerEl.displayed : false; - }; - - const changeSizeOfPoints = (newSize: number, displaySelectedPoints: boolean, overrideCircleStyle?: true) => { - if (map.getLayer('points') && isLayerVisible('Sites')) { - map.setPaintProperty('points', 'circle-radius', overrideCircleStyle ? newSize : [ 'match', ['get', 'xPonder'], 'true', 9, 7 ]); - } - }; - - const changeSizeOfLines = (newSize: number) => { - map.setPaintProperty('fibre-lines', 'line-width', newSize); - map.setPaintProperty('microwave-lines', 'line-width', newSize); - }; - - const reduceSizeOfFeatures = () => { - changeSizeOfPoints(2, false, true); - if (map.getZoom() <= 4) { - changeSizeOfLines(1); - } else { - changeSizeOfLines(2); - } - }; - - const adjustPointStyle = (mapZoom: number) => { - if (mapZoom > 11) { - changeSizeOfPoints(7, true); - } else if (mapZoom > 10) { - changeSizeOfPoints(5, true); - } else if (mapZoom > 9) { - changeSizeOfPoints(3, true); - } else { - reduceSizeOfFeatures(); - } - }; - - /*** - * Show selection popup if multiple map elements (sites / links / ...) were clicked - */ - const showSelectionPopup = (features: maplibregl.MapGeoJSONFeature[], type: 'site' | 'link', top: number, left: number) => { - const elements: Feature[] = features.map(feature => { - return { - properties: feature.properties as any, - geometry: feature.geometry as any, - type: feature.type, - }; - }); - - setPopup({ isOpen: true, elements: elements, type: type, position: { left: left, top: top } }); - }; - - const loadDetails = (feature: maplibregl.MapGeoJSONFeature[], type: 'site' | 'link', top: number, left: number) => { - if (feature.length > 1) { - showSelectionPopup(feature, type, top, left); - } else { - // load details data - const id = feature[0].properties!.id; - const typeOfFeature = feature[0].properties?.layer || 'site'; - loadSelectedElement(typeOfFeature, id); - } - }; - - const handleResize = () => { - if (map) { - // wait a moment until resizing actually happened - window.setTimeout(() => map.resize(), 500); - } - }; - - const handleMapMove = () => { - const mapZoom = map.getZoom(); - const boundingBox = map.getBounds(); - loadMapData(boundingBox); - adjustPointStyle(mapZoom); - }; - - const handleMapClick = (e: any) => { - const linkLayerNames = mapContext.current.furtherLayerNames.map(layer => layer + '-links'); - const serviceLayerNames = mapContext.current.furtherLayerNames.map(layer => layer + '-services'); - - if (!map.getLayer('point-lamps')) { // data is shown as points - - const clickedLines = getUniqueFeatures(map.queryRenderedFeatures([[e.point.x - 5, e.point.y - 5], - [e.point.x + 5, e.point.y + 5]], { - layers: ['microwave-lines', 'fibre-lines', 'services', 'backup-services', ...linkLayerNames, ...serviceLayerNames], - }), 'id'); - - const clickedSites = getUniqueFeatures(map.queryRenderedFeatures([[e.point.x - 5, e.point.y - 5], - [e.point.x + 5, e.point.y + 5]], { - layers: ['points', ...mapContext.current.furtherLayerNames], - }), 'id'); - - if (clickedSites.length != 0) { - - loadDetails(clickedSites, 'site', e.point.x, e.point.y); - } else if (clickedLines.length != 0) { - loadDetails(clickedLines, 'link', e.point.x, e.point.y); - } - - } else { // data is shown as icons - - const clickedSites = getUniqueFeatures(map.queryRenderedFeatures(e.point, { layers: ['point-lamps', 'point-building', 'point-data-center', 'point-factory', 'points', ...mapContext.current.furtherLayerNames] }), 'id'); - const clickedLines = getUniqueFeatures(map.queryRenderedFeatures([[e.point.x - 5, e.point.y - 5], - [e.point.x + 5, e.point.y + 5]], { - layers: ['microwave-lines', 'fibre-lines', 'services', 'backup-services', ...linkLayerNames, ...serviceLayerNames ], - }), 'id'); - - if (clickedSites.length > 0) - loadDetails(clickedSites, 'site', e.point.x, e.point.y); - else if (clickedLines.length != 0) { - loadDetails(clickedLines, 'link', e.point.x, e.point.y); - } - } - }; - - const handleMapMoveEnd = () => { - - const boundingBox = map.getBounds(); - loadMapData(boundingBox); - - const mapZoom = map.getZoom().toFixed(2); - const mapLat = map.getCenter().lat.toFixed(4); - const mapLon = map.getCenter().lng.toFixed(4); - - if (LogLevel > 3) { - console.log(`MapComponent::map move end - lat: ${mapLat} lon: ${mapLon} zoom: ${mapZoom}`); - } - - if (lat !== mapLat || lon !== mapLon || zoom !== mapZoom) { - updateMapPosition(mapLat, mapLon, mapZoom); - updateMapStatistics(BoundingBox.createFromBoundingBox(map.getBounds())); - } - - //switch icon layers if applicable - mapLayerService.showIconLayers(map, showIcons); - }; - - const getAdditionalLayers = (pMap: maplibregl.Map) => { - - layers.forEach((el) => { - - if (!pMap.getLayer(el.name) && !el.base) { //base layers skipped ("points", "links", ... are added via addCommonLayers) - - mapContext.current.furtherLayerNames.push(el.name); - } - }); - }; - - const isZoomValid = (pZoom: number) => !Number.isNaN(pZoom) && pZoom >= MIN_ZOOM && pZoom <= MAX_ZOOM; - - const areCoordinatesValid = (pLat: number, pLon: number) => { - - const isLatValid = !Number.isNaN(pLat) && pLat >= -90 && pLat <= 90; - const isLonValid = !Number.isNaN(pLon) && pLon >= -180 && pLon <= 180; - - if (isLatValid && isLonValid) { - return true; - } else { - return false; - } - }; - - /** - * Moves map to coordinates and zooms in / out - * @param coordinates lat, lon, zoom - */ - const moveMapToCoordinates = (pMap: maplibregl.Map, coordinates: MapCoordinate) => { - if (LogLevel > 3) { - console.log(`MapComponent::move map to coordinates - lat: ${coordinates.lat}, lon: ${coordinates.lon}, zoom: ${coordinates.zoom}`); - } - - if (areCoordinatesValid(coordinates.lat, coordinates.lon)) { - let newZoom = -1; - - if (isZoomValid(coordinates.zoom)) { - newZoom = coordinates.zoom; - } - - pMap?.flyTo({ - center: [ - coordinates.lon, - coordinates.lat, - ], zoom: newZoom !== -1 ? newZoom : newZoom, - essential: true, - }); - } - }; - - /** - * - * Moves map to include center, start and endpoint of a feature - * - * @param center - * @param start - * @param end - */ - const centerMapOnFeature = (pMap: maplibregl.Map, center: Coordinate | null, start?: Coordinate, end?: Coordinate) => { - - let newBounds = new maplibregl.LngLatBounds(); - const allValues = { center, start, end }; - Object.values(allValues).forEach(value => { - if (value) { - newBounds.extend([value.lon, value.lat]); - } - }); - - //zooms in/out to accommodate bounding box - pMap?.fitBounds(newBounds, { padding: 20 }); - }; - - const updateMapBasedOnLayers = (pMap: maplibregl.Map) => { - - layers.forEach(el => { - - //deactivate / activate layers - - if (el.name == 'Links') { - pMap.setLayoutProperty('fibre-lines', 'visibility', el.displayed ? 'visible' : 'none'); - pMap.setLayoutProperty('microwave-lines', 'visibility', el.displayed ? 'visible' : 'none'); - - } else if (el.name == 'Sites') { - pMap.setLayoutProperty('points', 'visibility', el.displayed ? 'visible' : 'none'); - - if (el.displayed) { - const mapZoom = pMap.getZoom(); - adjustPointStyle(mapZoom); - } - } else if (el.name == 'Services') { - pMap.setLayoutProperty('services', 'visibility', el.displayed ? 'visible' : 'none'); - } else if (pMap.getLayer(el.name)) { - - pMap.setLayoutProperty(el.name, 'visibility', el.displayed ? 'visible' : 'none'); - if (pMap.getLayer(el.name + '-links') && pMap.getLayer(el.name + '-services')) { - - pMap.setLayoutProperty(el.name + '-links', 'visibility', el.displayed ? 'visible' : 'none'); - pMap.setLayoutProperty(el.name + '-services', 'visibility', el.displayed ? 'visible' : 'none'); - } - } - }); - }; - - const rearrangeLayers = (pMap: maplibregl.Map) => { - pMap.moveLayer('services'); - pMap.moveLayer('selectedPoints'); - }; - - const setupMap = () => { - - let initialLat = lat; - let initialLon = lon; - let initialZoom = zoom; - mapContext.current.isInitialLoadOfMap = true; - - if (settings.mapSettings?.startupPosition) { - if (settings.mapSettings.startupPosition.latitude) { - initialLat = settings.mapSettings.startupPosition.latitude; - } - - if (settings.mapSettings.startupPosition.longitude) { - initialLon = settings.mapSettings.startupPosition.longitude; - } - - if (settings.mapSettings.startupPosition.zoom) { - initialZoom = settings.mapSettings.startupPosition.zoom; - } - } - - map = new maplibregl.Map({ - container: mapContainerRef.current!, - style: OSM_STYLE as any, - center: [Number(initialLon), Number(initialLat)], - zoom: Number(initialZoom), - }); - - mapRef.current = map; - - map.on('load', () => { - - if (LogLevel > 3) { - console.log('MapComponent::map loaded'); - } - - map.setMaxZoom(MAX_ZOOM); - const bbox = map.getBounds(); - - if (lastBoundingBox == null) { - lastBoundingBox = bbox; - } - - updateMapPosition(bbox.getCenter().lat.toFixed(4), bbox.getCenter().lng.toFixed(4), map.getZoom().toFixed(2)); - mapLayerService.addBaseSources(map, selectedSite, selectedLink, selectedService); - - //loading icons used in "icon switch" logic - addImages(map, () => { - if (map.getZoom() > 11 && showIcons) { - mapLayerService.addIconLayers(map); - } else { - mapLayerService.addBaseLayers(map); - if (map.getZoom() < 9) { - reduceSizeOfFeatures(); - } - } - updateOpacity(); - if (!mapContext.current.areLayersLoaded) { - mapContext.current.areLayersLoaded = true; - getAdditionalLayers(map); - mapLayerService.addLayersToMap(map, mapContext.current.furtherLayerNames); - rearrangeLayers(map); - } - updateMapBasedOnLayers(map); - }); - - const boundingBox = map.getBounds(); - loadMapData(boundingBox); - updateMapStatistics(BoundingBox.createFromBoundingBox(boundingBox)); - map.on('click', handleMapClick); - map.on('move', handleMapMove); - map.on('moveend', handleMapMoveEnd); - map.on('rotate', (ev) => { - const targetMap = ev.target; - setBearing(targetMap.getBearing()); - }); - }); - }; - - useEffect(() => { - - // resize the map, if menu gets collapsed - window.addEventListener('menu-resized', handleResize); - - //pass themes to mapLayerService - updateTheme(); - - // try if connection to tile + topology server are available - Promise.all([ - dataService.tryReachTileServer(), - dataService.tryReachTopologyServer(), - updateLayers(), - ]).then(([tileServerReachableResult, topologyServerReachableResult]) => { - setTileServerLoaded(tileServerReachableResult); - setTopologyServerLoaded(topologyServerReachableResult); - - //both done - setConnectivityCheck(false); - }); - - return () => { - //unregister events - window.removeEventListener('menu-resized', handleResize); - - if (mapRef.current) { - mapRef.current.off('click', handleMapClick); - mapRef.current.off('moveend', handleMapMoveEnd); - mapRef.current.off('move', handleMapMove); - } - - // will be checked again on next load - setConnectivityCheck(true); - }; - }, []); - - useEffect(() => { - updateTheme(); - }, [settings]); - - // load map - useEffect(() => { - - // if everything done loading/reachable, load map - if (!isConnectivityCheckBusy && isTopologyServerReachable && isTileServerReachable && !settings.isLoadingData) { - - if (mapRef.current === undefined) { - setupMap(); - } else - if (mapRef.current.getContainer() !== mapContainerRef.current) { - // reload map, because the current container (fresh div) doesn't hold the map and changing containers isn't supported - mapRef.current.remove(); - setupMap(); - } - } - return () => { - if (mapRef.current) { - mapRef.current.remove(); - mapRef.current = undefined; - } - }; - }, [isConnectivityCheckBusy, isTopologyServerReachable, isTileServerReachable, settings.isLoadingData]); - - useEffect(() => { - if (!mapRef.current) return; - - if (selectedSite !== null) { - - if (mapRef.current.getSource('selectedPoints')) { - (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] }); - (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [selectedSite] }); - } - - if (mapRef.current.getLayer('point-lamps')) { - - //reset filters (remove earlier 'selected' (bigger) icons) - - mapRef.current.setFilter('point-lamps', ['==', 'type', 'street lamp']); - mapRef.current.setFilter('point-data-center', ['==', 'type', 'data center']); - mapRef.current.setFilter('point-building', ['==', 'type', 'high rise building']); - mapRef.current.setFilter('point-factory', ['==', 'type', 'factory']); - } - } else if (selectedLink !== null) { - if (mapRef.current.getLayer('point-lamps')) { - mapRef.current.setFilter('point-lamps', ['==', 'type', 'street lamp']); - mapRef.current.setFilter('point-data-center', ['==', 'type', 'data center']); - mapRef.current.setFilter('point-building', ['==', 'type', 'high rise building']); - mapRef.current.setFilter('point-factory', ['==', 'type', 'factory']); - } - - if (mapRef.current.getSource('selectedLine')) { - (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] }); - (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [selectedLink] }); - } - } else if (selectedService !== null) { - if (mapRef.current.getLayer('point-lamps')) { - mapRef.current.setFilter('point-lamps', ['==', 'type', 'street lamp']); - mapRef.current.setFilter('point-data-center', ['==', 'type', 'data center']); - mapRef.current.setFilter('point-building', ['==', 'type', 'high rise building']); - mapRef.current.setFilter('point-factory', ['==', 'type', 'factory']); - } - - if (mapRef.current.getSource('selectedLine')) { - (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] }); - (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [selectedService] }); - } - } else if (selectedLink == null && selectedService == null && selectedSite == null) { - //if nothing is selected, remove highlighting (happens after eg changing the details url / element not found) - if (mapRef.current.getSource('selectedLine')) { - (mapRef.current.getSource('selectedPoints') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] }); - (mapRef.current.getSource('selectedLine') as maplibregl.GeoJSONSource).setData({ type: 'FeatureCollection', features: [] }); - } - } - - }, [selectedSite, selectedLink, selectedService]); - - useEffect(() => { - if (!mapRef.current) return; - - if (mapRef.current?.getZoom() > 11) { - mapLayerService.showIconLayers(map, showIcons); - } - }, [showIcons]); - - useEffect(() => { - if (LogLevel > 3) { - console.log(`MapComponent:: store state coordinates changed to: lat: ${lat} lon: ${lon} zoom: ${zoom}`); - } - - if (!mapRef.current) { - return; - } - - const center = mapRef.current.getCenter(); - const isMapAtSamePosition = center.lat.toFixed(4) === lat && center.lng.toFixed(4) === lon && mapRef.current.getZoom().toFixed(2) === zoom; - - if (!isMapAtSamePosition) { - moveMapToCoordinates(mapRef.current, { lat: Number(lat), lon: Number(lon), zoom: Number(zoom) }); - } - - }, [lat, lon, zoom]); - - useEffect(() => { - if (!mapRef.current) return; - - if (zoomToElement) { - centerMapOnFeature(mapRef.current, zoomToElement.center, zoomToElement.start, zoomToElement.end); - mapRef.current.once('zoomend', () => { zoomFinished(); }); - } - }, [zoomToElement]); - - useEffect(() => { - if (!mapRef.current) return; - - if (!mapContext.current.areLayersLoaded) { - mapContext.current.areLayersLoaded = true; - getAdditionalLayers(mapRef.current); - mapLayerService.addLayersToMap(mapRef.current, mapContext.current.furtherLayerNames); - rearrangeLayers(mapRef.current); - } - updateMapBasedOnLayers(mapRef.current); - }, [layers]); - - const handleZoomIn = () => { - if (!map.isZooming()) - map.zoomIn(); - }; - - const handleZoomOut = () => { - if (!map.isZooming()) - map.zoomOut(); - }; - - const handleAlignBearingNorth = () => { - if (!map.isMoving()) - map.resetNorth(); - }; - - const styles = useStyles(); - - if (LogLevel > 3) { - console.log(`MapComponent::render - lat: ${lat}, lon: ${lon}, zoom: ${zoom}, networkFilter: ${networkFilter.value}, showIcons: ${showIcons}`); - } - - return ( - <> - { - if (LogLevel > 3) { - console.log(`MapComponent::render - networkFilter changed to ${networkFilter.value} ${mapRef.current}`); - } - if (!mapRef.current) { - return; - } - const boundingBox = mapRef.current.getBounds(); - loadMapData(boundingBox, true); - }} /> - { - !settings.isLoadingData - ? ( -
- {(popup && popup.isOpen) - ? ( { setPopup(null); }} />) - : null - } - - - - - - -
- ) - : ( -
- ) - } - - ); -}); - -Map.displayName = 'Map'; - -export { Map }; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/mapControl.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/mapControl.tsx deleted file mode 100644 index 49d0b83..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/mapControl.tsx +++ /dev/null @@ -1,116 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import { makeStyles } from '@mui/styles'; -import Paper from '@mui/material/Paper/Paper'; -import IconButton from '@mui/material/IconButton/IconButton'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faCompass, faMinus, faPlus } from '@fortawesome/free-solid-svg-icons'; - -type MapControlProps = { - onZoomIn(): void; - onZoomOut(): void; - onAlignNorth(): void; - bearing: number; - align?: AllowedAlignment; -}; - -type AllowedAlignment = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; - -const useStyles = makeStyles({ - mapControl: { - zIndex: 2, - borderRadius: 4, - display: 'flex', - flexDirection: 'column', - position: 'absolute', - }, - mapControlButton: { - borderRadius: 0, - height: 29, - width: 29, - }, - zoomIcon: { - color: 'black', - height: '15px', - }, - biggerZoomIcon: { - color: 'black', - height: '17px', - }, - borderBottom: { - borderBottom: '1px solid lightgray', - }, -}); - -// created because normal zoom controls caused error (see: https://git-highstreet-technologies.com/highstreet/odlux/-/issues/367) - -const MapControl: FC = (props) => { - - const getAlignment = (align: AllowedAlignment | undefined) => { - const defaultCss = { top: 0, right: 0, margin: '10px 10px 0 0' }; - - if (!align) { - return defaultCss; - } - - let alignment: React.CSSProperties; - - switch (align) { - case 'top-right': - alignment = defaultCss; - break; - case 'top-left': - alignment = { top: 0, left: 0, margin: '10px 0 0 10px' }; - break; - case 'bottom-right': - alignment = { bottom: 0, right: 0, margin: '0 10px 45px 0' }; - break; - case 'bottom-left': - alignment = { bottom: 0, left: 0, margin: '0 0 10px 10px' }; - break; - } - - return alignment; - }; - - const positioning = getAlignment(props.align); - const bearing = props.bearing - 44; //align icon towards north - - const classes = useStyles(); - return ( - - - - - - - - - - - - ); -}; - -MapControl.displayName = 'MapControl'; - -export default MapControl; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/mapPopup.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/mapPopup.tsx deleted file mode 100644 index d7028f2..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/mapPopup.tsx +++ /dev/null @@ -1,81 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, useState } from 'react'; - -import Paper from '@mui/material/Paper'; -import Popover from '@mui/material/Popover'; -import Select from '@mui/material/Select'; -import Typography from '@mui/material/Typography'; - -import { useApplicationDispatch } from '../../../../../framework/src/flux/connect'; - -import { LoadNetworkElementDetails } from '../../actions/detailsAction'; -import { Feature } from '../../model/topologyTypes'; - -type MapPopupProps = { - elements: Feature[]; - type: string; - position: { left: number; top: number }; - onClose(): void; -}; - -const MapPopup: FC = (props) => { - const { type, position, elements, onClose } = props; - - const dispatch = useApplicationDispatch(); - - const [value, setValue] = useState(''); - - const handleElementSelected = (event: any) => { - setValue(event.target.value); - const element = elements[event.target.value]; - const typeOfFeature = element?.properties?.layer || 'site'; - const id = element.properties.id; - dispatch(LoadNetworkElementDetails(typeOfFeature, String(id))); - onClose(); - }; - - return ( - - - {`Multiple ${type}s were selected`} - Please select one. - - - - ); -}; - -MapPopup.displayName = 'MapPopup'; - -export default MapPopup; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/searchBar.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/searchBar.tsx deleted file mode 100644 index d9692f6..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/searchBar.tsx +++ /dev/null @@ -1,192 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import SearchIcon from '@mui/icons-material/Search'; -import Divider from '@mui/material/Divider/Divider'; -import IconButton from '@mui/material/IconButton/IconButton'; -import Paper from '@mui/material/Paper/Paper'; -import makeStyles from '@mui/styles/makeStyles'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import { Coordinate } from '../../model/coordinates'; -import { Link, Site, Service, isLink, isService, isSite } from '../../model/topologyTypes'; -import { SearchResult } from '../../model/searchResult'; - -import { SelectElementAction } from '../../actions/detailsAction'; -import { highlightElementAction, ZoomToSearchResultAction } from '../../actions/mapActions'; -import { SetSearchValueAction } from '../../actions/searchAction'; - -import { dataService } from '../../services/dataService'; -import { calculateMidPoint } from '../../utils/mapUtils'; - -import SearchResultDisplay from './searchResultDisplay'; -import InputBase from '@mui/material/InputBase/InputBase'; -import Popover from '@mui/material/Popover/Popover'; -import Typography from '@mui/material/Typography/Typography'; - -const useStyles = makeStyles({ - searchBar: { - padding: '2px 4px', - position: 'absolute', - display: 'flex', - alignItems: 'center', - top: 15, - marginLeft: 5, - width: 400, - zIndex: 1, - }, - input: { - flex: 1, - marginLeft: 5, - }, - iconButton: { - padding: 10, - }, - divider: { - height: 28, - margin: 4, - }, -}); - - -const SearchBar: FC = () => { - - const defaultSearchResult = { links: [], sites: [], services: [] }; - - const searchTerm = useSelectApplicationState(state => state.network.search.value); - const isTopoServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable); - const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable); - - const dispatch = useApplicationDispatch(); - const selectElement = (site: Site | Link | Service) => dispatch(new SelectElementAction(site)); - const highlightElement = (data: Link | Site | Service) => dispatch(highlightElementAction(data)); - const setSearchTerm = (value: string) => dispatch(new SetSearchValueAction(value)); - const zoomToSearchResult = (center: Coordinate, start?: Coordinate, end?: Coordinate) => dispatch(new ZoomToSearchResultAction(center, start, end)); - - const [anchorEl, setAnchorEl] = React.useState(null); - const [errorMessage, setErrorMessage] = React.useState(''); - const [searchResult, setSearchResults] = React.useState(defaultSearchResult); - - const divRef: any = React.useRef(); - - const handleSearchButtonClick = (e: any) => { - - setAnchorEl(null); - if (searchTerm.length > 0) { - - const result = dataService.search(searchTerm); - result.then((data: SearchResult) => { - - if ((data.links == null || data.links.length == 0) && (data.sites == null || data.sites.length == 0) && (data.services == null || data.services.length == 0)) { - setAnchorEl(divRef.current); - setSearchResults(defaultSearchResult); - setErrorMessage('No element found.'); - // hide message after 3 sec - window.setTimeout(() => { setAnchorEl(null); }, 3000); - } else { - setAnchorEl(divRef.current); - setErrorMessage(''); - setSearchResults(data); - } - }); - - e.preventDefault(); - } - }; - - const onSearchResultClick = (result: Site | Link | Service) => { - - selectElement(result); - highlightElement(result); - - if (isSite(result)) { - - const center = { lat: result.location.lat, lon: result.location.lon }; - zoomToSearchResult(center); - - } else if (isLink(result)) { - - const midPoint = calculateMidPoint(result.siteA.lat, result.siteA.lon, result.siteB.lat, result.siteB.lon); - const startPoint = { lat: result.siteA.lat, lon: result.siteA.lon }; - const endPoint = { lat: result.siteB.lat, lon: result.siteB.lon }; - - zoomToSearchResult(midPoint, startPoint, endPoint); - } else if (isService(result)) { - - const midPoint = calculateMidPoint(result.route[0].lat, result.route[0].lon, result.route[result.route.length - 1].lat, result.route[result.route.length - 1].lon); - const startPoint = { lat: result.route[0].lat, lon: result.route[0].lon }; - const endPoint = { lat: result.route[result.route.length - 1].lat, lon: result.route[result.route.length - 1].lon }; - - zoomToSearchResult(midPoint, startPoint, endPoint); - } - setAnchorEl(null); - }; - - const dataFound = searchResult.links && searchResult.links.length > 0 || searchResult.sites && searchResult.sites.length > 0 || searchResult.services && searchResult.services.length > 0; - const reachable = isTopoServerReachable && isTileServerReachable; - const open = Boolean(anchorEl); - - const styles = useStyles(); - return ( - <> - - setSearchTerm(e.currentTarget.value)} - /> - - - - - - setAnchorEl(null)} anchorEl={anchorEl} anchorOrigin={{ - vertical: 'bottom', - horizontal: 'left', - }}> - - { - errorMessage - ? {errorMessage} - : null - } - { - dataFound - ? < SearchResultDisplay searchResult={searchResult} onResultClick={onSearchResultClick} /> - : null - } - - - - ); -}; - -SearchBar.displayName = 'SearchBar'; - -export default SearchBar; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/searchResultDisplay.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/searchResultDisplay.tsx deleted file mode 100644 index 0932519..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/searchResultDisplay.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; - -import Typography from '@mui/material/Typography'; - -import { Link, Site, Service, isLink } from '../../model/topologyTypes'; -import { SearchResult } from '../../model/searchResult'; - -type SearchResultElement = Link | Service | Site; - -const createSearchDisplay = (elements: SearchResultElement[], title: string, onResultClick: (element: SearchResultElement) => void) => ( - - elements && elements.length > 0 - ? ( - <> - Found {title} -
- {elements.map((element, i) => { - // type specific info - const linkMessage = isLink(element) - ? element.polarization - : ''; - return ( - onResultClick(element)} - style={{ marginLeft: '5px', cursor: 'pointer' }} - variant="body1"> - {element.id} - {element.name ?? ''} {linkMessage} {element.feature?.properties?.layer} - - ); - })} -
- - ) : null -); - -type SearchResultDisplayProps = { - searchResult: SearchResult; - onResultClick: (element: SearchResultElement) => void; -}; - -const SearchResultDisplay: FC = (props) => { - const { searchResult, onResultClick } = props; - - const displays = Object.keys(searchResult).map((el) => { - const elements = (searchResult as any)[el]; - return createSearchDisplay(elements, el, onResultClick); - }); - - return <>{displays}; -}; - -SearchResultDisplay.displayName = 'SearchResultDisplay'; - -export default SearchResultDisplay; - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/statistics.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/statistics.tsx deleted file mode 100644 index 02cd3ce..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/map/statistics.tsx +++ /dev/null @@ -1,69 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC } from 'react'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../../framework/src/flux/connect'; - -import Accordion from '@mui/material/Accordion'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import AccordionDetails from '@mui/material/AccordionDetails'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import InfoIcon from '@mui/icons-material/Info'; -import Tooltip from '@mui/material/Tooltip'; -import Typography from '@mui/material/Typography'; - -import { OpenStatisticsAction } from '../../actions/mapActions'; - -const Statistics: FC = () => { - - const linkCount = useSelectApplicationState(state => state.network.map.statistics.links); - const siteCount = useSelectApplicationState(state => state.network.map.statistics.sites); - const serviceCount = useSelectApplicationState(state => state.network.map.statistics.services); - const isOpen = useSelectApplicationState(state => state.network.map.statistics.isOpen); - const isTopoServerReachable = useSelectApplicationState(state => state.network.connectivity.isTopologyServerAvailable); - const isTileServerReachable = useSelectApplicationState(state => state.network.connectivity.isTileServerAvailable); - - const dispatch = useApplicationDispatch(); - const openStatistics = (open: boolean) => dispatch(new OpenStatisticsAction(open)); - - const reachable = isTopoServerReachable && isTileServerReachable; - - return ( - openStatistics(!isOpen)} style={{ position: 'absolute', display: 'flex', flexDirection: 'column', top: 140, width: 200, marginLeft: 5, zIndex: 1 }}> - } - aria-label="statistics-accordion"> -
- Statistics - - - -
-
- - Sites: {siteCount} - Links: {linkCount} - Services: {serviceCount} - -
- ); -}; - -Statistics.displayName = 'Statistics'; - -export default Statistics; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/stadok/stadokDetailsPopup.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/stadok/stadokDetailsPopup.tsx deleted file mode 100644 index 8b5ad92..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/components/stadok/stadokDetailsPopup.tsx +++ /dev/null @@ -1,314 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, SyntheticEvent, useEffect, useState } from 'react'; - -import MuiDialogTitle from '@mui/material/DialogTitle'; -import { AppBar, Button, Dialog, DialogContent, IconButton, Tab, Tabs, TextField, Typography } from '@mui/material'; -import CloseIcon from '@mui/icons-material/Close'; -import { Theme } from '@mui/material/styles'; -import withStyles from '@mui/styles/withStyles'; -import createStyles from '@mui/styles/createStyles'; -import makeStyles from '@mui/styles/makeStyles'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faFileAlt } from '@fortawesome/free-solid-svg-icons'; - -import StadokSite from '../../model/stadokSite'; -import { LatLonToDMS } from '../../utils/mapUtils'; -import DenseTable from '../../components/denseTable'; -import { requestRest } from '../../../../../framework/src/services/restService'; -import { OrderToDisplay, StadokOrder } from '../../model/stadokOrder'; -import { SITEDOC_URL } from '../../config'; - -const stadokImage = (siteId: string, imageName: string, className: string) => { - const url = `${SITEDOC_URL}/site/${siteId}/files/${imageName}`; - return window.open(url)} />; -}; - -const styles = (theme: Theme) => createStyles({ - root: { - margin: 0, - padding: theme.spacing(2), - }, - closeButton: { - position: 'absolute', - right: theme.spacing(1), - top: theme.spacing(1), - color: theme.palette.grey[500], - }, -}); - -const useStyles = makeStyles({ - largeImage:{ cursor:'pointer', width:300 }, - smallImage:{ cursor:'pointer', width: 50, marginTop:'10px', marginLeft:'10px' }, -}); - -const DialogTitle = withStyles(styles)((props: any) => { - const { children, classes, onClose, ...other } = props; - return ( - - {children} - {onClose ? ( - - - - ) : null} - - ); -}); - -type StadokDetailsProps = { site: StadokSite; siteId: number; onClose(): void }; - -const StadokDetailsPopup: FC = (props) => { - - const [currentTab, setCurrentTab] = useState('devices'); - const [orders, setOrders] = useState(null); - const [displayReport, setDisplayReport] = useState(false); - - // TODO: change and use stadok site report once api is changed - const reportUrl = `${SITEDOC_URL}/site/${props.site.id}/files/${props.siteId}-report.xml`; - const ordersUrl = `${SITEDOC_URL}/site/${props.site.id}/orders`; - - const classes = useStyles(); - - useEffect(() => { - - requestRest(ordersUrl, { method: 'GET' }).then(result =>{ - if (result) { - const orderList = result.map(order =>{ - return OrderToDisplay.parse(order); - }); - setOrders(orderList); - - } else { - setOrders([]); - } - }); - - requestRest(reportUrl).then(res =>{ - if (res) { - setDisplayReport(true); - } - }); - - }, []); - - - const getContacts = (site: StadokSite) =>{ - const contacts = []; - - if (site.createdBy) { - contacts.push({ h: 'Site Creator', col1: site.createdBy.firstName, col2: site.createdBy.lastName, col3: site.createdBy.email, col4: site.createdBy.telephoneNumber }); - } - - if (site.contacts?.manager) { - contacts.push({ h: 'Manager', col1: site.contacts.manager.firstName, col2: site.contacts.manager.lastName, col3: site.contacts.manager.email, col4: site.contacts.manager.telephoneNumber }); - } - - if (site.contacts?.owner) { - contacts.push({ h: 'Owner', col1: site.contacts.owner.firstName, col2: site.contacts.owner.lastName, col3: site.contacts.owner.email, col4: site.contacts.owner.telephoneNumber }); - } - return contacts; - }; - - const onClose = () =>{ - // setOpen(false); - props.onClose(); - }; - - //todo: use a set 'panelId' -> which values are allowed - const handleTabChange = (event: SyntheticEvent, newValue: string) => { - setCurrentTab(newValue); - }; - const contacts = getContacts(props.site); - - const createOrderInfo = () => { - - if (orders == null) { - return (
- - Loading orders - -
); - } else if (orders.length === 0) { - return (
- - No orders available - -
); - } else { - return ; - } - }; - - const displayImages = () => { - if (props.site.images.length === 1) { - return stadokImage(props.site.id, props.site.images[0], classes.largeImage); - } else { - return <> - { - stadokImage(props.site.id, props.site.images[0], classes.largeImage) - } -
- - { - props.site.images.length <= 5 ? - props.site.images.slice(1, props.site.images.length).map(image => - stadokImage(props.site.id, image, classes.smallImage), - ) - : - <> - { - props.site.images.slice(1, 5).map(image => - stadokImage(props.site.id, image, classes.smallImage), - ) - } - - } -
- ; - } - }; - - return ( - - - {props.site.id} - - -
-
- - - { - props.site.type != null && props.site.type.length > 0 && - - } - - - - - - - - - - - - - - - { - currentTab == 'devices' && (props.site.devices?.length > 0 ? - - : -
- - No devices available - -
) - } - { - currentTab == 'contacts' && (contacts.length > 0 ? - - : -
- - No contacts available - -
) - } - { - currentTab == 'safetyInfo' && (props.site?.safetyNotices?.length > 0 - ? ( - - ) - : ( -
- - No safety notices applicable - -
- )) - } - { - currentTab == 'logs' && (props.site?.logs?.length > 0 - ? ( - - ) - : ( -
- - No activity log available - -
- ) - ) - } - - { - currentTab === 'orders' && createOrderInfo() - } -
-
- { - props.site?.images?.length > 0 - ? displayImages() - : ( - - No images available - - ) - } - { - displayReport && -
- - TSS Report -
- } - -
-
-
-
- ); - -}; - -export default StadokDetailsPopup; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/config.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/config.ts deleted file mode 100644 index 6961c1b..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/config.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const URL_API = '/topology/network'; -export const SITEDOC_URL = '/sitedoc'; -export const URL_TILE_API = '/tiles'; -export const URL_BASEPATH = 'network'; - -export const TERRAIN_URL = '/terrain'; //http://10.20.11.249:5200 maybe? /terrain -export const TILE_URL = '/tiles'; //http://tile.openstreetmap.org /tiles - -export const ELECTROMAGNETC_FIELD = '/electromagnetic-field/'; -export const ANTENNA_MAP = '/electromagnetic-field/'; - -export const OSM_STYLE = { - 'version': 8, - 'sources': { - 'raster-tiles': { - 'type': 'raster', - 'tiles': [ - TILE_URL + '/{z}/{x}/{y}.png', - ], - 'tileSize': 256, - 'attribution': '© OpenStreetMap contributors', - }, - 'signal-level': { - 'type': 'raster', - 'tiles': [ - ELECTROMAGNETC_FIELD + '?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=layers=campusos%3Abest_server_test', - ], - 'tileSize': 256, - }, - 'antenna-map': { - 'type': 'raster', - 'tiles': [ - ELECTROMAGNETC_FIELD + '?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=layers=campusos%3Asector_markers', - ], - 'tileSize': 256, - }, - }, - 'layers': [ - { - 'id': 'osm-map', - 'type': 'raster', - 'source': 'raster-tiles', - 'minZoom': 0, - 'maxZoom': 18, - }, - { - 'id': 'signal level', - 'type': 'raster', - 'source': 'signal-level', - 'minZoom': 0, - 'maxZoom': 18, - 'background-opacity': 1, - 'layout': { - 'visibility': 'none', - }, - }, - { - 'id': 'antenna map', - 'type': 'raster', - 'source': 'antenna-map', - 'minZoom': 0, - 'maxZoom': 18, - 'background-opacity': 1, - 'layout': { - 'visibility': 'none', - }, - }, - ], -}; - - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/connectivityHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/connectivityHandler.ts deleted file mode 100644 index 6a0c530..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/connectivityHandler.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { IsTopologyServerReachableAction, IsTileServerReachableAction, IsBusyCheckingConnectivityAction } from '../actions/connectivityAction'; - -export type connectivityState = { - isTopologyServerAvailable: boolean; - isTileServerAvailable: boolean; - isBusy: boolean; -}; - -const initialState: connectivityState = { - isTopologyServerAvailable: true, - isTileServerAvailable: true, - isBusy: true, -}; - -export const ConnectivityHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof IsTopologyServerReachableAction) { - state = { ...state, isTopologyServerAvailable: action.reachable }; - } else if (action instanceof IsTileServerReachableAction) { - state = { ...state, isTileServerAvailable: action.reachable }; - } else if (action instanceof IsBusyCheckingConnectivityAction) { - state = { ...state, isBusy: action.isBusy }; - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/detailsHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/detailsHandler.ts deleted file mode 100644 index fa5b301..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/detailsHandler.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { HistoryEntry } from '../model/historyEntry'; -import { Link, Site, Device, Service } from '../model/topologyTypes'; - -import { - AddToHistoryAction, - ClearHistoryAction, - IsBusyCheckingDeviceListAction, - FinishedLoadingDeviceListAction, - ClearLoadedDevicesAction, - ClearDetailsAction, - InitializeLoadedDevicesAction, - IsSitedocReachableAction, - SelectElementAction, -} from '../actions/detailsAction'; - -export type DetailsStoreState = { - data: Site | Link | Service | null; - history: HistoryEntry[]; - isBusyCheckingDeviceList: boolean; - checkedDevices: Device[]; - isSitedocReachable: boolean; -}; - -const initialState: DetailsStoreState = { - data: null, - history: [], - isBusyCheckingDeviceList: false, - checkedDevices: [], - isSitedocReachable: false, -}; - -export const DetailsHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof SelectElementAction) { - state = { ...state, data: action.data }; - } else if (action instanceof ClearDetailsAction) { - state = { ...state, data: null }; - } else if (action instanceof AddToHistoryAction) { - state = { ...state, history: [...state.history, action.entry] }; - } else if (action instanceof ClearHistoryAction) { - state = { ...state, history: [] }; - } else if (action instanceof IsBusyCheckingDeviceListAction) { - state = { ...state, isBusyCheckingDeviceList: action.isBusy }; - } else if (action instanceof FinishedLoadingDeviceListAction) { - state = { ...state, checkedDevices: action.devices }; - } else if (action instanceof ClearLoadedDevicesAction) { - state = { ...state, checkedDevices: [] }; - } else if (action instanceof InitializeLoadedDevicesAction) { - state = { ...state, checkedDevices: action.devices }; - } else if (action instanceof IsSitedocReachableAction) { - state = { ...state, isSitedocReachable: action.isReachable }; - } - return state; -}; - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/filterHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/filterHandler.ts deleted file mode 100644 index 6b196ed..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/filterHandler.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { SetFilterValueAction } from '../actions/filterActions'; - -export type FilterState = { - value: string; -}; - -const initialState: FilterState = { - value: '', -}; - -export const FilterHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof SetFilterValueAction) { - state = { - ...state, - value: action.value, - }; - } - - return state; -}; - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/mapHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/mapHandler.ts deleted file mode 100644 index e81e5d4..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/mapHandler.ts +++ /dev/null @@ -1,326 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { createHashHistory } from 'history'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { MiddlewareArg } from '../../../../framework/src/flux/middleware'; -import { Action, IActionHandler } from '../../../../framework/src/flux/action'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { SelectElementAction } from '../actions/detailsAction'; - -import { - HighlightLinkAction, - HighlightSiteAction, - ZoomToSearchResultAction, - AddAlarmAction, - SetCoordinatesAction, - SetStatistics, - SetIconSwitchAction, - RemoveHighlightingAction, - ZoomToFinishedAction, - LayerChangedAction, - LayersLoadedAction, - HighlightServiceAction, - OpenLayersAction, - OpenStatisticsAction, - UpdateLayersVisibilityAction, -} from '../actions/mapActions'; - -import { Coordinate } from '../model/coordinates'; -import { Site, Link, Service, Feature, DetailsTypes, isService, isSite } from '../model/topologyTypes'; - -import { URL_BASEPATH, OSM_STYLE } from '../config'; - -const LogLevel = +(localStorage.getItem('log.odlux.networkMap.mapHandler') || 0); - -export type LayerItem = { name: string; displayed: boolean; base?: true }; - -export type MapState = { - selectedLink: Feature | null; - selectedSite: Feature | null; - selectedService: Feature | null; - zoomToElement: { - center: Coordinate | null; - start: Coordinate | undefined; - end: Coordinate | undefined; - zoom: number | undefined; - } | null; - alarmElement: Feature | null; - coordinates: { - lat: string; - lon: string; - zoom: string; - }; - statistics: { - links: string; - sites: string; - services: string; - isOpen: boolean; - }; - allowIconSwitch: boolean; - layersContainer: { - isOpen: boolean; - areFurtherLayersAvailable: boolean; - elements: LayerItem[]; - - }; -}; - -const initialState: MapState = { - selectedLink: null, - selectedSite: null, - selectedService: null, - zoomToElement: null, - alarmElement: null, - coordinates: { - lat: '52.5095', - lon: '13.3290', - zoom: '10', - }, - statistics: { - links: 'Not counted yet.', - sites: 'Not counted yet.', - services: 'Not counted yet.', - isOpen: true, - }, - allowIconSwitch: true, - layersContainer: { - isOpen: false, - areFurtherLayersAvailable: false, - elements: [ - ...OSM_STYLE.layers.map(layer => ({ name: layer.id, displayed: !layer?.layout?.visibility || layer?.layout?.visibility !== 'none', base: true }) as LayerItem), - { name: 'Sites', displayed: true, base: true }, - { name: 'Links', displayed: true, base: true }, - { name: 'Services', displayed: true, base: true }, - ], - }, -}; - -export const MapHandler: IActionHandler = (state = initialState, action: any) => { - if (action instanceof HighlightLinkAction) { - state = { - ...state, - selectedSite: null, - selectedService: null, - selectedLink: action.link.feature, - }; - } else if (action instanceof HighlightSiteAction) { - state = { - ...state, - selectedLink: null, - selectedService: null, - selectedSite: action.site.feature, - }; - } else if (action instanceof HighlightServiceAction) { - state = { - ...state, - selectedLink: null, - selectedSite: null, - selectedService: action.service.feature, - }; - } else if (action instanceof ZoomToSearchResultAction) { - state = { - ...state, - zoomToElement: { - center: action.center, - start: action.start, - end: action.end, - zoom: action.zoom, - }, - }; - } else if (action instanceof ZoomToFinishedAction) { - state = { - ...state, - zoomToElement: null, - }; - } else if (action instanceof AddAlarmAction) { - state = { - ...state, - alarmElement: action.site.feature, - }; - } else if (action instanceof SetCoordinatesAction) { - state = { - ...state, - coordinates: { - lat: action.lat, - lon: action.lon, - zoom: action.zoom, - }, - }; - } else if (action instanceof SetStatistics) { - state = { - ...state, - statistics: { - sites: action.siteCount, - links: action.linkCount, - services: action.serviceCount, - isOpen: state.statistics.isOpen, - }, - }; - } else if (action instanceof SetIconSwitchAction) { - state = { - ...state, - allowIconSwitch: action.enable, - }; - } else if (action instanceof RemoveHighlightingAction) { - state = { - ...state, - selectedLink: null, - selectedSite: null, - selectedService: null, - }; - } else if (action instanceof UpdateLayersVisibilityAction) { - const newData = state.layersContainer.elements.map(el => (el.name in action.layerVisibility ? { ...el, displayed: action.layerVisibility[el.name] } : el)); - state = { - ...state, - layersContainer: { - ...state.layersContainer, - elements: newData, - }, - }; - } else if (action instanceof LayerChangedAction) { - const newData = state.layersContainer.elements.map(el => (el.name === action.layerName ? { ...el, displayed: action.displayed } : el)); - state = { - ...state, - layersContainer: { - ...state.layersContainer, - elements: newData, - }, - }; - } else if (action instanceof LayersLoadedAction) { - const data = state.layersContainer; - const els: LayerItem[] = action.layers.map((e) => { return { name: e, displayed: false }; }); - data.elements.push(...els); - if (els.length > 0) { - data.areFurtherLayersAvailable = true; - } - state = { - ...state, - layersContainer: data, - }; - } else if (action instanceof OpenLayersAction) { - const data = state.layersContainer; - data.isOpen = action.open; - state = { - ...state, - layersContainer: data, - }; - } else if (action instanceof OpenStatisticsAction) { - const data = state.statistics; - data.isOpen = action.open; - state = { - ...state, - statistics: data, - }; - } - - return state; -}; - -const history = createHashHistory(); - -const getDetailIdentifier = (data: Link | Site | Service) => { - - if (isService(data)) { - return DetailsTypes.service; - } else if (isSite(data)) { - return DetailsTypes.site; - } else { - return DetailsTypes.link; - } -}; - -const getDetailsParameter = (data: Link | Site | Service | null) => { - let details = ''; - if (data) { - switch (getDetailIdentifier(data)) { - case DetailsTypes.link: - details = `linkId=${data.id}`; - break; - case DetailsTypes.site: - details = `siteId=${data.id}`; - break; - case DetailsTypes.service: - details = `serviceId=${data.id}`; - break; - } - } - return details; -}; - -const getCoordinatesParameter = (lat: string, lon: string, zoom: string) => { - const centerParam = lat && lat ? `center=${lat},${lon}` : ''; - const zoomParam = zoom ? `zoom=${zoom}` : ''; - return [centerParam, zoomParam].filter(e => e).join('&'); -}; - -export const MapMiddleware = (store: MiddlewareArg) => (next: Dispatch) => (action: A) => { - if (action instanceof SetCoordinatesAction) { - - const { - framework: { - navigationState, - }, - network: { - details: { - data, - }, - }, - } = store.getState(); - - const detailsParam = getDetailsParameter(data); - const coordinatesParam = getCoordinatesParameter(action.lat, action.lon, action.zoom); - const url = `/${URL_BASEPATH}?${[coordinatesParam, detailsParam].filter(e => e).join('&')}`; - if (navigationState.pathname !== url) { - history.replace(url); - } - - if (LogLevel > 3) { - console.log(`MapMiddleware::SetCoordinatesAction - lat: ${action.lat} lon: ${action.lon} zoom: ${action.zoom} data: ${data}`); - } - - } else if (action instanceof SelectElementAction) { - const { - framework: { - navigationState, - }, - network: { - map: { - coordinates, - }, - }, - } = store.getState(); - - - const detailsParam = getDetailsParameter(action.data); - const coordinatesParam = getCoordinatesParameter(coordinates.lat, coordinates.lon, coordinates.zoom); - const url = `/${URL_BASEPATH}?${[coordinatesParam, detailsParam].filter(e => e).join('&')}`; - - if (navigationState.pathname !== url) { - window.setTimeout(() => history.replace(url)); - } - - if (LogLevel > 3) { - console.log(`MapMiddleware::SelectElementAction - ne: ${action.data?.feature?.properties?.layer || 'side'} id: ${action.data.id} name: ${action.data.name} coordinates: ${coordinates.lat} ${coordinates.lon} ${coordinates.zoom}`); - } - } - // let all actions pass - return next(action); -}; - - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/rootHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/rootHandler.ts deleted file mode 100644 index a68d4b5..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/rootHandler.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -import { DetailsHandler, DetailsStoreState } from './detailsHandler'; -import { MapHandler, MapState } from './mapHandler'; -import { SearchHandler, searchState } from './searchHandler'; -import { connectivityState, ConnectivityHandler } from './connectivityHandler'; -import { SettingsHandler, SettingsState } from './settingsHandler'; -import { ManagementHandler, ManagementState } from './sitedocManagementHandler'; -import { FilterHandler, FilterState } from './filterHandler'; - -export type INetworkAppStoreState = { - details: DetailsStoreState; - map: MapState; - search: searchState; - filter: FilterState; - connectivity: connectivityState; - settings: SettingsState; - sitedocManagement: ManagementState; -}; - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - network: INetworkAppStoreState; - } -} - -const appHandler = { - details: DetailsHandler, - map: MapHandler, - search: SearchHandler, - filter: FilterHandler, - connectivity: ConnectivityHandler, - settings: SettingsHandler, - sitedocManagement: ManagementHandler, -}; - -export const networkmapRootHandler = combineActionHandler(appHandler); -export default networkmapRootHandler; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/searchHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/searchHandler.ts deleted file mode 100644 index 141ddf2..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/searchHandler.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { SetSearchValueAction } from '../actions/searchAction'; - -export type searchState = { - value: string; -}; - -const initialState: searchState = { - value: '', -}; - -export const SearchHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof SetSearchValueAction) { - state = { ...state, value: action.value }; - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/settingsHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/settingsHandler.ts deleted file mode 100644 index b870fd1..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/settingsHandler.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { NetworkMapSettings, ThemeElement } from '../model/settings'; -import { SetBusyLoadingAction, SetMapSettingsAction, SetThemeSettingsAction } from '../actions/settingsAction'; - -export type SettingsState = { - mapSettings: NetworkMapSettings | null; - themes: ThemeElement[]; - isLoadingData: boolean; -}; - -const defaultThemes: ThemeElement[] = [ - { - key: 'light', - site: '#11b4da', - selectedSite: '#116bda', - fiberLink: '#1154d9', - microwaveLink: '#039903', - furtherLayers: {}, - }, - { - key: 'dark', - site: '#000000', - selectedSite: '#6e6e6e', - fiberLink: '#0a2a6b', - microwaveLink: '#005200', - furtherLayers: {}, - }, -]; - -const initialState: SettingsState = { - mapSettings: null, - themes: defaultThemes, - isLoadingData: true, -}; - -export const SettingsHandler: IActionHandler = (state = initialState, action) => { - - if (action instanceof SetMapSettingsAction) { - state = { - ...state, - mapSettings: action.settings, - }; - } else if (action instanceof SetThemeSettingsAction) { - state = { - ...state, - themes: action.settings.themes, - }; - } else if (action instanceof SetBusyLoadingAction) { - state = { - ...state, - isLoadingData: action.busy, - }; - } - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/sitedocManagementHandler.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/sitedocManagementHandler.ts deleted file mode 100644 index 9d82b50..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/handlers/sitedocManagementHandler.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { ResetAction, SelectUserAction, SetAllUsersAction, SetTSSRAction, UpdateNoteAction, UpdateStateAction, UpdateTasks } from '../actions/sitedocManagementAction'; -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { SitedocOrderTask, UserListItem } from '../model/siteDocTypes'; - -const emptyTask: SitedocOrderTask = { type: '', description: '', status: false }; - -export type ManagementState = { - users: UserListItem[]; - selectedUser: string; - note: string; - tasks: SitedocOrderTask[]; - isTSSR: boolean; - state: string; -}; - -const initialState: ManagementState = { - users:[], - selectedUser: '', - state: 'OPEN', - note: '', - tasks: [emptyTask], - isTSSR: false, -}; - -export const ManagementHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof SetAllUsersAction) { - state = { ...state, users:action.users }; - } else if (action instanceof SelectUserAction) { - state = { ...state, selectedUser: action.user }; - } else if (action instanceof SetTSSRAction) { - state = { ...state, isTSSR: action.isTSSR }; - } else if (action instanceof UpdateNoteAction) { - state = { ...state, note:action.note }; - } else if (action instanceof UpdateStateAction) { - state = { ...state, state: action.state }; - } else if (action instanceof UpdateTasks) { - state = { ...state, tasks: action.tasks }; - } else if ( action instanceof ResetAction) { - state = { ...state, tasks: [emptyTask], selectedUser:'', note: '', isTSSR:false }; - } - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/index.html b/features/sdnr/odlux/odlux/apps/networkMapApp/src/index.html deleted file mode 100644 index f9c8ad7..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - Networkmap App - - - -
- - - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/boundingBox.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/boundingBox.ts deleted file mode 100644 index 2f978d5..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/boundingBox.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint-disable no-underscore-dangle */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -/*** - * Custom bounding box, holds a rectangular area spanned open by lat-lon coordinate pairs - */ -export class BoundingBox { - - private _south: number; - - private _west: number; - - private _north: number; - - private _east: number; - - get south(): number { - return this._south; - } - - get west():number { - return this._west; - } - - get north():number { - return this._north; - } - - get east():number { - return this._east; - } - - public static createFromBoundingBox = (mapboxBoundingBox: maplibregl.LngLatBounds) => { - const bbox = new BoundingBox(); - bbox._south = mapboxBoundingBox.getSouth(); - bbox._east = mapboxBoundingBox.getEast(); - bbox._north = mapboxBoundingBox.getNorth(); - bbox._west = mapboxBoundingBox.getWest(); - return bbox; - }; - - public static createFromNumbers = (west: number, south: number, east: number, north: number) => { - const bbox = new BoundingBox(); - bbox._south = south; - bbox._west = west; - bbox._north = north; - bbox._east = east; - return bbox; - }; - -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/coordinates.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/coordinates.ts deleted file mode 100644 index 4d8b770..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/coordinates.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Coordinate = { - lat: number; - lon: number; -}; - -export type MapCoordinate = { - lat: number; - lon: number; - zoom: number; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/count.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/count.ts deleted file mode 100644 index 1457374..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/count.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License; Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type ElementCount = { - sites: string; - links: string; - services: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/historyEntry.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/historyEntry.ts deleted file mode 100644 index 8c64719..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/historyEntry.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Link, Site } from './topologyTypes'; - -export type HistoryEntry = { - id: string; - data: Site | Link; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/networkElementConnection.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/networkElementConnection.ts deleted file mode 100644 index a939f9b..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/networkElementConnection.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type NetworkElementConnection = { - id?: string; - nodeId: string; - isRequired: boolean; - host: string; - port: number; - username?: string; - password?: string; - tlsKey?: string; - status?: 'Connected' | 'mounted' | 'unmounted' | 'Connecting' | 'Disconnected' | 'idle'; - ['device-type']?: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/searchResult.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/searchResult.ts deleted file mode 100644 index 29bfc5b..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/searchResult.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Link, Site, Service } from './topologyTypes'; - -export type SearchResult = { - links: Link[]; - sites: Site[]; - services: Service[]; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/settings.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/settings.ts deleted file mode 100644 index 0aff1e5..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/settings.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { CirclePaintProps, LinePaintProps } from '../utils/mapUtils'; - -export type NetworkMapSettings = { - startupPosition: { - latitude?: string; - longitude?: string; - zoom?: string; - }; - tileOpacity: string; - areIconsEnabled: boolean; - styling: { - theme: string; - }; -}; - -export type ThemeElement = { - key: string; - site: string; - selectedSite: string; - microwaveLink: string; - fiberLink: string; - furtherLayers: { - [key: string]: { - site?: Partial; - link?: Partial; - service?: Partial; - }; - }; -}; - -export type NetworkMapThemes = { - themes: ThemeElement[]; -}; - -export type NetworkSettings = NetworkMapSettings & NetworkMapThemes; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/siteDocTypes.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/siteDocTypes.ts deleted file mode 100644 index 03d5c1a..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/siteDocTypes.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type UserListItem = { - userName: string; - firstName: string; - lastName: string; -}; - -export type RegisterUser = { - - firstName: string; - familyName: string; - email: string; - username: string; - password: string; - telephoneNr: string; - role: 'ANDROID'; -}; - -export type SitedocOrder = { - siteId: string; - assignedUser: string; - date: string; //in UTC - state: SitedocOrderTypes; - tasks: SitedocOrderTask[]; - note: string; - isTssr: boolean; -}; - -export type SitedocOrderTypes = 'OPEN' | 'UPDATE' | 'DELETE'; - -export type SitedocOrderTask = { - type: string; - description: string; - status: false; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/stadokOrder.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/stadokOrder.ts deleted file mode 100644 index 7ecfc6d..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/stadokOrder.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type StadokOrder = { - date: Date; - assignedUser: string; - state: string; //todo: type restrict - tasks: Task[]; -}; - -export class OrderToDisplay { - static parse = (stadokOrder: StadokOrder) =>{ - let order = new OrderToDisplay(); - order.assignedUser = stadokOrder.assignedUser; - order.state = stadokOrder.state; - - const firstOpenTask = stadokOrder.tasks.find(task => !task.status); - - if (firstOpenTask) { - order.currentTask = firstOpenTask.description; - } else { - order.currentTask = 'No task description available'; - } - - return order; - }; - - state: string; - - assignedUser: string; - - currentTask: string; - -} - -type Task = { - type: string; - description: string; - status: boolean; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/stadokSite.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/stadokSite.ts deleted file mode 100644 index 9a83e9d..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/stadokSite.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Address } from './topologyTypes'; - -type StadokSite = { - id: string; - createdBy: Contact; - updatedOn: Date; - location: { lat: number; lon: number }; - address: Address; - contacts: { manager: Contact; owner: Contact }; - safetyNotices: string[]; - images: string[]; - type: string; - devices: Device[]; - logs: Log[]; -}; - -type Contact = { - firstName: string; - lastName: string; - email: string; - telephoneNumber: string; -}; -type Log = { - date: Date; //string? - person: string; - entry: string; -}; - -type Device = { - 'device': string; - 'antenna': string; -}; - -export default StadokSite; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/topologyTypes.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/topologyTypes.ts deleted file mode 100644 index 1d9879e..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/model/topologyTypes.ts +++ /dev/null @@ -1,144 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Coordinate } from './coordinates'; - -type Point = { - type: 'Point'; - coordinates: number[]; -}; - -type LineString = { - type: 'LineString'; - coordinates: number[][]; -}; - -export type Geometry = Point | LineString; - -export type Feature = { - type: 'Feature'; - properties: { - id: number; - subType?: string; - layer?: string; - labels?: string[]; - xPonder?: boolean; - polarization?: string; - }; - geometry: Geometry; -}; - -export type Address = { - streetAndNr: string; - city: string; - zipCode: string | null; - country: string; -}; - -export type Service = { - id: number; - name: string; - backupForServiceId: number | null; - lifecycleState: string; - administrativeState: string; - operationalState: string; - created: string; - modified: string; - route: Coordinate[]; - length: number; - feature: Feature; -}; - -export type Site = { - id: number; - uuid: string; - name: string; - address: Address; - heightAmslInMeters?: number; //AboveGroundLevel - antennaHeightAmslInMeters?: number; - operator: string; - location:{ lon: number; lat: number }; - devices: Device[]; - links: { - id: number; - name: string; - azimuth: number | null; - }[]; - furtherInformation: string; - feature: Feature; -}; - -export type Device = { - id: string; - type?: string; - name: string; - manufacturer: string; - owner: string; - status?: string; - port: number[]; -}; - -type Antenna = { - id: string; - name: string; - height: number; - gain: number; -}; - -type LinkDetailLocation = { - lon: number; - lat: number; - siteId: number; - siteName: string | null; - amsl: number | null; - azimuth: number | null; - antenna: Antenna; - radio: { - id: number; - name: string; - }; - waveguide: { - id: number; - name: string; - }; -}; - -export type Link = { - id: number; - uuid: string; - name: string; - operator: string; - length: number; - polarization: string; - frequency: number | null; - siteA: LinkDetailLocation; - siteB: LinkDetailLocation; - feature: Feature; -}; - -export enum DetailsTypes { - service = 'service', - site = 'site', - link = 'link', -} - -export const isSite = (data: Link | Site | Service): data is Site => data.feature.properties.layer === DetailsTypes.site; - -export const isLink = (data: Link | Site | Service): data is Link => data.feature.properties.layer === DetailsTypes.link; - -export const isService = (data: Link | Site | Service): data is Service => data.feature.properties.layer === DetailsTypes.service; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/pluginTransport.tsx b/features/sdnr/odlux/odlux/apps/networkMapApp/src/pluginTransport.tsx deleted file mode 100644 index f09ac8e..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/pluginTransport.tsx +++ /dev/null @@ -1,76 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -// app configuration and main entry point for the app - -import React from 'react'; - -import { useApplicationDispatch } from '../../../framework/src/flux/connect'; -import applicationManager from '../../../framework/src/services/applicationManager'; - -import { addMapMessageListener } from '../../../lib/broadcast/mapChannel'; -import { URL_BASEPATH } from './config'; - -import { CheckSitedocReachability } from './actions/detailsAction'; -import { SetFilterValueAction } from './actions/filterActions'; -import { getSettings } from './actions/settingsAction'; - -import { NetworkMapSetup } from './components/customize/networkMapSetup'; - -import { networkmapRootHandler } from './handlers/rootHandler'; -import { MapMiddleware } from './handlers/mapHandler'; - -import MainView from './app'; - -const appIcon = require('./assets/icons/networkMapAppIcon.svg'); // select app icon - -const NetworkMapApp = () => { - - const dispatch = useApplicationDispatch(); - const tryReachSitedocServer = () => dispatch(CheckSitedocReachability()); - - React.useLayoutEffect(() => { - tryReachSitedocServer(); - }, []); - - return ( - - ); -}; - -NetworkMapApp.displayName = 'NetworkMapApp'; - -export const register = async () => { - const appApi = applicationManager.registerApplication({ - name: URL_BASEPATH, // used as name of state as well - icon: appIcon, - middlewares: [MapMiddleware], - rootActionHandler: networkmapRootHandler, - rootComponent: NetworkMapApp, - settingsElement: NetworkMapSetup, - menuEntry: 'Network Map', - }); - - addMapMessageListener('setFilter', (filter) => { - const store = appApi && appApi.applicationStore; - store?.dispatch(new SetFilterValueAction(filter)); - }); - - await appApi.applicationStoreInitialized; - await appApi.applicationStore?.dispatch(getSettings()); -}; diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/dataService.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/dataService.ts deleted file mode 100644 index e32d0a7..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/dataService.ts +++ /dev/null @@ -1,118 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { requestRest, requestRestExt } from '../../../../framework/src/services/restService'; -import { Result } from '../../../../framework/src/models'; - -import { NetworkElementConnection } from '../model/networkElementConnection'; -import { URL_API, URL_TILE_API } from '../config'; -import { ElementCount } from '../model/count'; -import { SearchResult } from '../model/searchResult'; - -class DataService { - - tryReachTileServer = async () => { - - try { - - const tiles = await fetch(URL_TILE_API + '/10/0/0.png'); - if (tiles.status == 200) { - return true; - } else { - console.error(tiles); - return false; - } - } catch (error) { - console.error(error); - return false; - - } - }; - - tryReachTopologyServer = async () => { - const response = await requestRestExt(URL_API + '/info/count/all'); - - if (response.status == 200) { - return true; - } else { - console.error(response.message); - return false; - } - - }; - - getGeojsonData = async (url: string) => { - - const result = await requestRestExt(url); - return result; - - }; - - getDetailsData = async (type: string, id: string) => { - - const response = await requestRestExt(`${URL_API}/${type}s/${id}`); - if (response.status == 200) { - return response.data; - } else { - console.error(response.message); - return null; - } - }; - - search = (searchTerm: string) => { - const data = { searchTerm }; - return requestRest(`${URL_API}/search`, { method: 'POST', body: JSON.stringify(data) }); - }; - - /** - * Get status and type of devices, if possible - */ - getAdditionalInfoOnDevices = async (ids: string[]) => { - - const path = 'rests/operations/data-provider:read-network-element-connection-list'; - - const query = { - 'data-provider:input': { - 'filter': [{ - 'property': 'id', - 'filtervalues': ids, - }], - 'pagination': { - 'size': ids.length, - 'page': 1, - }, - }, - }; - - if (ids.length > 0) { - const result = await requestRest>(path, { method: 'POST', body: JSON.stringify(query) }); - const resultData = result && result['data-provider:output'] && result['data-provider:output'].data; - return resultData; - } else { - return null; - } - }; - - getLabels = () => requestRest(`${URL_API}/labels`); - - getStatistics = (bbWest: number, bbSouth: number, bbEast: number, bbNorth: number) => - requestRest(`${URL_API}/info/count/${bbWest},${bbSouth},${bbEast},${bbNorth}`); - -} - -export const dataService = new DataService(); \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/mapImagesService.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/mapImagesService.ts deleted file mode 100644 index 3f32353..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/mapImagesService.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import maplibregl from 'maplibre-gl'; - -import apartment from '../../icons/apartment.png'; -import dataCenter from '../../icons/datacenter.png'; -import factory from '../../icons/factory.png'; -import lamp from '../../icons/lamp.png'; -import dataCenterRed from '../../icons/datacenterred.png'; -import factoryRed from '../../icons/factoryred.png'; -import lampRed from '../../icons/lampred.png'; - - -type ImagesLoaded = (allImagesLoaded: boolean) => void; - -export const ImagesMap: { name: string; url: string }[] = [ - { name: 'data-center', url: dataCenter }, - { name: 'house', url: apartment }, - { name: 'factory', url: factory }, - { name: 'lamp', url: lamp }, - { name: 'data-center-red', url: dataCenterRed }, - { name: 'factory-red', url: factoryRed }, - { name: 'lamp-red', url: lampRed }, -]; - -export const addImages = (map: maplibregl.Map, callback?: ImagesLoaded) => { - ImagesMap.forEach(image => { - map.loadImage( - image.url, - (error: any, img: any) => { - if (error) throw error; - map.addImage(image.name, img); - - // continue if all images are loaded - if (callback && ImagesMap.every(({ name }) => map.hasImage(name))) { - callback(true); - } - }); - }); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/settingsService.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/settingsService.ts deleted file mode 100644 index 823be41..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/settingsService.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { NetworkMapSettings, NetworkMapThemes } from '../model/settings'; -import { getUserData, saveUserData } from '../../../../framework/src/services/userdataService'; - - -const getMapSettings = () => getUserData<{ - networkMap?: NetworkMapSettings; - networkMapThemes?: NetworkMapThemes; - networkMapLayers?: { [key: string]: boolean }; -}>(); - -const getMapThemes = () => getUserData('/networkMapThemes'); - -const updateMapSettings = (newElement: NetworkMapSettings) => saveUserData('/networkMap', JSON.stringify(newElement)); - -const updateMapLayers = (layerVisibility: { [key: string]: boolean }) => saveUserData<{ [key: string]: boolean }>('/networkMapLayers', JSON.stringify(layerVisibility)); - -export { - getMapSettings, - getMapThemes, - updateMapSettings, - updateMapLayers, -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/sitedocDataService.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/sitedocDataService.ts deleted file mode 100644 index 35f4cb2..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/services/sitedocDataService.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { requestRest, requestRestExt } from '../../../../framework/src/services/restService'; - -import { Site } from '../model/topologyTypes'; -import { RegisterUser, SitedocOrder, UserListItem } from '../model/siteDocTypes'; - -const BASE_URL = '/sitedoc'; - -type Message = { - message: string; -}; - -class SitedocService { - - createOrder = async (order: SitedocOrder) => { - - const result = await requestRestExt(BASE_URL + '/order/create', { method: 'POST', body: JSON.stringify(order) }); - - if (result.status === 200) { - return { message: result.data!.message, error: false }; - } else { - - const message = { message: '', error: true }; - - if (result.data) { - message.message = 'Creation failed. Reason: ' + result.data.message; - return message; - } else { - message.message = 'Something went wrong...'; - return message; - } - } - }; - - createUser = (user: RegisterUser) => requestRest(BASE_URL + '/user/register', { method: 'POST', body: JSON.stringify(user) }); - - getSiteIfExists = (siteId: string) => requestRest('/topology/network/sites/' + siteId); - - getAllUsers = async () => { - - const result = await requestRest(BASE_URL + '/users/android'); - - if (result) { - return result; - } else { - return []; - } - - }; -} - -const sitedocDataService = new SitedocService(); -export { sitedocDataService }; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/styles/index.css b/features/sdnr/odlux/odlux/apps/networkMapApp/src/styles/index.css deleted file mode 100644 index ec2585e..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/styles/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/styles/mapbox-gl.css b/features/sdnr/odlux/odlux/apps/networkMapApp/src/styles/mapbox-gl.css deleted file mode 100644 index 03c479a..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/styles/mapbox-gl.css +++ /dev/null @@ -1 +0,0 @@ -.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);text-align:left}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:0;margin:10px;position:relative;background-color:#fff;border-radius:3px 12px 12px 3px}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 24px 2px 4px;visibility:visible;margin-top:6px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:"";cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/detailsUtils.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/detailsUtils.ts deleted file mode 100644 index b16aac0..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/detailsUtils.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { dataService } from '../services/dataService'; -import { DetailsTypes, isLink, isService, isSite } from '../model/topologyTypes'; - -type DetailsDataUrl = { - type: string; - id: string; -} | null; - -class DetailsUtils { - - errorCallback: any; - - public setLoadDataError = (callback: (data: any) => void) => { - this.errorCallback = callback; - }; - - public isLoadNeeded = (detailsData: DetailsDataUrl, currentId: number | undefined, currentData: any) => { - - if (!detailsData) - return false; - - return (currentId?.toString() !== detailsData.id || - detailsData.type == DetailsTypes.site && !isSite(currentData) || - detailsData.type == DetailsTypes.link && !isLink(currentData) || - detailsData.type == DetailsTypes.service && !isService(currentData) - ); - }; - - public isTypeAllowed = (type: string) => { - return type == DetailsTypes.site || type == DetailsTypes.link || type == DetailsTypes.service; - }; - - public loadData = (type: string, id: string, callback: (data: any) => void) => { - - dataService.getDetailsData(type, id) - .then(res => { - if (res !== null) - callback(res); - else - this.errorCallback(id); - }); - }; - -} - -const detailsUtils = new DetailsUtils(); - -export default detailsUtils; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/mapLayers.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/mapLayers.ts deleted file mode 100644 index e42a604..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/mapLayers.ts +++ /dev/null @@ -1,275 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Feature } from '../model/topologyTypes'; -import { ThemeElement } from '../model/settings'; -import { CirclePaintProps, LinePaintProps } from './mapUtils'; - -class MapLayerService { - - availableThemes: ThemeElement[]; - - selectedTheme: string | null = null; - - iconLayersActive = false; - - public addBaseSources = (map: maplibregl.Map, selectedPoint: Feature | null, selectedLine: Feature | null, selectedService: Feature | null) => { - - // make sure the sources don't already exist - // (if the networkmap app gets opened quickly within short time periods, the prior sources might not be fully removed) - - if (!map.getSource('lines')) { - map.addSource('lines', { - type: 'geojson', - data: { type: 'FeatureCollection', features: [] }, - }); - } - - if (!map.getSource('services')) { - - map.addSource('services', { - type: 'geojson', - data: { type: 'FeatureCollection', features: [] }, - }); - } - - if (!map.getSource('selectedLine')) { - - const selectedElement = selectedLine || selectedService; - const features = selectedElement !== null ? [selectedElement] : []; - map.addSource('selectedLine', { - type: 'geojson', - data: { type: 'FeatureCollection', features: features }, - }); - } - - if (!map.getSource('points')) { - map.addSource('points', { - type: 'geojson', - data: { type: 'FeatureCollection', features: [] }, - }); - } - - if (!map.getSource('selectedPoints')) { - const selectedPointFeature = selectedPoint !== null ? [selectedPoint] : []; - map.addSource('selectedPoints', { - type: 'geojson', - data: { type: 'FeatureCollection', features: selectedPointFeature }, - - }); - } - }; - - public addCircleLayer = (map: maplibregl.Map, id: string, source: string, paint: CirclePaintProps, filter: any) => { - - map.addLayer({ - id: id, - source, - type: 'circle', - paint, - filter, - }); - }; - - public addLineLayer = (map: maplibregl.Map, id: string, source: string, paint: LinePaintProps, filter: any, isDashed?: boolean) => { - - const layer: any = { - id: id, - type: 'line', - source, - layout: { - 'line-join': 'round', - 'line-cap': 'round', - }, - paint, - filter, - }; - - if (isDashed) { - layer.paint['line-dasharray'] = [2, 1]; - } - - map.addLayer(layer); - }; - - public addBaseLayers = (map: maplibregl.Map) => { - - this.addCommonLayers(map); - }; - - public addIconLayers = (map: maplibregl.Map) => { - - this.iconLayersActive = true; - this.addCommonLayers(map); - this.createIconLayers(map); - }; - - public removeBaseLayers = (map: maplibregl.Map) => { - - map.removeLayer('points'); - map.removeLayer('lines'); - map.removeLayer('services'); - map.removeLayer('selectedPoints'); - map.removeLayer('selectedLine'); - map.removeLayer('selectedServices'); - }; - - public showIconLayers = (map: maplibregl.Map, show: boolean) => { - - const zoom = map.getZoom(); - if (show) { - if (zoom > 11) { - if (!this.iconLayersActive) { - this.iconLayersActive = true; - if (map.getLayer('points') !== undefined && map.getLayer('point-lamps') === undefined) { - this.createIconLayers(map); - } - } - } else { - if (this.iconLayersActive) - this.swapLayersBack(map); - } - } else { - if (this.iconLayersActive) - this.swapLayersBack(map); - } - }; - - public swapLayersBack = (map: maplibregl.Map) => { - this.iconLayersActive = false; - this.removeIconLayers(map); - - if (map.getLayer('selectedPoints')) { - map.setFilter('selectedPoints', null); - } - - if (map.getLayer('points')) { - map.setFilter('points', null); - } - }; - - public changeMapOpacity = (map: maplibregl.Map, newValue: number) => { - const newOpacity = newValue / 100; - if (map) { - const tiles = map.getStyle().layers?.filter(el => el.id.includes('tiles')); - tiles?.forEach(layer => { - if (layer.type === 'symbol') { - map.setPaintProperty(layer.id, 'icon-opacity', newOpacity); - map.setPaintProperty(layer.id, 'text-opacity', newOpacity); - } else { - map.setPaintProperty(layer.id, `${layer.type}-opacity`, newOpacity); - } - }); - } - }; - - public changeTheme = (map: maplibregl.Map, themeName: string) => { - this.selectedTheme = themeName; - const theme = this.pickTheme(); - if (theme && map.loaded()) { - map.setPaintProperty('points', 'circle-color', theme.site); - map.setPaintProperty('selectedPoints', 'circle-color', theme.selectedSite); - map.setPaintProperty('microwave-lines', 'line-color', theme.microwaveLink); - map.setPaintProperty('fibre-lines', 'line-color', theme.fiberLink); - - } - }; - - public addLayersToMap(pMap: maplibregl.Map, furtherLayerNames: string[]) { - const theme = this.pickTheme(); - const furtherLayersTheme = theme?.furtherLayers || {}; - furtherLayerNames.forEach(el => { - const layerTheme = furtherLayersTheme[el] ; - const sitePaint: CirclePaintProps = { - 'circle-color': '#8F00FF', - 'circle-radius': 6, - ...layerTheme?.site ?? {}, - }; - - const linksPaint: LinePaintProps = { - 'line-color': '#8F00FF', - 'line-width': 2, - ...layerTheme?.link ?? {}, - }; - - const servicesPaint: LinePaintProps = { - 'line-color': '#8F00FF', - 'line-width': 2, - ...layerTheme?.service ?? {}, - }; - - this.addCircleLayer(pMap, el, 'points', sitePaint, ['in', el, ['get', 'labels']]); - this.addLineLayer(pMap, `${el}-links`, 'lines', linksPaint, ['in', el, ['get', 'labels']]); - this.addLineLayer(pMap, `${el}-services`, 'services', servicesPaint, ['in', el, ['get', 'labels']]); - }); - } - - private createIconLayers = (map: maplibregl.Map) => { - //set filter to it! - map.setFilter('points'); - map.setFilter('selectedPoints'); - }; - - private addCommonLayers = (map: maplibregl.Map, themeSettings?: ThemeElement) => { - - const theme = !themeSettings ? this.pickTheme() : themeSettings; - this.addLineLayer(map, 'microwave-lines', 'lines', { 'line-color': theme.microwaveLink, 'line-width': 2 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'microwave']]); - this.addLineLayer(map, 'fibre-lines', 'lines', { 'line-color': theme.fiberLink, 'line-width': 2 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'fibre']]); - - this.addLineLayer(map, 'services', 'services', { 'line-color': '#FF0000', 'line-width': 2 }, ['all', ['==', 'layer', 'service'], ['==', 'isBackup', false ]]); - this.addLineLayer(map, 'backup-services', 'services', { 'line-color': '#FF0000', 'line-width': 2 }, ['all', ['==', 'layer', 'service'], ['==', 'isBackup', true ]], true); - - this.addLineLayer(map, 'selectedLineMicrowave', 'selectedLine', { 'line-color': theme.microwaveLink, 'line-width': 4 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'microwave']]); - this.addLineLayer(map, 'selectedLineFibre', 'selectedLine', { 'line-color': theme.fiberLink, 'line-width': 4 }, ['all', ['==', 'layer', 'link'], ['==', 'subType', 'fibre']]); - this.addLineLayer(map, 'selectedServices', 'selectedLine', { 'line-color': '#FF0000', 'line-width': 4 }, ['==', 'layer', 'service']); - - // this.addCircleLayer(map, 'points', 'points', { 'circle-color': theme.site, 'circle-radius': [ 'match', ['get', 'xPonder'], 'true', 9, 7 ], 'circle-stroke-width': 1, 'circle-stroke-color':'#fff' }, ['==', 'layer', 'site']); - this.addCircleLayer(map, 'points', 'points', { 'circle-color': theme.site, 'circle-radius': 7, 'circle-stroke-width': 1, 'circle-stroke-color':'#fff' }, ['==', 'layer', 'site']); - this.addCircleLayer(map, 'selectedPoints', 'selectedPoints', { 'circle-color': theme.selectedSite, 'circle-radius': 9, 'circle-stroke-width': 1, 'circle-stroke-color': '#fff' }, ['==', 'layer', 'size']); - }; - - /** - * Pick the correct theme based on user selection - */ - private pickTheme = () => { - if (this.selectedTheme !== null) { - const result = this.availableThemes.find(el => el.key === this.selectedTheme); - if (result) - return result; - } - - return this.availableThemes[0]; - }; - - private removeIconLayers = (map: maplibregl.Map) => { - - map.removeLayer('point-building'); - map.removeLayer('point-lamps'); - map.removeLayer('point-data-center'); - map.removeLayer('point-factory'); - map.removeLayer('select-point-data-center'); - map.removeLayer('select-point-buildings'); - map.removeLayer('select-point-lamps'); - map.removeLayer('select-point-factory'); - }; - -} - -const mapLayerService = new MapLayerService(); -export default mapLayerService; - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/mapUtils.ts b/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/mapUtils.ts deleted file mode 100644 index f590fbe..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/src/utils/mapUtils.ts +++ /dev/null @@ -1,148 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import type { CircleLayerSpecification, LineLayerSpecification, Map, MapGeoJSONFeature } from 'maplibre-gl'; - -export type CirclePaintProps = CircleLayerSpecification['paint']; -export type CircleLayoutProps = CircleLayerSpecification['layout']; - -export type LinePaintProps = LineLayerSpecification['paint']; -export type LineLayoutProps = LineLayerSpecification['layout']; - -import { BoundingBox } from '../model/boundingBox'; - -const EARTHRADIUSM = 6378137; - -const degrees_to_radians = (degrees: number) => { - return degrees * (Math.PI / 180); -}; - -const checkLatitude = (lat: number) => { - - if (lat > 90) - return 90; - else if (lat < -90) - return -90; - else - return lat; - -}; - -const checkLongitude = (lon: number) => { - if (lon > 180) - return 180; - else if (lon < -180) - return -180; - else - return lon; -}; - -const radians_to_degrees = (radians: number) => { - var pi = Math.PI; - return radians * (180 / pi); -}; - -export const addDistance = (south: number, west: number, north: number, east: number, distanceKm: number): BoundingBox => { - - const distanceInM = distanceKm * 1000; - - const dLat = distanceInM / EARTHRADIUSM; - const dLon = distanceInM / (EARTHRADIUSM * Math.cos(Math.PI * (north + south) / 360)); - - const latOffset = dLat * 180 / Math.PI; - const lonOffset = dLon * 180 / Math.PI; - - const newEast = checkLongitude(east + lonOffset); - const newWest = checkLongitude(west - lonOffset); - const newNorth = checkLatitude(north + latOffset); - const newSouth = checkLatitude(south - latOffset); - - return BoundingBox.createFromNumbers(newWest, newSouth, newEast, newNorth); - -}; - -export const increaseBoundingBox = (map: Map) => { - - const bbox = map.getBounds(); - - const distance = map.getCenter().distanceTo(bbox.getNorthEast()); // radius of visible area (center -> corner) (in meters) - - //calculate new boundingBox - const increasedBoundingBox = addDistance(bbox.getSouth(), bbox.getWest(), bbox.getNorth(), bbox.getEast(), (distance / 1000) / 2); - return increasedBoundingBox; -}; - - -//taken from https://www.movable-type.co.uk/scripts/latlong.html -export const calculateMidPoint = (latStart: number, lonStart: number, latEnd: number, lonEnd: number) => { - - const dLon = degrees_to_radians(lonEnd - lonStart); - - //convert to radians - const lat1 = degrees_to_radians(latStart); - const lat2 = degrees_to_radians(latEnd); - const lon1 = degrees_to_radians(lonStart); - - const Bx = Math.cos(lat2) * Math.cos(dLon); - const By = Math.cos(lat2) * Math.sin(dLon); - const lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), Math.sqrt((Math.cos(lat1) + Bx) * (Math.cos(lat1) + Bx) + By * By)); - const lon3 = lon1 + Math.atan2(By, Math.cos(lat1) + Bx); - - const result = { lat: radians_to_degrees(lat3), lon: radians_to_degrees(lon3) }; - - return result; -}; - - -export const LatLonToDMS = (value: number, isLon: boolean = false) => { - const absoluteValue = Math.abs(value); - const d = Math.floor(absoluteValue); - const m = Math.floor((absoluteValue - d) * 60); - const s = (absoluteValue - d - m / 60) * 3600; - const dms = `${d}° ${m}' ${s.toFixed(2)}"`; - - const sign = Math.sign(value); - - if (isLon) { - return (sign === -1 || sign === -0) ? dms + ' W' : dms + ' E'; - } else { - return (sign === -1 || sign === -0) ? dms + ' S' : dms + ' N'; - } -}; - -// Because features come from tiled vector data, feature geometries may be split -// or duplicated across tile boundaries and, as a result, features may appear -// multiple times in query results. - -//taken from https://docs.mapbox.com/mapbox-gl-js/example/filter-features-within-map-view/ - -export const getUniqueFeatures = (array: MapGeoJSONFeature[], comparatorProperty: string) => { - var existingFeatureKeys: any = {}; - - var uniqueFeatures = array.filter(function (el) { - if (existingFeatureKeys[el.properties![comparatorProperty]]) { - return false; - } else { - existingFeatureKeys[el.properties![comparatorProperty]] = true; - return true; - } - }); - - return uniqueFeatures; -}; - diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/tsconfig.json b/features/sdnr/odlux/odlux/apps/networkMapApp/tsconfig.json deleted file mode 100644 index 18956db..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - }, -} diff --git a/features/sdnr/odlux/odlux/apps/networkMapApp/webpack.config.js b/features/sdnr/odlux/odlux/apps/networkMapApp/webpack.config.js deleted file mode 100644 index 1f4db83..0000000 --- a/features/sdnr/odlux/odlux/apps/networkMapApp/webpack.config.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); -const proxyConf = require('../../proxy.conf'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - networkMapApp: ["./pluginTransport.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "networkMapApp", - libraryTarget: "umd2", - chunkFilename: "[name].js", - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - }, - { - test: /\.(png|gif|jpg|svg)$/, - use: [{ - loader: 'url-loader', - options: { - limit: 10000, - name: './icons/[hash].[ext]' - } - }] - }, - { - test: /\.css$/i, - use: ["style-loader", "css-loader"], - }] - }, - - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release" ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ]) - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: proxyConf, - } - }]; -} diff --git a/features/sdnr/odlux/odlux/apps/performanceHistoryApp/pom.xml b/features/sdnr/odlux/odlux/apps/performanceHistoryApp/pom.xml index 9952ae6..bcc2fe4 100644 --- a/features/sdnr/odlux/odlux/apps/performanceHistoryApp/pom.xml +++ b/features/sdnr/odlux/odlux/apps/performanceHistoryApp/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-app-performanceHistoryApp 1.7.0-SNAPSHOT diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/.babelrc b/features/sdnr/odlux/odlux/apps/siteManagerApp/.babelrc deleted file mode 100644 index 3d8cd12..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/package.json b/features/sdnr/odlux/odlux/apps/siteManagerApp/package.json deleted file mode 100644 index b3f8e6a..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@odlux/sitemanager-app", - "version": "0.1.0", - "description": "A react based modular UI to display network siteManager data from a database.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Sai Neetha Phulmali", - "license": "Apache-2.0", - "dependencies": { - "@emotion/react": "^11.7.0", - "@emotion/styled": "^11.6.0", - "@fortawesome/fontawesome-svg-core": "1.2.35", - "@fortawesome/free-solid-svg-icons": "5.6.3", - "@fortawesome/react-fontawesome": "0.1.14", - "@mui/icons-material": "^5.2.0", - "@mui/lab": "^5.0.0-alpha.58", - "@mui/material": "^5.2.2", - "@mui/styles": "^5.2.2", - "@odlux/framework": "*", - "clsx": "^1.2.1" - }, - "peerDependencies": { - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "@types/react": "17.0.37", - "@types/react-dom": "17.0.11", - "@types/react-router-dom": "5.1.7", - "jquery": "3.3.1", - "react": "17.0.2", - "react-dom": "17.0.2", - "react-router-dom": "5.2.0" - } -} diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/pom.xml b/features/sdnr/odlux/odlux/apps/siteManagerApp/pom.xml deleted file mode 100644 index 812823e..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - 4.0.0 - - org.o-ran-sc.oam-controller.features.sdnr.odlux - sdnr-odlux-app-siteManagerApp - 1.7.0-SNAPSHOT - jar - - SDNR ODLUX :: ${project.artifactId} - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - - - dist - odlux - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - de.jacks-it-lab - frontend-maven-plugin - 1.7.2 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v16.17.0 - v1.22.19 - - - - yarn build - - yarn - - - run build - - - - - - - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/detailsAction.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/detailsAction.ts deleted file mode 100644 index dbc7295..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/detailsAction.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; -import { requestRest } from '../../../../framework/src/services/restService'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { SITEDOC_URL } from '../config'; -import { HistoryEntry } from '../models/historyEntry'; -import { link } from '../models/link'; -import { NetworkElementConnection } from '../models/networkElementConnection'; -import { Device, Site } from '../models/site'; -import { Service } from '../models/topologyTypes'; -import dataService from '../services/dataService'; - - -export class SelectElementAction extends Action { - constructor(public data: link | Site | Service) { - super(); - } -} - -export class ClearDetailsAction extends Action { } - -export class AddToHistoryAction extends Action { - constructor(public entry: HistoryEntry) { - super(); - } -} - -export class ClearHistoryAction extends Action { } - -export class IsBusyCheckingDeviceListAction extends Action { - constructor(public isBusy: boolean) { - super(); - } -} - -export class FinishedLoadingDeviceListAction extends Action { - constructor(public devices: Device[]) { - super(); - } -} - -export class ClearLoadedDevicesAction extends Action { } - -export class InitializeLoadedDevicesAction extends Action { - constructor(public devices: Device[]) { - super(); - } -} - -export class IsSitedocReachableAction extends Action { - constructor(public isReachable: boolean) { - super(); - } -} - -export const UpdateDetailsView = (nodeId: string) => (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { siteManager: { details: { checkedDevices } } } = getState(); - if (checkedDevices !== null) { - const index = checkedDevices.findIndex(item => item.name === nodeId); - if (index !== -1) - requestRest('/rests/operational/network-topology:network-topology/topology/topology-netconf/node/' + nodeId, { method: 'GET' }) - .then(result => { - if (result !== null) { - checkedDevices[index].status = result.node[0]['netconf-node-topology:connection-status']; - } else { - checkedDevices[index].status = 'Not connected'; - } - dispatcher(new FinishedLoadingDeviceListAction(checkedDevices)); - }); - } -}; - -export const CheckDeviceList = (list: Device[]) => async (dispatcher: Dispatch, getState: () => IApplicationStoreState) => { - const { siteManager: { details: { isBusyCheckingDeviceList } } } = getState(); - if (isBusyCheckingDeviceList) return; - dispatcher(new IsBusyCheckingDeviceListAction(true)); - const ids: string[] = list - .filter(el => el.name && el.name.length > 0) - .map((device) => { - return device.name; - }); - - const resultData = await dataService.getAdditionalInfoOnDevices(ids); - if (resultData) { - resultData.forEach((data: NetworkElementConnection) => { - const index = list.findIndex(el => { return el.name === data.id; }); - if (index !== -1) { - list[index].status = data.status; - list[index].type = data['device-type']; - } - }); - } - dispatcher(new FinishedLoadingDeviceListAction(list)); - dispatcher(new IsBusyCheckingDeviceListAction(false)); -}; - -export const checkSiteDockReachability = () => async (dispatcher: Dispatch) => { - console.log('searching for sitedoc server...'); - requestRest(SITEDOC_URL + '/app/versioninfo').then(response => { - console.log(response); - if (response) { - dispatcher(new IsSitedocReachableAction(true)); - } else { - dispatcher(new IsSitedocReachableAction(false)); - } - }); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/panelActions.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/panelActions.ts deleted file mode 100644 index 2e86084..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/panelActions.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; - -import { PanelId } from '../models/panelId'; - - -export class SetPanelAction extends Action { - constructor(public panelId: PanelId) { - super(); - } -} - -export const setPanelAction = (panelId: PanelId) => { - return new SetPanelAction(panelId); -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/siteManagerSiteSearchAction.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/siteManagerSiteSearchAction.ts deleted file mode 100644 index 74ed0ee..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/siteManagerSiteSearchAction.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { SearchSiteIdResult } from '../models/siteManager'; -import siteManagerService from '../services/siteManagerService'; - -export class SearchValueAction extends Action { - constructor(public siteId: string, public categoryName?: string) { - super(); - } -} - -export class SetBusyAction extends Action { - constructor(public busy: boolean) { - super(); - } -} - - -/** - * Get searchTreeBySiteIdOrName - */ -export class BaseAction extends Action { } - -export class LoadTreeSiteSearchBySiteIdOrNameAction extends BaseAction { } - -export class AllTreeSiteSearchBySiteIdOrNameLoadedAction extends BaseAction { - constructor(public searchResult: SearchSiteIdResult) { - super(); - } -} - -export const loadTreeSiteSearchBySiteIdOrNameAsync = (searchValue: string) => async (dispatch: Dispatch) => { - dispatch(new LoadTreeSiteSearchBySiteIdOrNameAction()); - const searchResult: SearchSiteIdResult = (await siteManagerService.getSearchSiteIDTrail(searchValue)); - dispatch(new AllTreeSiteSearchBySiteIdOrNameLoadedAction(searchResult)); - return searchResult; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/siteManagerTreeActions.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/siteManagerTreeActions.ts deleted file mode 100644 index 68aea35..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/siteManagerTreeActions.ts +++ /dev/null @@ -1,214 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { Bands, SiteConfigurationFreqPlan, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems, Sites, SitesListResult } from '../models/siteManager'; -import siteManagerService from '../services/siteManagerService'; - -export class BaseAction extends Action { } - -export class SetBusyAction extends Action { - constructor(public busy: boolean) { - super(); - } -} - -/** - * Get countries - */ -export class LoadAllCountriesAction extends BaseAction { } - -export class AllCountriesLoadedAction extends BaseAction { - constructor(public countriesList: SiteManagerAreas[] | null) { - super(); - - } -} - -export const loadAllCountriesAsync = () => async (dispatch: Dispatch) => { - dispatch(new LoadAllCountriesAction()); - const countries: SiteManagerAreas[] = (await siteManagerService.getCountries()) || []; - dispatch(new AllCountriesLoadedAction(countries)); - return countries; -}; - -/** - * Get areaByAreaId - */ -export class LoadAllAreasByAreaIdAction extends BaseAction { } - -export class AllAreasByAreaIdLoadedAction extends BaseAction { - constructor(public areaList: SiteManagerAreas[] | null) { - super(); - - } -} - -export const loadAllAreasByAreaIdAsync = (areaId: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllAreasByAreaIdAction()); - const areas: SiteManagerAreas[] = (await siteManagerService.getAreasByAreaId(areaId)) || []; - dispatch(new AllAreasByAreaIdLoadedAction(areas)); - return areas; -}; - -/** - * Get sitesByAreaId - */ -export class LoadAllSitesByAreaIdAction extends BaseAction { } - -export class AllSitesByAreaIdLoadedAction extends BaseAction { - constructor(public sitesList: SitesListResult) { - super(); - - } -} - -export const loadAllSitesByAreaIdAsync = (areaId: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllSitesByAreaIdAction()); - const sites: SitesListResult = (await siteManagerService.getSitesByAreaId(areaId)); - dispatch(new AllSitesByAreaIdLoadedAction(sites)); - return sites; -}; - - -/** - * Get CategoriesBySiteId - */ -export class LoadAllCategoriesBySiteIdAction extends BaseAction { } - -export class AllCategoriesBySiteIdALoadedAction extends BaseAction { - constructor(public categoryList: SiteManagerCategories[] | null) { - super(); - - } -} - -export const loadAllCategoriesBySiteIdAsync = (areaId: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllCategoriesBySiteIdAction()); - const categories: SiteManagerCategories[] = (await siteManagerService.getCategoriesBySiteId(areaId)) || []; - dispatch(new AllCategoriesBySiteIdALoadedAction(categories)); - return categories; -}; - -/** - * Get SiteDetailsBySiteId - */ -export class LoadAllSiteBySiteIdAction extends BaseAction { } - -export class AllSiteBySiteIdALoadedAction extends BaseAction { - constructor(public siteDetails: Sites | null) { - super(); - } -} - -export const loadAllSiteBySiteIdAsync = (siteId: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllSiteBySiteIdAction()); - const siteDetails: Sites = (await siteManagerService.getSiteBySiteId(siteId)) || []; - dispatch(new AllSiteBySiteIdALoadedAction(siteDetails)); - return siteDetails; -}; - -/** - * Get CategoryItemsBySiteIdAndCategoryName - */ -export class LoadAllCategoryItemsBySiteIdAction extends BaseAction { } - -export class AllCategoryItemsBySiteIdALoadedAction extends BaseAction { - constructor(public categoryItemList: SiteManagerCategoryItems | null) { - super(); - } -} - -export const loadAllCategoryItemsBySiteIdAsync = (siteId: string, categoryName: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllCategoryItemsBySiteIdAction()); - const categoryItemList: SiteManagerCategoryItems = (await siteManagerService.getCategoryItemsBySiteIdAndCategoryName(siteId, categoryName)) || []; - dispatch(new AllCategoryItemsBySiteIdALoadedAction(categoryItemList)); - return categoryItemList; -}; - -/** - * Get Site frequency plan - */ -export class LoadAllFrequencyPlanBySiteIdAction extends BaseAction { } - -export class AllFrequencyPlanBySiteIdALoadedAction extends BaseAction { - constructor(public freqPlanList: SiteConfigurationFreqPlan[]) { - super(); - } -} - -export const loadAllFrequencyPlanBySiteIdAsync = (siteId: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllFrequencyPlanBySiteIdAction()); - try { - const freqPlan: SiteConfigurationFreqPlan[] = await siteManagerService.getSitesFrequencyPlan(siteId); - dispatch(new AllFrequencyPlanBySiteIdALoadedAction(freqPlan)); - return freqPlan; - } catch (error) { - console.error('Error fetching site frequency plan:', error); - return []; - } -}; - -/** - * Get Available Frequency bands - */ -export class LoadAllAvailableBandsAction extends BaseAction { } - -export class AllAvailableBandsALoadedAction extends BaseAction { - constructor(public bandsList: Bands[]) { - super(); - } -} - -export const loadAllAvailableBandsAsync = () => async (dispatch: Dispatch) => { - dispatch(new LoadAllAvailableBandsAction()); - try { - const bands: Bands[] = await siteManagerService.getAvailableBands(); - dispatch(new AllAvailableBandsALoadedAction(bands)); - return bands; - } catch (error) { - console.error('Error fetching bands:', error); - return []; - } -}; - -/** - * Get All Available Site Types - */ -export class LoadAllAvailableSiteTypesAction extends BaseAction { } - -export class AllAvailableSiteTypesLoadedAction extends BaseAction { - constructor(public siteTypesList: String[]) { - super(); - } -} - -export const loadAllAvailableSiteTypesAsync = () => async (dispatch: Dispatch) => { - dispatch(new LoadAllAvailableSiteTypesAction()); - try { - const siteTypes: String[] = await siteManagerService.getAvailableSiteTypes(); - dispatch(new AllAvailableSiteTypesLoadedAction(siteTypes)); - return siteTypes; - } catch (error) { - console.error('Error fetching site types:', error); - return []; - } -}; - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/sitedocManagementAction.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/sitedocManagementAction.ts deleted file mode 100644 index fe0f798..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/actions/sitedocManagementAction.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { SitedocOrderTask, UserListItem } from '../models/siteDocTypes'; -import sitedocDataService from '../services/sitedocDataService'; - - -export class SetAllUsersAction extends Action { - constructor(public users: UserListItem[]) { - super(); - } -} - -export class SetTSSRAction extends Action { - constructor(public isTSSR: boolean) { - super(); - } -} - -export class UpdateNoteAction extends Action { - constructor(public note: string) { - super(); - } -} - -export class UpdateStateAction extends Action { - constructor(public state: string) { - super(); - } -} - -export class UpdateTasks extends Action { - constructor(public tasks: SitedocOrderTask[]) { - super(); - } -} - -export class ResetAction extends Action { } - -export class SelectUserAction extends Action { - constructor(public user: string) { - super(); - } -} - -export class SetSiteExists extends Action { - constructor(public exists: boolean) { - super(); - } -} - -export const getUsersAction = async (dispatcher: Dispatch) => { - const users = await sitedocDataService.getAllUsers(); - dispatcher(new SetAllUsersAction(users)); -}; - - -export class BaseAction extends Action { } - -export class LoadAllSiteDetailsBySiteIdAction extends BaseAction { } - -export class AllSiteDetailsBySiteIdALoadedAction extends BaseAction { - constructor(public siteDetailsList: any | null) { - super(); - } -} - -export const loadAllSiteDetailsBySiteIdAsync = (siteId: string) => async (dispatch: Dispatch) => { - dispatch(new LoadAllSiteDetailsBySiteIdAction()); - const siteDetailsList: any = (await sitedocDataService.getSiteDetails(siteId)); - dispatch(new AllSiteDetailsBySiteIdALoadedAction(siteDetailsList)); - return siteDetailsList; -}; - - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/assets/icons/siteManagerAppIcon.svg b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/assets/icons/siteManagerAppIcon.svg deleted file mode 100644 index 26856fe..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/assets/icons/siteManagerAppIcon.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/createNewOrder.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/createNewOrder.tsx deleted file mode 100644 index 39334f5..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/createNewOrder.tsx +++ /dev/null @@ -1,252 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; - -import { Button, Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogTitle from '@mui/material/DialogTitle'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { ResetAction, SelectUserAction, SetTSSRAction, UpdateNoteAction, UpdateTasks } from '../actions/sitedocManagementAction'; -import { SitedocOrder, SitedocOrderTask } from '../models/siteDocTypes'; -import sitedocDataService from '../services/sitedocDataService'; -import OrderTask from './orderTask'; - -type orderProps = RouteComponentProps & { - siteId: string; - onClose: (siteId: string) => void; - onError: () => void; -}; - -const NewOrder = (props: orderProps) => { - const users = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.users); - const selectedUser = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.selectedUser); - const isTssr = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.isTSSR); - const tasks = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.tasks); - const note = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.sitedocManagement.note); - const site = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.details.data); - - const dispatch = useApplicationDispatch(); - const selectUserAction = (user: string) => dispatch(new SelectUserAction(user)); - const checkTSSR = (value: boolean) => dispatch(new SetTSSRAction(value)); - const updateNote = (noteUpdate: string) => dispatch(new UpdateNoteAction(noteUpdate)); - const setTasks = (addTasks: SitedocOrderTask[]) => dispatch(new UpdateTasks(addTasks)); - const reset = () => dispatch(new ResetAction()); - - const emptyTask: SitedocOrderTask = { type: '', description: '', completed: false }; - const [isUsernameEmpty, setUsernameEmpty] = React.useState(false); - const [areTasksEmpty, setTasksEmpty] = React.useState<{ error: boolean }[]>([]); - const [orderInfoMessage, setOrderInfoMessage] = React.useState<{ message: string; error: boolean }>({ message: '', error: false }); - const splitSiteIdSelected = props.siteId.toString(); - let siteIdSelectedToCreateOrder = splitSiteIdSelected.split('#')[0]; - - React.useEffect(() => { - const taskErrors = tasks.map(() => { return { error: false }; }); - setTasksEmpty(taskErrors); - }, []); - - const addTaskButtonClicked = (e: any) => { - e.preventDefault(); - setTasks([...tasks, emptyTask]); - setTasksEmpty([...areTasksEmpty, { error: false }]); - }; - - const update = (property: string, index: number, newValue: string) => { - let items = [...tasks]; - let item = { ...items[index] } as any; - item[property] = newValue; - items[index] = item; - setTasks(items); - //clean error - if (items[index].description.length > 0 && items[index].type.length > 0) { - let errors = [...areTasksEmpty]; - errors[index] = { error: false }; - setTasksEmpty(errors); - } - }; - - const updateTaskType = (index: number, value: string) => { - update('type', index, value); - }; - - const updateTaskDescription = (index: number, value: string) => { - update('description', index, value); - }; - - const onReset = () => { - reset(); - }; - - const checkTasks = (orderTasks: SitedocOrderTask[]) => { - let empty: number[] = []; - orderTasks.forEach((el, i) => { - if (el.description.length == 0 || el.type.length == 0) - empty.push(i); - }); - - return empty; - }; - - const createOrder = () => { - const emptyTasks = checkTasks(tasks); - let areParamsEmpty = false; - if (selectedUser.length == 0) { - setUsernameEmpty(true); - areParamsEmpty = true; - } - - if (emptyTasks.length > 0) { - let orderTasks = areTasksEmpty; - //clean errors - orderTasks = tasks.map(() => { return { error: false }; }); - //set errors - emptyTasks.forEach(el => { - orderTasks[el] = { error: true }; - }); - setTasksEmpty(orderTasks); - areParamsEmpty = true; - } - - if (!areParamsEmpty) { - setUsernameEmpty(false); - setTasksEmpty([]); - //remove possible milliseconds - const datetime = new Date().toJSON().split('.')[0] + 'Z'; - let newOrder: SitedocOrder = { - tasks: tasks, - state: 'OPEN', - assignedUser: selectedUser, - reportFile: '', - note: note, - date: datetime, - isTssr: isTssr, - }; - sitedocDataService.createOrder(newOrder, siteIdSelectedToCreateOrder) - .then((res) => { - //display message - if (!res.serverError) { - setOrderInfoMessage(res); - } - }); - } - }; - - const onClose = (siteId: string) => { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - props.onClose && props.onClose(siteId); - }; - - const onError = () => { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - props.onError && props.onError(); - }; - - const name = site?.name; - - return <> - - TSS-Report Order - -
- Create order for site {siteIdSelectedToCreateOrder}{name && name.length > 0 && ' | ' + name} - - Assign to User - - { - isUsernameEmpty && User cannot be empty - } - - - checkTSSR(!isTssr)} />} label='Is TSSR' /> - - -
- { - tasks.map((el, index) => { - return { updateTaskDescription(index, e); }} - onTypeUpdate={(e) => { updateTaskType(index, e); }} />; - }) - } - - - - { updateNote(e.target.value as string); }} - label='Add Note' > -
-
- { - orderInfoMessage.message.length > 0 && (!orderInfoMessage.error) && - {orderInfoMessage.message} - } - { - orderInfoMessage.message.length > 0 && orderInfoMessage.error && - <> - - Error in Order Creation - {orderInfoMessage.message} - - - - - - - } -
-
-
- - - - - -
- ; -}; - -const CreateNewOrder = withRouter(NewOrder); - -export default CreateNewOrder; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/denseTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/denseTable.tsx deleted file mode 100644 index 8998e45..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/denseTable.tsx +++ /dev/null @@ -1,125 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, MouseEvent } from 'react'; - -import Paper from '@mui/material/Paper'; -import Table from '@mui/material/Table'; -import TableBody from '@mui/material/TableBody'; -import TableCell from '@mui/material/TableCell'; -import TableHead from '@mui/material/TableHead'; -import TableRow from '@mui/material/TableRow'; -import makeStyles from '@mui/styles/makeStyles'; - -const useStyles = makeStyles({ - denseTable: { - borderRadius: '0px', - }, - button: { - margin: 0, - padding: '6px 6px', - minWidth: 'unset', - }, -}); - -type DenseTableProps = { - actions?: boolean; - headers: string[]; - height: number; - hover: boolean; - ariaLabelRow: string; - ariaLabelColumn?: string[]; - verticalTable?: boolean; - onLinkClick?(id: string): void; data: any[]; - onClick?(id: string): void; -}; - -const DenseTable: FC = (props) => { - const { - ariaLabelRow, - data, - headers, - height, - hover, - ariaLabelColumn, - onClick = () => undefined, - verticalTable, - } = props; - - const styles = useStyles(); - - const handleClick = (event: MouseEvent, id: string) => { - event.preventDefault(); - onClick(id); - }; - - return ( - -
- - - - { - headers.map((tableHeader) => ({tableHeader})) - } - - - - {data.map((row, index) => { - - const values = (typeof row === 'string' || row instanceof String) ? [row] : Object.keys(row).map(function (e) { return row[e]; }); - - return ( - handleClick(e, row.name)}> - { - values.map((value, i) => { - if (value !== undefined) { - - if (!verticalTable) { - const ariaLabel = ariaLabelColumn === undefined ? headers[i].toLowerCase() : ariaLabelColumn[i]; - if (ariaLabel.length > 0) { - return {value}; - } else { - return {value}; - } - } else { - // skip adding aria label to 'header' column - if (i === 0) { - return {value}; - } else { - const ariaLabel = props.ariaLabelColumn === undefined ? props.headers[index].toLowerCase() : props.ariaLabelColumn[index]; - return {value}; - } - } - } else - return null; - }) - } - ); - }) - } - -
-
-
- ); -}; - -DenseTable.displayName = 'DenseTable'; - -export default DenseTable; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/deviceTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/deviceTable.tsx deleted file mode 100644 index 433051a..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/deviceTable.tsx +++ /dev/null @@ -1,65 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { useEffect } from 'react'; -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { createDeviceTableActions, createDeviceTablePreActions, createDeviceTableProperties } from '../handlers/deviceTableHandler'; - -const DeviceTable = MaterialTable as MaterialTableCtorType; - -type DeviceTableComponentProps = { - preFilterType: { - id: string; - }; -}; - -const DeviceTableComponent: React.FC = (props) => { - - const deviceTableProperties = useSelectApplicationState((state: IApplicationStoreState) => createDeviceTableProperties(state)); - - const dispatch = useApplicationDispatch(); - const deviceTableActions = createDeviceTableActions(dispatch); - const deviceTablePreActions = createDeviceTablePreActions(dispatch); - - useEffect(() => { - const tablePreFilter = { - 'siteId': props.preFilterType.id, - }; - deviceTableActions.onClearFilters(); - deviceTablePreActions.onPreFilterChanged(tablePreFilter); - }, [props.preFilterType.id]); - - - return ( - <> - - - - ); -}; - -export const DeviceTableView = DeviceTableComponent; -export default DeviceTableView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/linkTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/linkTable.tsx deleted file mode 100644 index 16ad9ce..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/linkTable.tsx +++ /dev/null @@ -1,82 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { useEffect } from 'react'; - -import { MaterialTable, MaterialTableCtorType, ColumnType } from '../../../../framework/src/components/material-table'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; -import { createLinkTableActions, createLinkTablePreActions, createLinkTableProperties } from '../handlers/linkTableHandler'; - -const LinkTable = MaterialTable as MaterialTableCtorType; - -type LinkTableComponentProps = { - preFilterType: { - id: string; - type: string; - }; -}; - -const LinkTableView: React.FC = (props) => { - const linkTableProperties = useSelectApplicationState((state: IApplicationStoreState) => createLinkTableProperties(state)); - - const dispatch = useApplicationDispatch(); - const linkTableActions = createLinkTableActions(dispatch); - const linkTablePreActions = createLinkTablePreActions(dispatch); - - useEffect(() => { - const tablePreFilter = { - 'siteId': props.preFilterType.id, - type: props.preFilterType.type, - }; - linkTableActions.onClearFilters(); - linkTablePreActions.onPreFilterChanged(tablePreFilter); - }, [props.preFilterType.id, props.preFilterType.type]); - - return ( - <> - { - return ( -
- {rowData.siteA.id} -
- ); - }, - }, - { - property: 'siteB', title: 'SiteB', type: ColumnType.custom, customControl: ({ rowData }) => { - return ( -
- {rowData.siteB.id} -
- ); - }, - }, - { property: 'operationalState', title: 'operational State', type: ColumnType.text }, - { property: 'operatorId', title: 'Operator Id', type: ColumnType.text }, - { property: 'lifecycleState', title: 'life Cycle State', type: ColumnType.text }, - ]} idProperty='id' {...linkTableActions} {...linkTableProperties} > -
- - ); -}; - -export default LinkTableView; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/messageDialog.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/messageDialog.tsx deleted file mode 100644 index 5de2717..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/messageDialog.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; - -import { DialogContentText } from '@mui/material'; -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; - -type MessageDialogComponentProps = { - dialogMessage: string; - isFromSearch: boolean; - onClose: (event: React.SyntheticEvent, isFromSearch: boolean) => void; - openDialog: boolean; - setOpenDialog: any; -}; - -export const MessageDialog = (props: MessageDialogComponentProps) => { - const handleDialogClose = (event: React.SyntheticEvent) => { - props.setOpenDialog(false); - props.onClose(event, props.isFromSearch); - }; - - return ( - - - - Server Error: {props.dialogMessage} - - - - - - - ); -}; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/orderTask.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/orderTask.tsx deleted file mode 100644 index 34b6f85..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/orderTask.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import * as React from 'react'; -import { FormControl, FormHelperText, InputLabel, MenuItem, Select, Stack, TextField } from '@mui/material'; - -import { SitedocOrderTask } from '../models/siteDocTypes'; - -type taskProps = { value: SitedocOrderTask; onDescUpdate(val: string): void; onTypeUpdate(val: string): void; error: boolean }; - -const Task = (props: taskProps) => { - const [orderTypes] = React.useState(['UPDATE', 'DELETE']); - - return <> - - - Task Type - - - { props.onDescUpdate(e.target.value); }}> - { - props.error && Cannot be empty - } - - ; -}; - -const OrderTask = Task; - -export default OrderTask; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/picturesTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/picturesTable.tsx deleted file mode 100644 index 6664318..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/picturesTable.tsx +++ /dev/null @@ -1,114 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useState } from 'react'; - -import { faDownload } from '@fortawesome/free-solid-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import IconButton from '@mui/material/IconButton'; -import makeStyles from '@mui/styles/makeStyles'; - -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; - -const useStyles = makeStyles({ - root: { - '&:hover': { - color: 'blue', - }, - }, - previewImage: { - cursor: 'pointer', - height: 120, - width: 120, - marginTop: '10px', - marginLeft: '10px', - }, -}); - -const Pictures = MaterialTable as MaterialTableCtorType; - -type PicturesComponentProps = { - item: { - name: string; - url: string; - 'last-update': string; - }[]; -}; - -type SiteManagerPicturesComponentProps = PicturesComponentProps; - -const PicturesViewComponent: React.FC = (props: SiteManagerPicturesComponentProps) => { - const [item] = useState(props.item); - - const classes = useStyles(); - - const downloadPicture = (url: string) => { - let fileName = url.substring( - url.lastIndexOf('/') + 1, - url.lastIndexOf('.'), - ); - fetch(url) - .then(response => { - response.arrayBuffer().then(function (buffer) { - const reportUrl = window.URL.createObjectURL(new Blob([buffer])); - const link = document.createElement('a'); - link.href = reportUrl; - link.setAttribute('download', fileName + '.jpg'); - document.body.appendChild(link); - link.click(); - }); - }) - .catch(() => alert('oh no! something went wrong')); - }; - - return ( - <> - { - if (rowData.url === '') { - return (<>{rowData.name} ); - } else { - return (
{rowData.name} ); - } - }, - }, - { - property: 'preview', title: 'Photo Preview', type: ColumnType.custom, customControl: ({ rowData }) => { - return Preview; - }, - }, - { - property: 'url', title: 'Action', type: ColumnType.custom, customControl: ({ rowData }) => { - if (rowData.url === '') { - return ( ); - } else { - return ( - { event.stopPropagation(); downloadPicture(rowData.url); }} /> - ); - } - }, - }, - ]} idProperty='id' rows={item} > - - - ); -}; - -export const PicturesView = PicturesViewComponent; -export default PicturesView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/refreshSiteTableDialog.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/refreshSiteTableDialog.tsx deleted file mode 100644 index 89671a6..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/refreshSiteTableDialog.tsx +++ /dev/null @@ -1,104 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; - -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; - -import { useApplicationDispatch } from '../../../../framework/src/flux/connect'; - -import { siteTableReloadAction } from '../handlers/siteTableHandler'; - -export enum RefreshSiteTableDialogMode { - None = 'none', - RefreshSiteTableTable = 'RefreshSiteTableTable', -} - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - enableMountIdEditor: boolean; - enableUsernameEditor: boolean; - enableExtendedEditor: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [RefreshSiteTableDialogMode.None]: { - dialogTitle: '', - dialogDescription: '', - applyButtonText: '', - cancelButtonText: '', - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [RefreshSiteTableDialogMode.RefreshSiteTableTable]: { - dialogTitle: 'Do you want to refresh the Site table?', - dialogDescription: '', - applyButtonText: 'Yes', - cancelButtonText: 'Cancel', - enableMountIdEditor: true, - enableUsernameEditor: true, - enableExtendedEditor: true, - }, -}; - -type RefreshSiteTableDialogComponentProps = { - mode: RefreshSiteTableDialogMode; - onClose: () => void; -}; - -const RefreshSiteTableDialogComponent: React.FC = (props) => { - - const dispatch = useApplicationDispatch(); - const refreshSiteTable = () => dispatch(siteTableReloadAction); - - const setting = settings[props.mode]; - const onRefresh = () => { - refreshSiteTable(); - props.onClose(); - }; - - const onCancel = () => { - props.onClose(); - }; - - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - - - - - - - ); -}; - -export const RefreshSiteTableDialog = RefreshSiteTableDialogComponent; -export default RefreshSiteTableDialog; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteAdditionalInformation.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteAdditionalInformation.tsx deleted file mode 100644 index a94d272..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteAdditionalInformation.tsx +++ /dev/null @@ -1,136 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { FC, SyntheticEvent, useEffect, useState } from 'react'; - -import { AppBar, Tab, Tabs, Typography } from '@mui/material'; - -import StadokSite from '../models/stadokSite'; -import DenseTable from './denseTable'; - -type StadokDetailsProps = { siteId: string }; - -const SiteAdditionalInformation: FC = (props) => { - - const [currentTab, setCurrentTab] = useState('contacts'); - const [data, setData] = useState(null); - - useEffect(() => { - const fetchData = async (siteId: string) => { - const response = await fetch('/sitedoc/site/' + siteId); - const result = await response.json(); - setData(result); - }; - - fetchData(props.siteId); - }, [props.siteId]); - - - const getContacts = (site: StadokSite | null) => { - const contacts = []; - if (site?.createdBy) { - contacts.push({ - h: 'Site Creator', col1: site?.createdBy.firstName, col2: site?.createdBy.lastName, - col3: site?.createdBy.email, col4: site?.createdBy.telephoneNumber, - }); - } - if (site?.contacts?.manager) { - contacts.push({ - h: 'Manager', col1: site?.contacts.manager.firstName, col2: site?.contacts.manager.lastName, - col3: site?.contacts.manager.email, col4: site?.contacts.manager.telephoneNumber, - }); - } - if (site?.contacts?.owner) { - contacts.push({ - h: 'Owner', col1: site?.contacts.owner.firstName, col2: site?.contacts.owner.lastName, - col3: site?.contacts.owner.email, col4: site?.contacts.owner.telephoneNumber, - }); - } - return contacts; - }; - - const handleTabChange = (event: SyntheticEvent, newValue: string) => { - setCurrentTab(newValue); - }; - const contacts = getContacts(data); - - - return ( -
-
- - - - - - - - { - currentTab == 'contacts' && (contacts.length > 0 ? - - : -
- - No contacts available - -
) - } - { - currentTab == 'safetyInfo' && (data && data?.safetyNotices?.length > 0 - ? ( - - ) - : ( -
- - No safety notices applicable - -
- )) - } - { - currentTab == 'logs' && (data && data?.logs?.length > 0 - ? ( - - ) - : ( -
- - No activity log available - -
- ) - ) - } -
-
- - - ); - -}; - -export default SiteAdditionalInformation; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteConfiguration.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteConfiguration.tsx deleted file mode 100644 index a494a84..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteConfiguration.tsx +++ /dev/null @@ -1,357 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http:www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { useEffect, useState } from 'react'; - -import AddIcon from '@mui/icons-material/Add'; -import { Button, Dialog, DialogActions, DialogContent, DialogContentText, FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material'; -import CircularProgress from '@mui/material/CircularProgress'; - -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { useApplicationDispatch } from '../../../../framework/src/flux/connect'; - -import { loadAllAvailableBandsAsync, loadAllFrequencyPlanBySiteIdAsync } from '../actions/siteManagerTreeActions'; -import { addEditSiteConfig } from '../models/siteManager'; -import siteManagerService from '../services/siteManagerService'; - -const SiteConfiguration = MaterialTable as MaterialTableCtorType; - - -type SiteConfigurationProps = { - siteId: string; -}; - -interface SiteConfigTableData { - band: string; - bandId: number; - status: string; - configuration: string; - comment: string; -} - -interface AvailableBands { - keyId: number; - name: string; - duplexSpacingMhz: number; -} - -const SiteConfigurationComponent: React.FC = (props: SiteConfigurationProps) => { - - const dispatch = useApplicationDispatch(); - const getSiteFrequencyPlan = async (siteId: string) => dispatch(loadAllFrequencyPlanBySiteIdAsync(siteId)); - const getAllAvailableBands = async () => dispatch(loadAllAvailableBandsAsync()); - - const [siteConfigTableData, setSiteConfigTableData] = useState([]); - const [bandsTableData, setBandsTableData] = useState([]); - const [openEditConfigDialog, setOpenEditConfigDialog] = useState(false); - const [config, setConfig] = useState('HIGH'); - const [comment, setComment] = useState(''); - const [rowData, setRowData] = useState(); - const [refreshTable, setRefreshTable] = useState(false); - const [shouldRefreshTable, setShouldRefreshTable] = useState(false); - const [saveInfoMessage, setSaveInfoMessage] = useState<{ message: string; error: boolean }>({ message: '', error: false }); - const [isDialogClosed, setIsDialogClosed] = useState(false); - const [openAddConfigDialog, setOpenAddConfigDialog] = useState(false); - const [bandId, setBandId] = useState(undefined); - const [openDeleteConfigDialog, setOpenDeleteConfigDialog] = useState(false); - const [isLoading, setIsLoading] = useState(false); - - const fetchSiteFrequencyPlan = async () => { - setIsLoading(true); - try { - const data: any = await getSiteFrequencyPlan(props.siteId); - const tableData: SiteConfigTableData[] = data.map((row: any) => ({ - band: row.band.name, - bandId: row.band.keyId, - status: row.status, - configuration: row.configuration, - comment: row.comment || '', - })); - setSiteConfigTableData(tableData); - } catch (error) { - console.error('Error fetching site frequency plan:', error); - } finally { - setIsLoading(false); - } - }; - - const fetchAllAvailableBands = async () => { - try { - const data: any = await getAllAvailableBands(); - const tableData: AvailableBands[] = data.map((row: any) => ({ - keyId: row.keyId, - name: row.name, - duplexSpacingMhz: row.duplexSpacingMhz, - })); - setBandsTableData(tableData); - } catch (error) { - console.error('Error fetching available bands:', error); - } - }; - - useEffect(() => { - fetchSiteFrequencyPlan(); - fetchAllAvailableBands(); - setSaveInfoMessage({ message: '', error: false }); - if (shouldRefreshTable) { - setShouldRefreshTable(false); - setRefreshTable((prevValue) => !prevValue); - } - }, [props.siteId, shouldRefreshTable]); - - const onOpenAddSiteConfigDialog = () => { - setOpenAddConfigDialog(true); - setBandId(undefined); - setComment(''); - }; - - const onOpenEditSiteConfigDialog = (event: React.MouseEvent, element: SiteConfigTableData) => { - if (!openEditConfigDialog) { - setOpenEditConfigDialog(true); - setComment(''); - setConfig(element.configuration); - setRowData(element); - } - }; - const onOpenDeleteSiteConfigDialog = (event: React.MouseEvent, element: SiteConfigTableData) => { - if (!openDeleteConfigDialog) { - setOpenDeleteConfigDialog(true); - setRowData(element); - } - }; - - const saveEditConfig = (bandid: string, siteId: string) => { - let modifiedConfig: addEditSiteConfig = { - configuration: config, - comment: comment, - }; - siteManagerService.saveSiteConfiguration(modifiedConfig, bandid, siteId).then((result) => { - if (!result.error) { - setOpenEditConfigDialog(false); - setIsDialogClosed(true); - } else { - setSaveInfoMessage(result); - } - }); - }; - - const addConfig = (bandid: string, siteId: string) => { - let addedConfig: addEditSiteConfig = { - configuration: config, - comment: comment, - }; - if (bandId !== undefined) { - siteManagerService.createSiteConfiguration(addedConfig, bandid, siteId).then((result) => { - if (!result.error) { - setOpenAddConfigDialog(false); - setIsDialogClosed(true); - } else { - setSaveInfoMessage(result); - } - }); - } - }; - const deleteConfig = (bandid: string, siteId: string) => { - siteManagerService.deleteSiteConfiguration(bandid, siteId).then((result) => { - if (!result.error) { - setOpenDeleteConfigDialog(false); - setIsDialogClosed(true); - } else { - setSaveInfoMessage(result); - } - }); - }; - - const handleCloseEditDialog = () => { - setOpenEditConfigDialog(false); - setSaveInfoMessage({ message: '', error: false }); - }; - - const handleCloseAddDialog = () => { - setOpenAddConfigDialog(false); - setSaveInfoMessage({ message: '', error: false }); - }; - - const handleCloseDeleteDialog = () => { - setOpenDeleteConfigDialog(false); - setSaveInfoMessage({ message: '', error: false }); - }; - - const addSiteConfigurationAction = { - icon: AddIcon, - tooltip: 'Add Site Configuration', - ariaLabel: 'add-site-configuration', - onClick: onOpenAddSiteConfigDialog, - }; - - const getContextMenu = (row: SiteConfigTableData) => { - return [ - <> - onOpenEditSiteConfigDialog(event, row)}> - Edit Config - , - onOpenDeleteSiteConfigDialog(event, row)}> - Delete Config - , - ]; - }; - - useEffect(() => { - if (isDialogClosed) { - setShouldRefreshTable(true); - setIsDialogClosed(false); - } - }, [isDialogClosed]); - - return ( - <> - {isLoading && ( -
- -
- )} - { - return getContextMenu(selectedRowData); - }} - /> - - - - {'Edit Configuration for the band ' + rowData?.band} - - - Configuration - - { setComment(event.target.value); }} id='edit-comment' label='Comment' aria-label='edit-comment' - type='text' fullWidth /> - - - - - - - -
- {saveInfoMessage.message.length > 0 && !saveInfoMessage.error && ( - {saveInfoMessage.message} - )} - {saveInfoMessage.message.length > 0 && saveInfoMessage.error && ( - {'Save Failed - ' + saveInfoMessage.message} - )} -
-
- - - {'Add Configuration for the Site'} - - Band - - - - Configuration - - { setComment(event.target.value); }} id='addConfig-comment' label='Comment' aria-label='addConfig-comment' - type='text' fullWidth /> - - - - - - -
- {saveInfoMessage.message.length > 0 && !saveInfoMessage.error && ( - {saveInfoMessage.message} - )} - {saveInfoMessage.message.length > 0 && saveInfoMessage.error && ( - {'Save Failed - ' + saveInfoMessage.message} - )} -
-
- - - {'Delete Frequency Plan from the Site'} - {'Do you really want to remove this configuration for band:' + rowData?.band} - - - - - -
- {saveInfoMessage.message.length > 0 && !saveInfoMessage.error && ( - {saveInfoMessage.message} - )} - {saveInfoMessage.message.length > 0 && saveInfoMessage.error && ( - {'Save Failed - ' + saveInfoMessage.message} - )} -
-
- - ); -}; - -export default SiteConfigurationComponent; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteDetails.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteDetails.tsx deleted file mode 100644 index c078231..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteDetails.tsx +++ /dev/null @@ -1,216 +0,0 @@ -import React, { useState } from 'react'; - -import CancelIcon from '@mui/icons-material/Cancel'; -import EditIcon from '@mui/icons-material/Edit'; -import SaveIcon from '@mui/icons-material/Save'; -import { FormControl, InputLabel, MenuItem, Select, Typography } from '@mui/material'; -import IconButton from '@mui/material/IconButton'; -import TextField from '@mui/material/TextField'; -import makeStyles from '@mui/styles/makeStyles'; - -import { useApplicationDispatch } from '../../../../framework/src/flux/connect'; - -import { loadAllAvailableSiteTypesAsync } from '../actions/siteManagerTreeActions'; -import { Sites } from '../models/siteManager'; -import siteManagerService from '../services/siteManagerService'; - -const useStyles = makeStyles({ - formContainer: { - position: 'relative', - paddingRight: '48px', - }, - iconContainer: { - position: 'absolute', - top: '8px', - right: '0', - display: 'flex', - zIndex: 1, - }, -}); - -type Address = { - streetAndNr: string; - city: string; - zipCode: string; - country: string; -}; - -type Location = { - lon: string; - lat: string; -}; - -interface AvailableSiteTypes { - keyId: number; - type: string; -} - -type SiteDetailsProps = { - siteDetails: { - id: string; - uuid: string; - name: string; - amslInMeters: string; - type: string; - 'area-id': string; - 'item-count': number; - address: Address; - operator: string; - location: Location; - [key: string]: any; - }; -}; - -const SiteDetailsAccordion: React.FC = (props: SiteDetailsProps) => { - const classes = useStyles(); - const dispatch = useApplicationDispatch(); - const getAllAvailableSiteTypes = async () => dispatch(loadAllAvailableSiteTypesAsync()); - - const [formState, setFormState] = useState(props.siteDetails); - const [siteTypesData, setSiteTypesData] = useState([]); - const [isEditing, setIsEditing] = useState(false); - const [saveInfoMessage, setSaveInfoMessage] = React.useState<{ message: string; error: boolean }>({ message: '', error: false }); - - const handleInputChange = (event: React.ChangeEvent) => { - const { name, value } = event.target; - - setFormState((prevFormData) => ({ - ...prevFormData, - [name]: value, - })); - }; - - const handleNestedInputChange = (event: React.ChangeEvent) => { - const { name, value } = event.target; - const [parent, key] = name.split('.'); - - setFormState((prevFormData) => ({ - ...prevFormData, - [parent]: { - ...(prevFormData[parent as keyof Sites] as object), - [key]: value, - }, - })); - - }; - - const handleEditClick = () => { - setIsEditing(true); - setSaveInfoMessage({ message: '', error: false }); - }; - - const handleCancelClick = () => { - setFormState(props.siteDetails); - setIsEditing(false); - }; - - const handleSubmit = () => { - const editedFields: Sites = Object.keys(formState).reduce((acc, key) => { - if (formState[key as keyof Sites] !== props.siteDetails[key as keyof Sites]) { - acc[key as keyof Sites] = formState[key as keyof Sites]; - } - return acc; - }, {}); - siteManagerService.saveModifiedSiteDetails(editedFields, formState.id).then((result) => { - setSaveInfoMessage(result); - }); - setIsEditing(false); - }; - - const fetchAllAvailableSiteTypes = async () => { - try { - const data: any = await getAllAvailableSiteTypes(); - const tableData: any[] = data.map((row: any) => ({ - type: row, - })); - setSiteTypesData(tableData); - } catch (error) { - console.error('Error fetching all Site types:', error); - } - }; - - React.useEffect(() => { - setFormState(props.siteDetails); - fetchAllAvailableSiteTypes(); - setSaveInfoMessage({ message: '', error: false }); - }, [props.siteDetails]); - - return ( - <> -
-
-
-
-
-
-
-
-
-
-
- - type - - -
- - {isEditing ? ( -
- { e.preventDefault(); handleSubmit(); }}> - - - - - -
- ) : ( - - - - )} - -
- { - saveInfoMessage.message.length > 0 && (!saveInfoMessage.error) && - {saveInfoMessage.message} - } - { - saveInfoMessage.message.length > 0 && saveInfoMessage.error && - {'Save Failed - ' + saveInfoMessage.message} - } -
-
- - ); -}; - -export default SiteDetailsAccordion; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteManagerSiteSearch.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteManagerSiteSearch.tsx deleted file mode 100644 index 365dc04..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteManagerSiteSearch.tsx +++ /dev/null @@ -1,130 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useRef } from 'react'; - -import SearchIcon from '@mui/icons-material/Search'; -import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore'; -import { Divider, IconButton, InputBase, Paper } from '@mui/material'; -import makeStyles from '@mui/styles/makeStyles'; - -import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { SearchValueAction } from '../actions/siteManagerSiteSearchAction'; - -const styles = makeStyles({ - root: { - padding: '5px', - display: 'flex', - alignItems: 'center', - flexDirection: 'row', - width: '70%', - zIndex: 1, - }, - input: { - flex: 1, - marginLeft: 5, - }, - iconButton: { - padding: 10, - }, - divider: { - height: 28, - margin: 4, - }, -}); -interface SearchProps { - handleRefresh: (event: React.SyntheticEvent) => void; - handleSearch: (event: React.SyntheticEvent, searchValue: string, searchCategoryName?: string) => void; -} - -type SiteManagerSiteSearchProps = SearchProps; - -const SiteManagerSiteSearch: React.FunctionComponent = (props) => { - const classes = styles(); - const buttonRef = useRef(null); - const searchTerm = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.searchSite.siteId); - const searchCategoryName = useSelectApplicationState((state: IApplicationStoreState) => state.siteManager.searchSite.categoryName); - - const dispatch = useApplicationDispatch(); - const setSearchTerm = (siteId: string, categoryName?: string) => dispatch(new SearchValueAction(siteId, categoryName)); - const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path)); - - - React.useEffect(() => { - if (buttonRef.current) { - buttonRef.current.click(); - } - }, []); - - - const handleClick = async (event: React.SyntheticEvent) => { - event.preventDefault(); - if (searchCategoryName && searchCategoryName.length > 0) { - navigateToApplication('siteManager', 'treeview/' + searchTerm + '/' + searchCategoryName); - if (searchTerm.length > 0) { - await props.handleSearch(event, searchTerm, searchCategoryName); - } - } else { - navigateToApplication('siteManager', 'treeview/' + searchTerm); - if (searchTerm.length > 0) { - await props.handleSearch(event, searchTerm); - } - } - }; - - const handleRefresh = async (event: React.SyntheticEvent) => { - setSearchTerm(''); - await props.handleRefresh(event); - event.preventDefault(); - }; - - return <> - - setSearchTerm(e.currentTarget.value)} - /> - - - - - - - - - - ; -}; - -export default SiteManagerSiteSearch; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteManagerTreeview.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteManagerTreeview.tsx deleted file mode 100644 index c8214ab..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteManagerTreeview.tsx +++ /dev/null @@ -1,1212 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -import React, { useEffect, useRef, useState } from 'react'; - -import { ExpandMoreOutlined } from '@mui/icons-material'; -import { default as SiteMap } from '@mui/icons-material/Map'; -import TreeItem, { treeItemClasses, TreeItemProps } from '@mui/lab/TreeItem'; -import TreeView from '@mui/lab/TreeView'; -import { Accordion, AccordionDetails, AccordionSummary, Button, IconButton, Paper, Typography } from '@mui/material'; -import CircularProgress from '@mui/material/CircularProgress'; -import Collapse from '@mui/material/Collapse'; -import { alpha, styled } from '@mui/material/styles'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; -import { TransitionProps } from '@mui/material/transitions'; -import { makeStyles } from '@mui/styles'; -import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { loadAllSiteDetailsBySiteIdAsync } from '../actions/sitedocManagementAction'; -import { loadTreeSiteSearchBySiteIdOrNameAsync } from '../actions/siteManagerSiteSearchAction'; -import { - loadAllAreasByAreaIdAsync, loadAllCategoriesBySiteIdAsync, loadAllCategoryItemsBySiteIdAsync, - loadAllCountriesAsync, loadAllSiteBySiteIdAsync, loadAllSitesByAreaIdAsync, -} from '../actions/siteManagerTreeActions'; -import SiteManagerSiteSearch from '../components/siteManagerSiteSearch'; -import { - ITreeViewItem, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems, - SiteManagerSiteOrderItemsDetails, Sites, -} from '../models/siteManager'; -import CreateOrderView from '../views/OrderCreation'; -import DeviceTableView from './deviceTable'; -import LinkTableView from './linkTable'; -import { MessageDialog } from './messageDialog'; -import PicturesView from './picturesTable'; -import SiteAdditionalInformation from './siteAdditionalInformation'; -import SiteConfigurationComponent from './siteConfiguration'; -import SiteDetailsAccordion from './siteDetails'; -import SiteOrdersView from './siteOrdersTable'; -import { CustomContent } from './treeItem'; -import TSSReportsView from './tssReportsTable'; - -const styles = makeStyles({ - root: { - flex: '1 0 0%', - display: 'flex', - flexDirection: 'row', - }, - iconButton: { - padding: 10, - }, - paperTreeView: { - width: '50%', - padding: '5px', - display: 'flex', - flexDirection: 'column', - zIndex: 1, - }, - paperDisplayView: { - position: 'relative', - width: '100%', - padding: '5px', - display: 'flex', - flexDirection: 'column', - zIndex: 1, - }, - searchParentDiv: { - padding: '5px', - display: 'flex', - flexDirection: 'row', - position: 'relative', - }, - emptyDiv: { - width: '30%', - }, - tree: { - height: '700px', - flexGrow: 1, - maxWidth: '600px', - overflowY: 'auto', - overflowX: 'auto', - }, - table: { - borderTopWidth: 3, - borderBottomWidth: 3, - borderColor: 'grey', - borderStyle: 'solid', - top: '15px', - width: '100%', - padding: '15px', - 'bordercollapse': 'collapse', - 'paddingbottom': '12px', - 'text-align': 'left', - 'color': 'black', - }, - tableDetails: { - border: '1px solid black', - padding: '5px', - }, - selectedSearchNode: { - backgroundColor: '#D0CDCD', - }, - normalNode: { - }, - accordionTitle: { - width: '33%', flexShrink: 0, - }, - iconContainer: { - position: 'absolute', - top: '50px', - right: '0', - display: 'flex', - zIndex: 1, - }, - loadingSpinnerDisplayView: { - position: 'absolute', - top: 0, - left: 0, - marginTop: '50px', - width: '100%', - height: '100%', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - backgroundColor: 'rgba(255, 255, 255, 0.7)', - zIndex: 9999, - }, - loadingSpinnerTreeView: { - position: 'absolute', - top: 0, - left: 0, - marginTop: '350px', - width: '100%', - height: '100%', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - backgroundColor: 'rgba(255, 255, 255, 0.7)', - zIndex: 9999, - }, -}); -interface CategoryIdMap { - [index: string]: ITreeViewItem; -} - -type SiteManagerTreeviewComponentState = { - nodes: ITreeViewItem[]; - expanded: string[]; - selected: string; - parentChildMap: Map; - selectedSite: Sites; - isSite: boolean; - isCategory: boolean; - isCategoryExpanded: boolean; - sitesList: string[]; - treeItemName: string; - siteManagerCategoryItems: SiteManagerCategoryItems; - siteManagerSiteOrderItems: SiteManagerSiteOrderItemsDetails; - categoryList: string[]; - categoryIdMap: CategoryIdMap; - selectedCategoryLinkType: string; - searchLeafParent: string[]; - selectedSearchItem: string; - siteId: string; - isDialogOpen: boolean; - openDialog: boolean; - dialogMessage: string; - isFromSearch: boolean; - isFocused: boolean; - isReady: boolean; - isLoadingTreeView: boolean; - isLoadingDisplayView: boolean; - searchSiteSelected: ITreeViewItem; -}; - -function MinusSquare(props: SvgIconProps) { - return ( - - - - ); -} - -function PlusSquare(props: SvgIconProps) { - return ( - - - - ); -} - -function CloseSquare(props: SvgIconProps) { - return ( - - - - ); -} - -function TransitionComponent(props: TransitionProps) { - return ( - - ); -} - -const StyledTreeItem = styled((props: TreeItemProps) => ( - -))(({ theme }) => ({ - [`& .${treeItemClasses.iconContainer}`]: { - '& .close': { - opacity: 0.3, - }, - }, - [`& .${treeItemClasses.group}`]: { - marginLeft: 15, - paddingLeft: 18, - borderLeft: `1px dashed ${alpha(theme.palette.text.primary, 0.4)}`, - }, - [`& .${treeItemClasses.selected}`]: { - backgroundColor: '#D0CDCD !important', - }, -})); - -const SiteManagerTreeViewComponent: React.FC = () => { - useSelectApplicationState((state: IApplicationStoreState) => state.siteManager); - const dispatch = useApplicationDispatch(); - const getCountryList = async () => dispatch(loadAllCountriesAsync()); - const getAreaList = async (areaId: string) => dispatch(loadAllAreasByAreaIdAsync(areaId)); - const getSiteList = async (areaId: string) => dispatch(loadAllSitesByAreaIdAsync(areaId)); - const getCategoryList = async (siteId: string) => dispatch(loadAllCategoriesBySiteIdAsync(siteId)); - const getSiteDetailsBySiteId = async (siteId: string) => dispatch(loadAllSiteBySiteIdAsync(siteId)); - const getCategoryItemsBySiteId = async (siteId: string, categoryName: string) => dispatch(loadAllCategoryItemsBySiteIdAsync(siteId, categoryName)); - const getSiteDetailsWithContactsBySiteId = async (siteId: string) => dispatch(loadAllSiteDetailsBySiteIdAsync(siteId)); - const searchSiteIdTrail = async (searchValue: string) => dispatch(loadTreeSiteSearchBySiteIdOrNameAsync(searchValue)); - - const [state, setState] = useState({ - nodes: [], - parentChildMap: new Map(), - selectedSite: { - id: '', - uuid: '', - name: '', - amslInMeters: '', - type: '', - 'area-id': '', - 'item-count': 0, - address: { - streetAndNr: '', - city: '', - zipCode: '', - country: '', - }, - operator: '', - location: { - lon: '', - lat: '', - }, - }, - expanded: [], - selected: '', - isSite: false, - isCategory: false, - isCategoryExpanded: false, - sitesList: [], - treeItemName: '', - siteManagerCategoryItems: [{ - name: '', - url: '', - 'last-update': '', - }], - siteManagerSiteOrderItems: [{ - assignedUser: '', - state: '', - note: '', - tasks: [{ - type: '', - description: '', - completed: false, - }], - }], - categoryList: [], - categoryIdMap: {}, - selectedCategoryLinkType: '', - searchLeafParent: [], - selectedSearchItem: '', - siteId: '', - isDialogOpen: false, - openDialog: false, - dialogMessage: '', - isFromSearch: false, - isFocused: false, - isReady: false, - isLoadingTreeView: false, - isLoadingDisplayView: false, - searchSiteSelected: { - id: '', - areaCount: 0, - isCategory: false, - isNodeSelected: false, - isSite: false, - name: '', - parentId: '', - siteCount: 0, - }, - }); - - const treeRef = useRef(null); - const categoriesWithDownloadOption = ['mtssr', 'order', 'Pictures']; - const categoriesForTables = ['microwave', 'node', 'fibre']; - const classes = styles(); - const MAX_SITES_COUNT = 100; - - const categoriesIdDisplayNameMap = new Map([ - ['order', 'Site Orders'], - ['mtssr', 'TSS-Reports'], - ['Pictures', 'Photos'], - ['node', 'Nodes'], - ['fibre', 'Optical Links'], - ['microwave', 'MW Links'], - ]); - - const categoriesDisplayNameIdMap = new Map([ - ['Site Orders', 'order'], - ['TSS-Reports', 'mtssr'], - ['Photos', 'Pictures'], - ['Nodes', 'node'], - ['Optical Links', 'fibre'], - ['MW Links', 'microwave'], - ]); - - /** - * Function to get the reverse trail of parents to help find the right trail - * to append or identify the parent for a child/the children - */ - const getTrail = (nodeId: string, trail: string[]) => { - trail.push(nodeId); - if (state.parentChildMap.has(nodeId.toString())) { - const superParentId = state.parentChildMap.get(nodeId.toString()) + ''; - getTrail(superParentId, trail); - } - }; - - /** - * Function to add the sites to a given area - */ - const addSiteToLeafArea = (nodes: ITreeViewItem[], site: ITreeViewItem) => { - for (let iter = 0; iter < nodes.length; iter++) { - const node = nodes[iter]; - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - node.children ? node.children : node.children = []; - if (node.id === site.parentId) { - node.children.push(site); - state.parentChildMap.set(site.id.toString(), node.id.toString()); - break; - } else { - addSiteToLeafArea(node.children, site); - } - } - }; - - /** - * Add tree items of sites under area - */ - const addTreeItemSites = (parentId: string, sites: Sites[]) => { - const maxSize = sites.length <= MAX_SITES_COUNT ? sites.length : MAX_SITES_COUNT; - const siteCountTotal = sites.length; - if (sites.length > MAX_SITES_COUNT) { - window.alert(`There are ${siteCountTotal} sites in this area, showing just ${MAX_SITES_COUNT} sites`); - } - const nodes: ITreeViewItem[] = []; - for (var iter = 0; iter < maxSize; iter++) { - const site = sites[iter]; - let node: ITreeViewItem = { - id: site.id.toString(), - name: site.id, - isSite: true, - isCategory: false, - parentId: parentId, - siteCount: site['item-count'], - areaCount: 0, - isNodeSelected: false, - }; - state.sitesList.push(site.id.toString()); - state.parentChildMap.set(node.id.toString(), node.parentId.toString()); - nodes.push(node); - } - return nodes; - }; - - /** - * Add categories to site in the tree items - */ - const addTreeItemCategories = (siteId: string, categories: SiteManagerCategories[]) => { - const nodes: ITreeViewItem[] = categories.map(category => { - const categoryId: string = category.id; - const categoryName: string = categoriesIdDisplayNameMap.get(category.id) + ''; - let node: ITreeViewItem = { - id: siteId + '#' + categoryId, - name: categoryName, - isSite: false, - isCategory: true, - parentId: siteId, - siteCount: 0, - areaCount: 0, - isNodeSelected: false, - }; - state.categoryIdMap[node.id] = node; - state.categoryList.push(node.id); - state.parentChildMap.set(node.id.toString(), siteId.toString()); - return node; - }); - return nodes; - }; - - /** - * Add tree items of areas under area - */ - const addTreeItemAreas = (areas: SiteManagerAreas[], isSearch?: boolean, - selectedSite?: string, searchValue?: string): ITreeViewItem[] => { - const nodes: ITreeViewItem[] = areas.map(area => { - let node: ITreeViewItem = { - id: area.id.toString(), - name: area.name, - isSite: false, - isCategory: false, - treeLevel: area['tree-level'], - parentId: area['parent-id'] + '', - areaCount: area['area-count'] ? area['area-count'] : 0, - siteCount: area['site-count'] ? area['site-count'] : 0, - siteLevel: area['site-level'], - isNodeSelected: false, - }; - if (area['parent-id']) { - state.parentChildMap.set(node.id.toString(), node.parentId.toString()); - } - if (isSearch) { - state.expanded.push(area.id.toString()); - // eslint-disable-next-line no-param-reassign - selectedSite = area.id == searchValue ? area.id.toString() : ''; - if (area.areas) { - node.children = addTreeItemAreas(area.areas, isSearch, selectedSite, searchValue); - } else { - state.searchLeafParent.push(area.id.toString()); - } - } - return node; - }); - return nodes; - }; - - const setOpenDialog = async (openDialog: boolean, dialogMessage: string, isFromSearch: boolean) => { - setState({ - ...state, - openDialog: openDialog, - dialogMessage: dialogMessage, - isFromSearch: isFromSearch, - }); - }; - - /** - * Function to append children to the right parent node by navigating through the tree list - */ - const appendChildrenToParentObject = async (nodes: ITreeViewItem[], trail: string[], forceUpdateChildren: boolean) => { - const searchId = trail.pop(); - if (searchId === undefined) - return nodes; - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if ((node.id.toString()) == searchId) { - if (node.isSite && forceUpdateChildren) { - node.children = []; - } - const children = node.children ? node.children : []; - if (children.length > 0) { - await appendChildrenToParentObject(children, trail, forceUpdateChildren); - } else { - if (node.siteLevel && node.areaCount == 0) { - await getSiteList(searchId).then((sitesList: any) => { - if (sitesList.isError) { - setOpenDialog(true, sitesList.errorMessage, false); - return; - } - const childNodes = addTreeItemSites(searchId, sitesList.sites); - node.children = childNodes; - }); - } else if (node.isSite) { - await getCategoryList(searchId).then((categories: any) => { - const childNodes = addTreeItemCategories(searchId, categories); - node.children = childNodes; - }); - } else if (!node.isCategory) { - await getAreaList(searchId).then((areas: any) => { - const childNodes = addTreeItemAreas(areas); - node.children = childNodes; - }); - } - } - break; - } - } - return nodes; - }; - - /** - * Function to expand or collapse tree item - * If child items are not loaded, it calls the async function to load the child items - */ - const toggleTreeItems = async (nodeId: string, expanded: boolean) => { - const strNodeId: string = nodeId.toString(); - const trail: string[] = []; - if (expanded) { - const expandedTree = state.expanded.filter(item => item !== strNodeId); - setState({ - ...state, - expanded: expandedTree, - isFocused: false, - }); - return; - } - getTrail(strNodeId, trail); - await appendChildrenToParentObject(state.nodes, trail, false).then((nodes) => { - setState({ - ...state, - nodes: nodes, - isFocused: false, - }); - state.expanded.push(strNodeId); - }); - }; - - /** - * Clear selected item during search - */ - const clearSelection = async (nodes: ITreeViewItem[], trail: string[], selectedItem: string) => { - const searchId = trail.pop(); - if (searchId === undefined) - return; - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (node.id === searchId) { - if (searchId == selectedItem) { - setState({ - ...state, - selectedSearchItem: '', - isFocused: false, - }); - node.isNodeSelected = false; - return; - } - const children = node.children ? node.children : []; - if (children.length > 0) { - clearSelection(children, trail, selectedItem); - } - return; - } - } - }; - - /** - * Function to retrieve the details of site or category on click of the tree item - */ - const retrieveDetails = async (siteId: string, isCallFromSearch: boolean) => { - const selectedSearchItem = state.selectedSearchItem + ''; - if (!isCallFromSearch && (selectedSearchItem.length > 0)) { - const trail: string[] = []; - getTrail(state.selectedSearchItem, trail); - await clearSelection(state.nodes, trail, state.selectedSearchItem); - } - const returnedSiteValue = state.sitesList.find(site => site.toString() == siteId.toString()); - if (returnedSiteValue && state.selectedSite.id != returnedSiteValue) { - const trail: string[] = []; - getTrail(siteId + '', trail); - await appendChildrenToParentObject(state.nodes, trail, true).then((nodes) => { - setState({ ...state, nodes: nodes }); - state.expanded.push(siteId + ''); - }); - await getSiteDetailsBySiteId(siteId).then((site: any) => { - setState({ - ...state, - selectedSite: site, - isSite: true, - isCategory: false, - isCategoryExpanded: false, - isLoadingDisplayView: false, - treeItemName: site.name, - selected: site.id, - }); - }); - } else if (state.selectedSite.id == returnedSiteValue) { - } else { - const returnedCategoryValue = state.categoryList.find((category) => category === siteId); - if (returnedCategoryValue) { - const ids = siteId.split('#'); - if (state.selectedSite.id != ids[0]) { - await getSiteDetailsBySiteId(ids[0]).then((site: any) => { - setState({ - ...state, - selectedSite: site, - isSite: true, - isLoadingDisplayView: false, - treeItemName: site.name, - }); - }); - const trail: string[] = []; - getTrail(siteId + '', trail); - appendChildrenToParentObject(state.nodes, trail, true).then((nodes) => { - setState({ ...state, nodes: nodes }); - state.expanded.push(siteId + ''); - }); - } - if (categoriesWithDownloadOption.includes(ids[1])) { - await getCategoryItemsBySiteId(ids[0], ids[1]).then(async (categoryItems: any) => { - const categoryName = categoriesIdDisplayNameMap.get(ids[1]) + ''; - if (categoryName.includes('Site Orders')) { - await getSiteDetailsWithContactsBySiteId(siteId).then((siteOrderItems: any) => { - setState({ - ...state, - isCategory: true, - isCategoryExpanded: true, - siteManagerCategoryItems: categoryItems, - siteManagerSiteOrderItems: siteOrderItems, - treeItemName: categoryName, - selected: siteId, - selectedCategoryLinkType: '', - }); - }); - } else { - setState({ - ...state, - isCategory: true, - isCategoryExpanded: true, - siteManagerCategoryItems: categoryItems, - treeItemName: categoryName, - selected: siteId, - selectedCategoryLinkType: '', - }); - } - }); - } else if (categoriesForTables.includes(ids[1])) { - // const selectedCategory = state.categoryIdMap[siteId]; - const categoryName = categoriesIdDisplayNameMap.get(ids[1]) + ''; - setState({ - ...state, - isCategory: true, - isCategoryExpanded: true, - treeItemName: categoryName, - selected: siteId, - selectedCategoryLinkType: ids[1] ? ids[1] : '', - }); - } - } else { - setState({ - ...state, - selectedSite: { - id: '', - uuid: '', - name: '', - amslInMeters: '', - type: '', - 'area-id': '', - 'item-count': 0, - address: { - streetAndNr: '', - city: '', - zipCode: '', - country: '', - }, - operator: '', - location: { - lon: '', - lat: '', - }, - }, - isSite: false, - isCategory: false, - isCategoryExpanded: false, - siteManagerCategoryItems: [{ - name: '', - url: '', - 'last-update': '', - }], - treeItemName: '', - selected: '', - selectedSearchItem: '', - selectedCategoryLinkType: '', - isFocused: false, - isReady: false, - isLoadingDisplayView: false, - }); - } - } - }; - - /** - * Function to render the expandable tree item or leaf tree item - */ - const renderChildren = (node: ITreeViewItem) => { - const strNodeId = node.id.toString(); - return node.isCategory || node.isSite && node.siteCount == 0 || node.siteLevel && node.siteCount == 0 || - !node.isSite && !node.siteLevel && node.areaCount == 0 ? - ( - } endIcon={} > - {Array.isArray(node.children) - ? node.children.map((child) => renderChildren(child)) - : null} - - ) - : ( - } endIcon={}> - {Array.isArray(node.children) - ? node.children.map((child) => renderChildren(child)) - : null} - - ); - }; - - /** - * Function to scroll and Focus on the searched item on click of search - */ - const scrollAndFocus = (searchValue: string) => { - if (state.isReady && searchValue && searchValue !== '') { - const matchingNode = treeRef.current?.querySelector(`[id="site-manager-treeview-${searchValue}"]`); - if (matchingNode) { - state.isFocused = true; - state.isReady = false; - matchingNode.scrollIntoView({ behavior: 'smooth', block: 'center' }); - } - } - }; - - /** - * Function to handle on click of search - */ - const handleSearch = async (event: React.SyntheticEvent, searchValue: string, searchCategoryName?: string) => { - event.preventDefault(); - setState((prevState) => ({ - ...prevState, - nodes: [], - parentChildMap: new Map(), - selectedSite: { - id: '', - uuid: '', - name: '', - amslInMeters: '', - type: '', - 'area-id': '', - 'item-count': 0, - address: { - streetAndNr: '', - city: '', - zipCode: '', - country: '', - }, - operator: '', - location: { - lon: '', - lat: '', - }, - }, - expanded: [], - selected: '', - isSite: false, - isCategory: false, - isCategoryExpanded: false, - searchLeafParent: [], - treeItemName: '', - categoryIdMap: {}, - selectedCategoryLinkType: '', - selectedSearchItem: '', - siteId: '', - isDialogOpen: false, - isFocused: false, - isReady: false, - isLoadingTreeView: true, - searchSiteSelected: { - id: '', - areaCount: 0, - isCategory: false, - isNodeSelected: false, - isSite: false, - name: '', - parentId: '', - siteCount: 0, - }, - })); - await searchSiteIdTrail(searchValue).then(async (searchResult: any) => { - if (searchResult.isError) { - // alert(searchResult.errorMessage); - setOpenDialog(true, searchResult.errorMessage, true); - return; - } - let selected: string = ''; - let selectedSearchItem = ''; - const areas = searchResult.areas ? searchResult.areas : []; - const nodes = await addTreeItemAreas(areas, true, selected, searchValue); - const sites = searchResult.sites ? searchResult.sites : []; - let searchSiteSelected = state.searchSiteSelected; - if (sites.length > 0) { - let sitesCount = sites.length; - if (sites.length > MAX_SITES_COUNT) { - window.alert('There are more than 100 Sites in this area of searched site, showing first 100'); - sitesCount = MAX_SITES_COUNT; - } - for (let iter = 0; iter < sitesCount; iter++) { - const siteItr = sites[iter]; - let isNodeSelected = false; - if (siteItr.id == searchValue) { - selected = siteItr.id; - selectedSearchItem = siteItr.id; - isNodeSelected = true; - } - if (siteItr.name) { - if (siteItr.name.toUpperCase() == searchValue.toUpperCase()) { - selected = siteItr.id; - selectedSearchItem = siteItr.id; - isNodeSelected = true; - } - } - const site: ITreeViewItem = { - id: siteItr.id, - name: siteItr.id, - isSite: true, - isCategory: false, - parentId: siteItr['area-id'], - siteCount: siteItr['item-count'], - areaCount: 0, - isNodeSelected: isNodeSelected, - }; - if (isNodeSelected) - searchSiteSelected = site; - state.sitesList.push(site.id); - addSiteToLeafArea(nodes, site); - } - } - state.nodes = nodes; - state.selected = selected; - state.selectedSearchItem = selectedSearchItem; - state.isReady = true; - state.isLoadingTreeView = false; - state.isLoadingDisplayView = true; - state.searchSiteSelected = searchSiteSelected; - }); - await retrieveDetails(state.selected, true); - if (searchCategoryName && categoriesDisplayNameIdMap.get(searchCategoryName)) { - const categoryId = state.selected + '#' + categoriesDisplayNameIdMap.get(searchCategoryName); - setState((prevState) => ({ - ...prevState, - selected: categoryId, - })); - await retrieveDetails(categoryId, true); - state.searchSiteSelected.isNodeSelected = false; - state.categoryIdMap[categoryId].isNodeSelected = true; - await scrollAndFocus(categoryId); - } - scrollAndFocus(state.selectedSearchItem); - }; - - /** - * Function to refresh the site manager view to its initial state - */ - const handleRefresh = async () => { - setState({ - ...state, - nodes: [], - parentChildMap: new Map(), - expanded: [], - selected: '', - isSite: false, - isCategory: false, - isCategoryExpanded: false, - sitesList: [], - categoryList: [], - categoryIdMap: {}, - selectedSite: { - id: '', - uuid: '', - name: '', - amslInMeters: '', - type: '', - 'area-id': '', - 'item-count': 0, - address: { - streetAndNr: '', - city: '', - zipCode: '', - country: '', - }, - operator: '', - location: { - lon: '', - lat: '', - }, - }, - siteManagerCategoryItems: [{ - name: '', - url: '', - 'last-update': '', - }], - searchLeafParent: [], - treeItemName: '', - selectedCategoryLinkType: '', - siteId: '', - isDialogOpen: false, - openDialog: false, - dialogMessage: '', - isFromSearch: false, - isFocused: false, - isReady: false, - }); - await getCountryList().then((countries: any) => { - const nodes = addTreeItemAreas(countries); - setState({ - ...state, - nodes: nodes, - isFocused: false, - }); - }); - }; - - /** - * Function to open the Create TSS report dialog on click of the button in Site Actions category - */ - const onOpenCreateTSSReportOrderDialog = () => { - setState({ - ...state, - isDialogOpen: true, - }); - }; - /** - * Function to open the Close Create TSS report dialog in Site Actions category - */ - const onCloseCreateTSSReportOrderDialog = async () => { - const siteIdItem = state.selected.toString(); - const selectedSiteId = siteIdItem.split('#')[0] + ''; - const trail: string[] = []; - getTrail(selectedSiteId, trail); - await appendChildrenToParentObject(state.nodes, trail, true).then((nodes) => { - setState({ ...state, nodes: nodes }); - state.expanded.push(selectedSiteId); - }); - setState({ - ...state, - siteId: '', - isDialogOpen: false, - }); - }; - - const handleOnCloseOfDialog = (event: React.SyntheticEvent, isFromSearch: boolean) => { - setOpenDialog(false, '', isFromSearch); - if (isFromSearch) - handleRefresh(); - }; - - const onError = () => { - setState({ - ...state, - siteId: '', - isDialogOpen: false, - }); - }; - - /** - * On initial load/mount of site manager application - */ - useEffect(() => { - const fetchData = async () => { - try { - const countries: any = await getCountryList(); - const nodes = addTreeItemAreas(countries); - setState(prevState => ({ - ...prevState, - nodes: nodes, - isFocused: false, - })); - } catch (error) { - } - }; - fetchData(); - }, []); - - return ( -
-
- -
-
- {state.isLoadingTreeView && ( -
- -
- )} - -
-
- {state.selected.length > 0 ? - } - defaultExpandIcon={} - defaultEndIcon={} - defaultExpanded={state.expanded} - expanded={state.expanded} - > - {state.nodes.map((item) => renderChildren(item))} - - : } - defaultExpandIcon={} - defaultEndIcon={} - defaultExpanded={state.expanded} - expanded={state.expanded} - > - {state.nodes.map((item) => renderChildren(item))} - - } -
-
- -
- {state.isLoadingDisplayView ? ( -
- -
- ) : ( - <> - {state.isSite ? -
- - } - aria-label="site-details-panel-header" - id="site-detail-panel-header" - > - Site Details - - -
- { - const networkMapBaseUrl = window.location.pathname.split('#')[0]; - const siteId = state.selectedSite.id + ''; - const url = `${networkMapBaseUrl}#/network?siteId=${siteId}`; - window.open(url); - }} - > - - -
- -
-
- - } - aria-label="site-configuration-panel-header" - id="site-detail-panel-header" - > - Site Configuration - - - - - - - } - aria-label="site-action-panel-header" - id="site-detail-panel-header" - > - Site Actions - - -
- -
-
-
- - } - aria-label="site-additional-information-panel-header" - id="site-additional-information-panel-header" - > - Site Additional Information - - - - - -
- : <>} - {state.isCategory ? - - } - aria-label="links-panel-header" - id="location-panel-header" - > - Category Details - - - - - - - - - - - -
{state.treeItemName}
- <> - {state.treeItemName.includes('TSS') ? - - : state.treeItemName.includes('Site Orders') ? - - : state.treeItemName.includes('Photos') ? - - : state.treeItemName.includes('Links') ? - - : state.treeItemName === 'Nodes' ? - - : <> - } - -
-
-
- : <>} - - )} -
-
- {state.isDialogOpen ? ( - - ) : <>} - setState({ ...state, openDialog: value })} - dialogMessage={state.dialogMessage} - onClose={handleOnCloseOfDialog} - isFromSearch={state.isFromSearch} - /> -
-
- ); -}; - -export const SiteManagerTreeView = SiteManagerTreeViewComponent; -export default SiteManagerTreeView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteOrdersTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteOrdersTable.tsx deleted file mode 100644 index 0358862..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteOrdersTable.tsx +++ /dev/null @@ -1,155 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React, { useEffect, useState } from 'react'; - -import { faDownload } from '@fortawesome/free-solid-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import IconButton from '@mui/material/IconButton'; -import makeStyles from '@mui/styles/makeStyles'; - -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; - -import { SiteManagerCategoryItems, SiteManagerSiteOrderItemsDetails } from '../models/siteManager'; - -const styles = makeStyles({ - root: { - '&:hover': { - color: 'blue', - }, - }, -}); - -const SiteOrders = MaterialTable as MaterialTableCtorType; - -type joinSiteOrdersDetailsResult = { - name: string | undefined; - url: string; - assignedUser: string; - state: string; - note: string; - type: string; - description: string; - completed: boolean; -}; - -type SiteOrdersComponentProps = { - siteOrderItems: SiteManagerCategoryItems; - siteOrderItemDetails: SiteManagerSiteOrderItemsDetails; -}; - -const SiteOrdersViewComponent: React.FC = (props) => { - const [siteOrdersTableData, setSiteOrdersTableData] = useState([]); - const [isLoaded, setIsLoaded] = useState(false); - const classes = styles(); - - const downloadSiteOrdersReport = (url: string) => { - let fileName = url.substring( - url.lastIndexOf('/') + 1, - url.lastIndexOf('.'), - ); - fetch(url) - .then(resp => resp.blob()) - .then(blob => { - const reportUrl = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.style.display = 'none'; - a.href = reportUrl; - a.download = fileName; - document.body.appendChild(a); - a.click(); - window.URL.revokeObjectURL(reportUrl); - alert('Report has downloaded!'); - }) - .catch(() => alert('oh no! something went wrong')); - }; - - const joinColumns = () => { - let siteOrdersItemList = props.siteOrderItems; - let siteOrdersDetailsList = props.siteOrderItemDetails; - let updatedSiteOrdersTableData: joinSiteOrdersDetailsResult[] = []; - - siteOrdersItemList.forEach(siteOrder => { - const name = siteOrder.name; - const userName = name.substring(name.lastIndexOf('-') + 1); - let indexDetails = 0; - for (; indexDetails < siteOrdersDetailsList.length; indexDetails++) { - const detail = siteOrdersDetailsList[indexDetails]; - if (userName === detail.assignedUser) { - updatedSiteOrdersTableData.push({ - name: name, - url: siteOrder.url, - assignedUser: userName, - state: detail.state, - note: detail.note, - type: detail.tasks[0]?.type, - description: detail.tasks[0]?.description, - completed: detail.tasks[0]?.completed, - }); - break; - } - } - siteOrdersDetailsList.splice(indexDetails, 1); - }); - siteOrdersItemList.splice(0, siteOrdersItemList.length); - setSiteOrdersTableData(updatedSiteOrdersTableData); - setIsLoaded(true); - }; - - useEffect(() => { - if (!isLoaded) { - joinColumns(); - } - }, [props.siteOrderItems, props.siteOrderItemDetails, isLoaded]); - - return ( - <> - {isLoaded ? ( - { - if (rowData.url === '') { - return (<>{rowData.name}); - } else { - return ( {rowData.name} ); - } - }, - }, - { property: 'state', title: 'State', type: ColumnType.text }, - { property: 'description', title: 'Current Task', type: ColumnType.text }, - { - property: 'url', title: 'Action', type: ColumnType.custom, customControl: ({ rowData }) => { - if (rowData.url === '') { - return ( ); - } else { - return ( - { event.stopPropagation(); downloadSiteOrdersReport(rowData.url); }} /> - ); - } - }, - }, - ]} idProperty='id' rows={siteOrdersTableData} > - ) : ( -
Loading...
- )} - - ); -}; - - -export const SiteOrdersView = SiteOrdersViewComponent; -export default SiteOrdersView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteTable.tsx deleted file mode 100644 index 0cf9eb6..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/siteTable.tsx +++ /dev/null @@ -1,122 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useEffect, useState } from 'react'; - -import Map from '@mui/icons-material/Map'; -import Refresh from '@mui/icons-material/Refresh'; -import { Divider, MenuItem, Typography } from '@mui/material'; - -import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { useSelectApplicationState, useApplicationDispatch } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { SearchValueAction } from '../actions/siteManagerSiteSearchAction'; -import { createSiteTableActions, createSiteTableProperties } from '../handlers/siteTableHandler'; -import { SiteDetails } from '../models/siteDetails'; -import RefreshSiteTableDialog, { RefreshSiteTableDialogMode } from './refreshSiteTableDialog'; - - -const SiteTable = MaterialTable as MaterialTableCtorType; - -let initialSorted = false; - -const SiteTableComponent: React.FC = () => { - const siteTableProperties = useSelectApplicationState((state: IApplicationStoreState) => createSiteTableProperties(state)); - - const dispatch = useApplicationDispatch(); - const siteTableActions = createSiteTableActions(dispatch); - const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path)); - - const [refreshSiteTableEditorMode, setRefreshSiteTableEditorMode] = useState(RefreshSiteTableDialogMode.None); - - const setSearchTerm = (event: React.SyntheticEvent, value: string) => dispatch(new SearchValueAction(value)); - - const getContextMenu = (rowData: SiteDetails) => { - return [ - { - navigateToApplication('siteManager', '/treeview/' + rowData.id); - setSearchTerm(event, rowData.id + ''); - }}> - View in Treeview - , - , - { - const siteId = rowData.id; - const baseUrl = window.location.pathname.split('#')[0]; - const url = `${baseUrl}#/network?siteId=${siteId}`; - window.open(url); - }}> - Show on Map - , - ]; - }; - - useEffect(() => { - if (!initialSorted) { - initialSorted = true; - siteTableActions.onHandleExplicitRequestSort('id', 'asc'); - } else { - siteTableActions.onRefresh(); - } - }, []); - - const refreshSiteTableAction = [{ - icon: Refresh, tooltip: 'Refresh Site Table', ariaLabel: 'refresh', onClick: () => { - setRefreshSiteTableEditorMode(RefreshSiteTableDialogMode.RefreshSiteTableTable); - }, - }, - ...siteTableProperties.showFilter ? [{ - icon: Map, tooltip: 'Show on map', ariaLabel: 'showOnMap', onClick: async () => { - const siteId = siteTableProperties.rows[0].id; - const baseUrl = window.location.pathname.split('#')[0]; - const url = `${baseUrl}#/network?siteId=${siteId}`; - window.open(url); - }, - }] : [], - ]; - - return ( - <> - { - return getContextMenu(rowData); - }} > - - setRefreshSiteTableEditorMode(RefreshSiteTableDialogMode.None)} - /> - - ); -}; - -export const SiteTableView = SiteTableComponent; -export default SiteTableView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/treeItem.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/treeItem.tsx deleted file mode 100644 index 49c1111..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/treeItem.tsx +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint-disable react/prop-types */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React from 'react'; -import { TreeItemContentProps, useTreeItem } from '@mui/lab/TreeItem'; -import Typography from '@mui/material/Typography'; -import clsx from 'clsx'; -import { useSelectApplicationState } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -type TreeItemComponentProps = TreeItemContentProps; - -interface CustomContentProps extends TreeItemComponentProps { - toggleTreeItems: (nodeId: string, expanded: boolean) => Promise; - retrieveDetails: (siteId: string, isCallFromSearch: boolean) => void; - isNodeSelected: boolean; -} - -// Custom TreeItem content -export const CustomContent = React.forwardRef(function CustomContent( - props: CustomContentProps, - ref, -) { - const { - classes, - className, - label, - nodeId, - icon: iconProp, - expansionIcon, - displayIcon, - toggleTreeItems, - retrieveDetails, - isNodeSelected, - - } = props; - - const { - disabled, - expanded, - selected, - focused, - handleExpansion, - handleSelection, - preventSelection, - } = useTreeItem(nodeId); - useSelectApplicationState((state: IApplicationStoreState) => state.siteManager); - - const icon = iconProp || expansionIcon || displayIcon; - - const handleMouseDown = (event: React.MouseEvent) => { - preventSelection(event); - }; - - const handleExpansionClick = async (event: React.MouseEvent) => { - await toggleTreeItems(nodeId, expanded).then(() => { - handleExpansion(event); - }); - handleExpansion(event); - }; - - const handleSelectionClick = (event: React.MouseEvent) => { - retrieveDetails(nodeId, false); - handleSelection(event); - }; - - return ( -
} - > -
- {icon} -
- -
{label}
-
-
- ); -}); - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/tssReportsTable.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/tssReportsTable.tsx deleted file mode 100644 index fb3d99f..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/components/tssReportsTable.tsx +++ /dev/null @@ -1,101 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useState } from 'react'; - -import { faDownload } from '@fortawesome/free-solid-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import IconButton from '@mui/material/IconButton'; -import makeStyles from '@mui/styles/makeStyles'; - -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; - -const styles = makeStyles({ - root: { - '&:hover': { - color: 'blue', - }, - }, -}); - -const TSSReports = MaterialTable as MaterialTableCtorType; - -type TSSReportsComponentProps = { - item: { - name: string; - url: string; - 'last-update': string; - }[]; -}; - -const TSSReportsComponent: React.FC = (props) => { - const [item] = useState(props.item); - - const classes = styles(); - - const downloadTSSReport = (url: string) => { - let fileName = url.substring( - url.lastIndexOf('/') + 1, - ); - fetch(url) - .then(resp => resp.blob()) - .then(blob => { - const reportUrl = window.URL.createObjectURL(blob); - const link = document.createElement('a'); - link.style.display = 'none'; - link.href = reportUrl; - link.setAttribute('download', fileName); - document.body.appendChild(link); - link.click(); - window.URL.revokeObjectURL(reportUrl); - alert('Report has downloaded!'); - }) - .catch(() => alert('oh no! something went wrong')); - }; - - return ( - <> - { - if (rowData.url === '') { - return (<>{rowData.name}); - } else { - return ( {rowData.name} ); - } - }, - }, - { - property: 'url', title: 'Action', type: ColumnType.custom, customControl: ({ rowData }) => { - if (rowData.url === '') { - return ( ); - } else { - return ( - { event.stopPropagation(); downloadTSSReport(rowData.url); }} /> - ); - } - }, - }, - ]} idProperty='id' rows={item} > - - - ); -}; - -export const TSSReportsView = TSSReportsComponent; -export default TSSReportsView; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/config.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/config.ts deleted file mode 100644 index 4052e0f..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/config.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export const URL_API = '/topology/network'; -export const SITEDOC_URL = '/sitedoc'; -export const URL_TILE_API = '/tiles'; // http://tile.openstreetmap.org can be used for local testing, never commit with tile url changed! /tiles - - -export const OSM_STYLE = { - 'version': 8, - 'sources': { - 'raster-tiles': { - 'type': 'raster', - 'tiles': [ - URL_TILE_API + '/{z}/{x}/{y}.png', - ], - 'tileSize': 256, - 'attribution': - '© OpenStreetMap contributors', - }, - }, - 'layers': [ - { - 'id': 'simple-tiles', - 'type': 'raster', - 'source': 'raster-tiles', - 'minZoom': 0, - 'maxZoom': 18, - }, - ], -}; - -export const URL_BASEPATH = 'network'; - - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/detailsReducer.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/detailsReducer.ts deleted file mode 100644 index ef860eb..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/detailsReducer.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* eslint-disable @typescript-eslint/default-param-last */ -/* eslint-disable no-param-reassign */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { - AddToHistoryAction, ClearDetailsAction, ClearHistoryAction, ClearLoadedDevicesAction, FinishedLoadingDeviceListAction, InitializeLoadedDevicesAction, - IsBusyCheckingDeviceListAction, IsSitedocReachableAction, SelectElementAction, -} from '../actions/detailsAction'; -import { HistoryEntry } from '../models/historyEntry'; -import { link } from '../models/link'; -import { Device, Site } from '../models/site'; -import { Service } from '../models/topologyTypes'; - -export type DetailsStoreState = { - data: Site | link | Service | null; - history: HistoryEntry[]; - isBusyCheckingDeviceList: boolean; - checkedDevices: Device[]; - isSitedocReachable: boolean; -}; - -const initialState: DetailsStoreState = { - data: null, - history: [], - isBusyCheckingDeviceList: false, - checkedDevices: [], - isSitedocReachable: false, -}; - -export const DetailsReducer: IActionHandler = (state = initialState, action) => { - if (action instanceof SelectElementAction) { - state = Object.assign({}, state, { data: action.data }); - } else if (action instanceof ClearDetailsAction) { - state = Object.assign({}, state, { data: null }); - } else if (action instanceof AddToHistoryAction) { - state = Object.assign({}, state, { history: [...state.history, action.entry] }); - } else if (action instanceof ClearHistoryAction) { - state = Object.assign({}, state, { history: [] }); - } else if (action instanceof IsBusyCheckingDeviceListAction) { - state = Object.assign({}, state, { isBusyCheckingDeviceList: action.isBusy }); - } else if (action instanceof FinishedLoadingDeviceListAction) { - state = Object.assign({}, state, { checkedDevices: action.devices }); - } else if (action instanceof ClearLoadedDevicesAction) { - state = Object.assign({}, state, { checkedDevices: [] }); - } else if (action instanceof InitializeLoadedDevicesAction) { - state = Object.assign({}, state, { checkedDevices: action.devices }); - } else if (action instanceof IsSitedocReachableAction) { - state = Object.assign({}, state, { isSitedocReachable: action.isReachable }); - } - return state; -}; - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/deviceTableHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/deviceTableHandler.ts deleted file mode 100644 index 628ec2a..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/deviceTableHandler.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { DeviceDetails } from '../models/siteManager'; - -export interface IDeviceTableState extends IExternalTableState { } - -// create elastic search material data fetch handler -const deviceTableSearchHandler = createSearchDataHandler('device', true); - -export const { - actionHandler: deviceTableActionHandler, - createActions: createDeviceTableActions, - createProperties: createDeviceTableProperties, - createPreActions: createDeviceTablePreActions, - reloadAction: deviceTableReloadAction, - - // set value action, to change a value -} = createExternal(deviceTableSearchHandler, appState => appState.siteManager.deviceTable); - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/linkTableHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/linkTableHandler.ts deleted file mode 100644 index cf5312a..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/linkTableHandler.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { LinkDetails } from '../models/siteManager'; - -export interface ILinkTableState extends IExternalTableState { } - -// create elastic search material data fetch handler -const linkTableSearchHandler = createSearchDataHandler('link', true); - -export const { - actionHandler: linkTableActionHandler, - createActions: createLinkTableActions, - createProperties: createLinkTableProperties, - createPreActions: createLinkTablePreActions, - reloadAction: linkTableReloadAction, - - // set value action, to change a value -} = createExternal(linkTableSearchHandler, appState => appState.siteManager.linkTable); - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerAppRootHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerAppRootHandler.ts deleted file mode 100644 index 3bed706..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerAppRootHandler.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -import { SetPanelAction } from '../actions/panelActions'; -import { SearchValueAction } from '../actions/siteManagerSiteSearchAction'; -import { PanelId } from '../models/panelId'; -import { DetailsReducer, DetailsStoreState } from './detailsReducer'; -import { deviceTableActionHandler, IDeviceTableState } from './deviceTableHandler'; -import { ILinkTableState, linkTableActionHandler } from './linkTableHandler'; -import { ManagementHandler, ManagementState } from './sitedocManagementHandler'; -import { siteManagerSiteSearchHandler } from './siteManagerSiteSearchHandler'; -import { areasActionHandler, IAreasState } from './siteManagerTreeHandler'; -import { ISiteTableState, siteTableActionHandler } from './siteTableHandler'; - -export interface ISiteManagerAppStoreState { - siteManagerTree: IAreasState; - searchSite: SearchValueAction; - sitedocManagement: ManagementState; - details: DetailsStoreState; - currentOpenPanel: PanelId; - siteTable: ISiteTableState; - linkTable: ILinkTableState; - deviceTable: IDeviceTableState; -} - -const currentOpenPanelHandler: IActionHandler = (state = null, action) => { - if (action instanceof SetPanelAction) { - state = action.panelId; - } - return state; -}; - - - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - siteManager: ISiteManagerAppStoreState; - } -} - -const actionHandlers = { - siteManagerTree: areasActionHandler, - searchSite: siteManagerSiteSearchHandler, - sitedocManagement: ManagementHandler, - details: DetailsReducer, - currentOpenPanel: currentOpenPanelHandler, - siteTable: siteTableActionHandler, - linkTable: linkTableActionHandler, - deviceTable: deviceTableActionHandler, -}; - -export const siteManagerAppRootHandler = combineActionHandler(actionHandlers); -export default siteManagerAppRootHandler; - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerSiteSearchHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerSiteSearchHandler.ts deleted file mode 100644 index 0c34b08..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerSiteSearchHandler.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { AllTreeSiteSearchBySiteIdOrNameLoadedAction, LoadTreeSiteSearchBySiteIdOrNameAction, SearchValueAction, SetBusyAction } - from '../actions/siteManagerSiteSearchAction'; -import { SearchSiteIdResult } from '../models/siteManager'; - -export type searchState = { - siteId: string; - categoryName: string; - searchValue: SearchSiteIdResult; - busy: boolean; - isLoadingData: boolean; -}; - -const initialState: searchState = { - siteId: '', - categoryName: '', - searchValue: { - areas: [], - sites: [], - isError: false, - errorMessage: '', - }, - busy: false, - isLoadingData: true, -}; - -export const siteManagerSiteSearchHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof SearchValueAction) { - state = Object.assign({}, state, { siteId: action.siteId, categoryName: action.categoryName }); - } else if (action instanceof LoadTreeSiteSearchBySiteIdOrNameAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllTreeSiteSearchBySiteIdOrNameLoadedAction) { - if (action.searchResult) { - state = { - ...state, - searchValue: { - areas: action.searchResult.areas, - sites: action.searchResult.sites, - isError: action.searchResult.isError, - errorMessage: action.searchResult.errorMessage, - }, - busy: false, - }; - } - } else if (action instanceof SetBusyAction) { - state = { - ...state, - isLoadingData: action.busy, - }; - } - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerTreeHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerTreeHandler.ts deleted file mode 100644 index 131f893..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteManagerTreeHandler.ts +++ /dev/null @@ -1,219 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { - AllAreasByAreaIdLoadedAction, AllCategoriesBySiteIdALoadedAction, AllCategoryItemsBySiteIdALoadedAction, - AllCountriesLoadedAction, AllSiteBySiteIdALoadedAction, AllSitesByAreaIdLoadedAction, LoadAllAreasByAreaIdAction, - LoadAllCategoriesBySiteIdAction, LoadAllCategoryItemsBySiteIdAction, LoadAllCountriesAction, LoadAllSiteBySiteIdAction, - LoadAllSitesByAreaIdAction, SetBusyAction, LoadAllFrequencyPlanBySiteIdAction, AllFrequencyPlanBySiteIdALoadedAction, - LoadAllAvailableBandsAction, AllAvailableBandsALoadedAction, -} from '../actions/siteManagerTreeActions'; -import { LinkDetails, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems, SitesListResult } from '../models/siteManager'; -import { Site } from '../models/siteSearch'; - -export interface IAreasState { - countryList: SiteManagerAreas[]; - areaList: SiteManagerAreas[]; - sitesList: SitesListResult; - categoryList: SiteManagerCategories[]; - frequencyPlan: any[]; - bands: any[]; - siteDetails: Site; - categoryItems: SiteManagerCategoryItems; - linksList: LinkDetails[]; - busy: boolean; - isLoadingData: boolean; -} - -const areasStateInit: IAreasState = { - countryList: [], - areaList: [], - sitesList: { - sites: [], - isError: false, - errorMessage: '', - }, - categoryList: [], - frequencyPlan: [], - bands: [], - siteDetails: { - id: '', - uuid: '', - name: '', - 'area-id': '', - 'item-count': 0, - address: { - streetAndNr: '', - city: '', - zipCode: '', - country: '', - }, - operator: '', - location: { - lon: '', - lat: '', - }, - }, - categoryItems: [{ - name: '', - url: '', - 'last-update': '', - }], - linksList: [], - busy: false, - isLoadingData: true, -}; - -export const areasActionHandler: IActionHandler = (state = areasStateInit, action) => { - if (action instanceof LoadAllCountriesAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllCountriesLoadedAction) { - if (action.countriesList) { - state = { - ...state, - countryList: action.countriesList, - busy: true, - }; - } - } else if (action instanceof LoadAllAreasByAreaIdAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllAreasByAreaIdLoadedAction) { - if (action.areaList) { - state = { - ...state, - areaList: action.areaList, - busy: true, - }; - } - } else if (action instanceof LoadAllSitesByAreaIdAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllSitesByAreaIdLoadedAction) { - if (action.sitesList) { - state = { - ...state, - sitesList: action.sitesList, - busy: true, - }; - } - } else if (action instanceof LoadAllCategoriesBySiteIdAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllCategoriesBySiteIdALoadedAction) { - if (action.categoryList) { - state = { - ...state, - categoryList: action.categoryList, - busy: true, - }; - } - } else if (action instanceof LoadAllFrequencyPlanBySiteIdAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllFrequencyPlanBySiteIdALoadedAction) { - if (action.freqPlanList) { - state = { - ...state, - frequencyPlan: action.freqPlanList, - busy: true, - }; - } - } else if (action instanceof LoadAllAvailableBandsAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllAvailableBandsALoadedAction) { - if (action.bandsList) { - state = { - ...state, - bands: action.bandsList, - busy: true, - }; - } - } else if (action instanceof LoadAllSiteBySiteIdAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllSiteBySiteIdALoadedAction) { - if (action.siteDetails) { - state = { - ...state, - siteDetails: { - id: action.siteDetails.id, - name: action.siteDetails.name, - uuid: action.siteDetails.uuid, - 'area-id': action.siteDetails['area-id'], - 'item-count': action.siteDetails['item-count'], - address: { - streetAndNr: action.siteDetails.address ? action.siteDetails.address.streetAndNr : '', - city: action.siteDetails.address ? action.siteDetails.address.city : '', - zipCode: action.siteDetails.address ? action.siteDetails.address.zipCode : '', - country: action.siteDetails.address ? action.siteDetails.address.country : '', - }, - operator: action.siteDetails.operator, - location: { - lon: action.siteDetails.location ? action.siteDetails.location.lon : '', - lat: action.siteDetails.location ? action.siteDetails.location.lat : '', - }, - }, - busy: true, - }; - } - } else if (action instanceof LoadAllCategoryItemsBySiteIdAction) { - state = { - ...state, - busy: true, - }; - } else if (action instanceof AllCategoryItemsBySiteIdALoadedAction) { - if (action.categoryItemList) { - state = { - ...state, - categoryItems: [{ - name: action.categoryItemList[0].name, - url: action.categoryItemList[0].url, - 'last-update': action.categoryItemList[0]['last-update'], - }], - busy: true, - }; - } - } else if (action instanceof SetBusyAction) { - state = { - ...state, - isLoadingData: action.busy, - }; - } - - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteTableHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteTableHandler.ts deleted file mode 100644 index 40a8b19..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/siteTableHandler.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { SiteDetails } from '../models/siteDetails'; - -export interface ISiteTableState extends IExternalTableState { } - -// create elastic search material data fetch handler -const siteTableSearchHandler = createSearchDataHandler('site', true); - -export const { - actionHandler: siteTableActionHandler, - createActions: createSiteTableActions, - createProperties: createSiteTableProperties, - reloadAction: siteTableReloadAction, - - // set value action, to change a value -} = createExternal(siteTableSearchHandler, appState => appState.siteManager.siteTable); - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/sitedocManagementHandler.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/sitedocManagementHandler.ts deleted file mode 100644 index da123f0..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/handlers/sitedocManagementHandler.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { ResetAction, SelectUserAction, SetAllUsersAction, SetTSSRAction, UpdateNoteAction, UpdateStateAction, UpdateTasks } from '../actions/sitedocManagementAction'; -import { SitedocOrderTask, UserListItem } from '../models/siteDocTypes'; - -const emptyTask: SitedocOrderTask = { type: '', description: '', completed: false }; - - -export type ManagementState = { - users: UserListItem[]; - selectedUser: string; - note: string; - tasks: SitedocOrderTask[]; - isTSSR: boolean; - state: string; -}; - -const initialState: ManagementState = { - users: [], - selectedUser: '', - state: 'OPEN', - note: '', - tasks: [emptyTask], - isTSSR: false, -}; - -export const ManagementHandler: IActionHandler = (state = initialState, action) => { - if (action instanceof SetAllUsersAction) { - state = { ...state, users: action.users }; - } else if (action instanceof SelectUserAction) { - state = { ...state, selectedUser: action.user }; - } else if (action instanceof SetTSSRAction) { - state = { ...state, isTSSR: action.isTSSR }; - } else if (action instanceof UpdateNoteAction) { - state = { ...state, note: action.note }; - } else if (action instanceof UpdateStateAction) { - state = { ...state, state: action.state }; - } else if (action instanceof UpdateTasks) { - state = { ...state, tasks: action.tasks }; - } else if (action instanceof ResetAction) { - state = { ...state, tasks: [emptyTask], selectedUser: '', note: '', isTSSR: false }; - } - return state; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/index.html b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/index.html deleted file mode 100644 index 864e7f9..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - SiteManager App - - - -
- - - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/count.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/count.ts deleted file mode 100644 index 8b9b1d8..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/count.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type elementCount = { sites: string; links: string; services: string }; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/historyEntry.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/historyEntry.ts deleted file mode 100644 index e000e8d..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/historyEntry.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { link } from './link'; -import { Site } from './site'; - -export type HistoryEntry = { id: string; data: Site | link }; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/link.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/link.ts deleted file mode 100644 index 004b46f..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/link.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -type Antenna = { - id: string; - name: string; - height: number; - gain: number; -}; - -type LinkDetailLocation = { - lon: number; - lat: number; - siteId: number; - siteName: string | null; - amsl: number | null; - azimuth: number | null; - antenna: Antenna; - radio: { id: number; name: string }; - waveguide: { id: number; name: string }; -}; - -export type link = { - id: number; - uuid: string; - name: string; - operator: string; - length: number; - polarization: string; - type: string; - frequency: number | null; - siteA: LinkDetailLocation; - siteB: LinkDetailLocation; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/networkElementConnection.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/networkElementConnection.ts deleted file mode 100644 index a939f9b..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/networkElementConnection.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type NetworkElementConnection = { - id?: string; - nodeId: string; - isRequired: boolean; - host: string; - port: number; - username?: string; - password?: string; - tlsKey?: string; - status?: 'Connected' | 'mounted' | 'unmounted' | 'Connecting' | 'Disconnected' | 'idle'; - ['device-type']?: string; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/panelId.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/panelId.ts deleted file mode 100644 index 80ca44b..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/panelId.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type PanelId = null | 'TreeView' | 'SiteTable'; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/site.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/site.ts deleted file mode 100644 index e1bde59..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/site.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License; Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Site = { - id: number; - uuid: string; - name: string; - address: Address; - heightAmslInMeters?: number; //AboveGroundLevel - antennaHeightAmslInMeters?: number; - type?: string; - operator: string; - location: { lon: number; lat: number }; - devices: Device[]; - links: { id: number; name: string; azimuth: number | null }[]; - furtherInformation: string; -}; - -export type Address = { - streetAndNr: string; - city: string; - zipCode: string | null; - country: string; -}; - -export type Device = { - id: string; - type?: string; - name: string; - manufacturer: string; - owner: string; - status?: string; - port: number[]; -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteDetails.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteDetails.ts deleted file mode 100644 index ae1a114..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteDetails.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type SiteDetails = { - administrativeState: string; - alarmState: string; - areaId: string; - areaName: string; - forecastEnabled: boolean; - id: number; - labels: []; - latitude: number; - lifecycleState: string; - longitude: number; - name: string; - operationalState: string; - operatorId: string; - uuid: string; -}; - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteDocTypes.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteDocTypes.ts deleted file mode 100644 index d74037a..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteDocTypes.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type UserListItem = { - userName: string; - firstName: string; - lastName: string; -}; - -export type RegisterUser = { - firstName: string; - familyName: string; - email: string; - username: string; - password: string; - telephoneNr: string; - role: 'ANDROID'; -}; - -export type SitedocOrder = { - reportFile: string; - assignedUser: string; - date: string; //in UTC - state: SitedocOrderTypes; - tasks: SitedocOrderTask[]; - note: string; - isTssr: boolean; -}; - -export type SitedocOrderTypes = 'OPEN' | 'UPDATE' | 'DELETE'; - -export type SitedocOrderTask = { - type: string; - description: string; - completed: false; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteManager.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteManager.ts deleted file mode 100644 index fde2f2c..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteManager.ts +++ /dev/null @@ -1,182 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type SiteManagerAreas = { - id: string; - name: string; - 'tree-level': number; - 'parent-id'?: string; - 'area-count'?: number; - 'site-count'?: number; - 'site-level'?: boolean; - 'areas'?: SiteManagerAreas[]; -}; - -export interface ITreeViewItem { - id: string; - name: string; - isSite: boolean; - isCategory: boolean; - parentId: string; - areaCount: number; - siteCount: number; - isNodeSelected: boolean; - uuid?: number; - treeLevel?: number; - siteLevel?: boolean; - url?: string; - linkType?: string; - children?: ITreeViewItem[]; -} - -export type Sites = { - id: string; - uuid: string; - name: string; - amslInMeters: string; - type: string; - 'area-id': string; - 'item-count': number; - address: { - streetAndNr: string; - city: string; - zipCode: string; - country: string; - }; - operator: string; - location: { - lon: string; - lat: string; - }; -}; - -export interface SearchSiteIdResult { - areas: SiteManagerAreas[]; - sites: Sites[]; - isError: boolean; - errorMessage: string; -} - -export interface SitesListResult { - sites: Sites[]; - isError: boolean; - errorMessage: string; -} - -export type SiteManagerCategories = { - id: string; - name: string; - url: string; - 'link-type': string; -}; - -export type SiteManagerCategoryItems = { - name: string; - url: string; - 'last-update': string; -}[]; - -export type SiteManagerSiteOrderItemsDetails = { - assignedUser: string; - state: string; - note: string; - tasks: { - type: string; - description: string; - completed: boolean; - }[]; -}[]; - -export type LinkDetails = { - administrativeState: string; - deviceA: { id: number; nodeId: string; uuid: string }; - deviceB: { id: number; nodeId: string; uuid: string }; - id: number; - labels: []; - lifecycleState: string; - name: string; - operationalState: string; - operatorId: string; - siteA: { - areaId: string; - areaName: string; - id: number; - latitude: number; - longitude: number; - name: string; - operatorId: string; - uuid: string; - }; - siteB: { - areaId: string; - areaName: string; - id: number; - latitude: number; - longitude: number; - name: string; - operatorId: string; - uuid: string; - }; - type: string; - uuid: string; -}; - -export type DeviceDetails = { - areaId: string; - areaName: string; - calculationParameters: string; - id: number; - manufacturerId: number; - manufacturerName: string; - modelId: number; - modelName: string; - nodeId: string; - operationalParameters: string; - siteId: number; - siteName: string; - uuid: string; -}; - -export type SiteConfigurationFreqPlan = [ - { - id: number; - siteId: number; - band: { - id: number; - name: string; - duplexspacingMhz: number; - }; - status: string; - configuration: string; - comment: string; - }, -]; - -export type addEditSiteConfig = { - configuration: string; - comment: string; -}; - - -export type Bands = [ - { - id: number; - name: string; - duplexspacingMhz: number; - }, -]; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteSearch.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteSearch.ts deleted file mode 100644 index 1b59057..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/siteSearch.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - - -export type Site = { - id: string; - uuid: string; - name: string; - 'area-id': string; - 'item-count': number; - address: { - streetAndNr: string; - city: string; - zipCode: string; - country: string; - }; - operator: string; - location: { - lon: string; - lat: string; - }; -}; - -export type SearchResult = { - sites: Site[]; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/stadokSite.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/stadokSite.ts deleted file mode 100644 index e5da7df..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/stadokSite.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -export type Address = { - streetAndNr: string; - city: string; - zipCode: string | null; - country: string; -}; - -type StadokSite = { - id: string; - createdBy: Contact; - updatedOn: Date; - location: { lat: number; lon: number }; - address: Address; - contacts: { manager: Contact; owner: Contact }; - safetyNotices: string[]; - images: string[]; - type: string; - devices: Device[]; - logs: Log[]; -}; - -type Contact = { - firstName: string; - lastName: string; - email: string; - telephoneNumber: string; -}; -type Log = { - date: Date; //string? - person: string; - entry: string; -}; - -type Device = { - 'device': string; - 'antenna': string; -}; - -export default StadokSite; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/topologyTypes.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/topologyTypes.ts deleted file mode 100644 index e6cd361..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/models/topologyTypes.ts +++ /dev/null @@ -1,15 +0,0 @@ -type Route = { lat: number; lon: number }; - -export type Service = { - 'id': number; - 'name': string; - 'type': string; - 'backupForServiceId': number | null; - 'lifecycleState': string; - 'administrativeState': string; - 'operationalState': string; - 'created': string; - 'modified': string; - 'route': Route[]; - 'length': number; -}; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/pluginSiteManager.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/pluginSiteManager.tsx deleted file mode 100644 index 87cb432..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/pluginSiteManager.tsx +++ /dev/null @@ -1,89 +0,0 @@ -/** -* ============LICENSE_START======================================================================== -* ONAP : ccsdk feature sdnr wt odlux -* ================================================================================================= -* Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. -* ================================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software distributed under the License -* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -* or implied. See the License for the specific language governing permissions and limitations under -* the License. -* ============LICENSE_END========================================================================== -*/ - -import React from 'react'; -import { Redirect, Route, RouteComponentProps, Switch, withRouter } from 'react-router-dom'; - -import { useApplicationDispatch } from '../../../framework/src/flux/connect'; -import applicationManager from '../../../framework/src/services/applicationManager'; - -import { loadTreeSiteSearchBySiteIdOrNameAsync, SearchValueAction } from './actions/siteManagerSiteSearchAction'; -import siteManagerAppRootHandler from './handlers/siteManagerAppRootHandler'; -import SiteManager from './views/siteManager'; - -const appIcon = require('./assets/icons/siteManagerAppIcon.svg'); // select app icon - -let currentSearchSiteId: string | undefined = undefined; -let currentSearchCategoryName: string | undefined = undefined; - -interface SearchProps { - handleRefresh: (event: React.SyntheticEvent) => void; - handleSearch: (event: React.SyntheticEvent, searchValue: string) => void; -} - -const SiteManagerTableApplicationRouteAdapter = ((props: SearchProps & RouteComponentProps<{ - searchSiteId?: string; searchCategoryName?: string; -}>) => { - - const dispatch = useApplicationDispatch(); - const setSearchTerm = (siteId: string, categoryName?: string) => dispatch(new SearchValueAction(siteId, categoryName)); - const searchSiteIdTrail = async (searchValue: string) => dispatch(loadTreeSiteSearchBySiteIdOrNameAsync(searchValue)); - - if (currentSearchCategoryName !== props.match.params.searchCategoryName) { - currentSearchCategoryName = props.match.params.searchCategoryName || undefined; - if (currentSearchCategoryName && currentSearchSiteId !== props.match.params.searchSiteId) { - currentSearchSiteId = props.match.params.searchSiteId || undefined; - if (currentSearchSiteId) { - setSearchTerm(currentSearchSiteId, currentSearchCategoryName); - searchSiteIdTrail(currentSearchSiteId); - } - } - } else { - if (currentSearchSiteId !== props.match.params.searchSiteId) { - currentSearchSiteId = props.match.params.searchSiteId || undefined; - if (currentSearchSiteId) { - setSearchTerm(currentSearchSiteId); - searchSiteIdTrail(currentSearchSiteId); - } - } - } - return ( - - ); -}); - -const App = withRouter((props: RouteComponentProps) => ( - - - - - - - -)); - -export function register() { - applicationManager.registerApplication({ - name: 'siteManager', - icon: appIcon, - rootActionHandler: siteManagerAppRootHandler, - rootComponent: App, - menuEntry: 'Site Manager', - }); -} - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/dataService.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/dataService.ts deleted file mode 100644 index 8e0d032..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/dataService.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Result } from '../../../../framework/src/models'; -import { requestRest } from '../../../../framework/src/services/restService'; - -import { NetworkElementConnection } from '../models/networkElementConnection'; - -const dataService = { - getAdditionalInfoOnDevices: async (ids: string[]) => { - const path = 'rests/operations/data-provider:read-network-element-connection-list'; - const query = { - 'data-provider:input': { - 'filter': [{ - 'property': 'id', - 'filtervalues': ids, - }], - 'pagination': { - 'size': ids.length, - 'page': 1, - }, - }, - }; - if (ids.length > 0) { - const result = await requestRest>( - path, - { method: 'POST', body: JSON.stringify(query) }, - ); - const resultData = result && result['data-provider:output'] && result['data-provider:output'].data; - return resultData; - } else { - return null; - } - }, -}; - -export default dataService; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/mapService.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/mapService.ts deleted file mode 100644 index 65f83c7..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/mapService.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { requestRest } from '../../../../framework/src/services/restService'; -import { SiteDetails } from '../models/siteDetails'; - -const filterKeysUrl = '/topology/network/filters/keys'; - -type FilterKey = { - key: string; - reference: string; - type: string; - label: string | null; -}; - -let filterMapping: { [table: string]: { [column: string]: { key: string; type: string } } }; - -const getFieldMapping = async () => { - if (filterMapping) { - return filterMapping; - } - - const response = await requestRest(filterKeysUrl); - if (!response) { - throw new Error('No filter mapping found'); - } - - filterMapping = {}; - response.forEach(key => { - const parts = key.reference.split('.'); - const table = parts[0]; - const column = parts[1]; - - if (!filterMapping[table]) { - filterMapping[table] = {}; - } - filterMapping[table][column] = { key: key.key, type: key.type }; - }); - - return filterMapping; -}; - -const createMapFilter = async (tableName: string, tableState: IExternalTableState) => { - const mapping = await getFieldMapping(); - - return Object.keys(tableState.filter).map(key => { - const column = mapping[tableName] && mapping[tableName][key]; - const value = tableState.filter[key] && tableState.filter[key].trim(); - if (!column || !value) { - return null; - } - return value.match(/^[<>]/i) - ? `${column.key}${value}` - : column.type === 'string' - ? value.includes('\'') - ? `${column.key}='${value}'` - : `${column.key}='${value}'` - : `${column.key}=${value}`; - - }).filter(filter => filter !== null).join(' AND '); - -}; - -export { createMapFilter }; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/siteManagerService.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/siteManagerService.ts deleted file mode 100644 index 1943bee..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/siteManagerService.ts +++ /dev/null @@ -1,274 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { requestRestExt } from '../../../../framework/src/services/restService'; - -import { - SearchSiteIdResult, SiteConfigurationFreqPlan, SiteManagerAreas, SiteManagerCategories, SiteManagerCategoryItems, - Sites, SitesListResult, addEditSiteConfig, Bands, -} from '../models/siteManager'; - -/** - * Represents a web api accessor service for all entries related actions. - */ - -const URL_SITE_MANAGER = '/topology/site-manager'; - -const URL_MICROWAVE = '/topology/microwave'; - -const siteManagerService = { - getCountries: async (): Promise => { - return fetch(`${URL_SITE_MANAGER}/areas`) - .then(res => res.json()) - .then(result => { - return result; - }); - }, - - getAreasByAreaId: async (areaId: string): Promise => { - return fetch(`${URL_SITE_MANAGER}/areas/${areaId}/areas`) - .then(res => res.json()) - .then(result => { - return result; - }); - }, - - getSitesByAreaId: async (areaId: string): Promise => { - const requestHeaders: HeadersInit = new Headers(); - requestHeaders.set('Content-Type', 'application/json'); - requestHeaders.set('Accept', 'application/json'); - - return fetch(`${URL_SITE_MANAGER}/areas/${areaId}/sites`, { - method: 'GET', - headers: requestHeaders, - }) - .then(response => { - if (!response.ok) { - // eslint-disable-next-line @typescript-eslint/no-throw-literal - throw response; - } - return response.json(); - }) - .then(response => { - const returnResponse: SitesListResult = { - sites: response ? response : [], - isError: false, - errorMessage: '', - }; - return returnResponse; - }).catch(error => { - return error.json().then((errorMessage: any) => { - const returnResponse: SitesListResult = { - sites: [], - isError: true, - errorMessage: errorMessage.message, - }; - return returnResponse; - }); - }); - }, - - getSiteBySiteId: async (siteId: string): Promise => { - const requestHeaders: HeadersInit = new Headers(); - requestHeaders.set('Content-Type', 'application/json'); - requestHeaders.set('Accept', 'application/json'); - - return fetch(`${URL_SITE_MANAGER}/sites/${siteId}`, { - method: 'GET', - headers: requestHeaders, - }) - .then(res => res.json()) - .then(result => { - return result; - }).catch(error => { - console.log('Error: ', error); - }); - }, - - getCategoriesBySiteId: async (siteId: string): Promise => { - return fetch(`${URL_SITE_MANAGER}/sites/${siteId}/categories`) - .then(res => res.json()) - .then(result => { - return result; - }); - }, - - getCategoryItemsBySiteIdAndCategoryName: async (siteId: string, categoryName: string): Promise => { - return fetch(`${URL_SITE_MANAGER}/sites/${siteId}/categories/${categoryName}/items`) - .then(res => res.json()) - .then(result => { - return result; - }).catch(() => { - // TODO comment the below code - testing - const value: SiteManagerCategoryItems = [{ - name: categoryName, - url: 'No url found', - 'last-update': 'today', - }]; - return value; - }); - }, - - getSearchSiteIDTrail: async (siteId: string): Promise => { - const data = { query: siteId, showBesideItems: true }; - - const requestHeaders: HeadersInit = new Headers(); - requestHeaders.set('Content-Type', 'application/json'); - requestHeaders.set('Accept', 'application/json'); - - return fetch(`${URL_SITE_MANAGER}/search`, { - method: 'POST', - headers: requestHeaders, - body: JSON.stringify(data), - }) - .then(response => { - if (!response.ok) { - // eslint-disable-next-line @typescript-eslint/no-throw-literal - throw response; - } - return response.json(); - }) - .then(response => { - const returnResponse: SearchSiteIdResult = { - areas: response.areas ? response.areas : [], - sites: response.sites ? response.sites : [], - isError: false, - errorMessage: '', - }; - return returnResponse; - }).catch(error => { - return error.json().then((errorMessage: any) => { - const returnResponse: SearchSiteIdResult = { - areas: [], - sites: [], - isError: true, - errorMessage: errorMessage.message, - }; - return returnResponse; - }); - }); - }, - - saveModifiedSiteDetails: async (siteDetails: Sites, siteId: string) => { - type Message = { 'message': string }; - const response = await requestRestExt(URL_SITE_MANAGER + `/sites/${siteId}`, { - method: 'PUT', - body: JSON.stringify(siteDetails), - }); - if (response.status == 200) { - return { message: 'Save Successful', error: false, serverError: false }; - } else { - let message = { message: '', error: true, serverError: true }; - if (response.data?.message) { - message.serverError = (response.status == 400) ? true : false; - message.message = 'Save failed: ' + response.data ? response.data.message : 'unknown'; - return message; - } else { - message.serverError = true; - message.message = 'Something went wrong ' + response.message; - return message; - } - } - }, - - getSitesFrequencyPlan: async (siteId: string): Promise => { - const response = await fetch(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan`); - const result = await response.json(); - return result as SiteConfigurationFreqPlan[]; - }, - - getAvailableBands: async (): Promise => { - const response = await fetch(`${URL_MICROWAVE}/bands`); - const result = await response.json(); - return result as Bands[]; - }, - - getAvailableSiteTypes: async (): Promise => { - const response = await fetch(`${URL_SITE_MANAGER}/site-types`); - const data = await response.json(); - const filteredData = data.filter((item: string | null) => item !== null && item !== ''); - return filteredData as string[]; - }, - - saveSiteConfiguration: async (modifiedConfig: addEditSiteConfig, bandId: string, siteId: string) => { - type Message = { 'message': string }; - const response = await requestRestExt(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan/${bandId}`, { - method: 'PUT', - body: JSON.stringify(modifiedConfig), - }); - if (response.status == 200) { - return { message: 'Save Successful', error: false, serverError: false }; - } else { - let message = { message: '', error: true, serverError: true }; - if (response.data?.message) { - message.serverError = (response.status == 400) ? true : false; - message.message = 'Save failed: ' + response.data ? response.data.message : 'unknown'; - return message; - } else { - message.serverError = true; - message.message = 'Something went wrong ' + response.message; - return message; - } - } - }, - - createSiteConfiguration: async (newConfig: addEditSiteConfig, bandId: string, siteId: string) => { - type Message = { 'message': string }; - const response = await requestRestExt(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan/${bandId}`, { - method: 'POST', - body: JSON.stringify(newConfig), - }); - if (response.status == 200) { - return { message: 'Save Successful', error: false, serverError: false }; - } else { - let message = { message: '', error: true, serverError: true }; - if (response.data?.message) { - message.serverError = (response.status == 400) ? true : false; - message.message = 'Save failed: ' + response.data ? response.data.message : 'unknown'; - return message; - } else { - message.serverError = true; - message.message = 'Something went wrong ' + response.message; - return message; - } - } - }, - - deleteSiteConfiguration: async (bandId: string, siteId: string) => { - type Message = { 'message': string }; - const response = await requestRestExt(`${URL_MICROWAVE}/network/sites/${siteId}/frequencyplan/${bandId}`, { - method: 'DELETE', - }); - if (response.status == 200) { - return { message: 'Delete Successful', error: false, serverError: false }; - } else { - let message = { message: '', error: true, serverError: true }; - if (response.data?.message) { - message.serverError = (response.status == 400) ? true : false; - message.message = 'Delete failed: ' + response.data ? response.data.message : 'unknown'; - return message; - } else { - message.serverError = true; - message.message = 'Something went wrong ' + response.message; - return message; - } - } - }, -}; - -export default siteManagerService; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/sitedocDataService.ts b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/sitedocDataService.ts deleted file mode 100644 index ca2bf26..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/services/sitedocDataService.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { requestRest, requestRestExt } from '../../../../framework/src/services/restService'; - -import { Site } from '../models/site'; -import { SitedocOrder, UserListItem } from '../models/siteDocTypes'; -import { SiteManagerSiteOrderItemsDetails } from '../models/siteManager'; - -const BASE_URL = '/sitedoc'; - -type Message = { 'message': string }; - -const sitedocDataService = { - createOrder: async (order: SitedocOrder, siteId: string) => { - const result = await requestRestExt(BASE_URL + `/site/${siteId}/order`, { method: 'POST', body: JSON.stringify(order) }); - if (result.status === 200) { - return { message: 'Order Created', error: false, serverError: false }; - } else { - let message = { message: '', error: true, serverError: false }; - if (result.data) { - message.message = 'Creation failed: ' + result.data ? result.data.message : 'unknown'; - return message; - } else { - message.serverError = (result.status === 403) ? true : false; - message.message = 'Something went wrong... ' + result.message; - return message; - } - } - }, - - getSiteIfExists: async (siteId: string) => { - return requestRest('/topology/network/sites/' + siteId); - }, - - getAllUsers: async () => { - const result = await requestRest(BASE_URL + '/users/android'); - if (result) { - return result; - } else { - return []; - } - }, - - getSiteDetails: async (siteId: string): Promise => { - const selectedSiteId = siteId.split('#')[0] + ''; - return fetch(`${BASE_URL}/site/${selectedSiteId}/orders`) - .then(res => res.json()) - .then(result => { - return result; - }).catch(() => { - const value: SiteManagerSiteOrderItemsDetails = [{ - assignedUser: '', - state: '', - note: '', - tasks: [{ - type: '', - description: '', - completed: false, - }], - }]; - return value; - }); - }, -}; - -export default sitedocDataService; diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/views/OrderCreation.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/views/OrderCreation.tsx deleted file mode 100644 index 84db1fb..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/views/OrderCreation.tsx +++ /dev/null @@ -1,86 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2021 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - -import { useApplicationDispatch } from '../../../../framework/src/flux/connect'; - -import { SelectElementAction } from '../actions/detailsAction'; -import { getUsersAction } from '../actions/sitedocManagementAction'; -import CreateNewOrder from '../components/createNewOrder'; -import { Site } from '../models/site'; -import sitedocDataService from '../services/sitedocDataService'; - -type orderProps = RouteComponentProps & { - siteId: string; - onClose: (siteId: string) => void; - onError: () => void; -}; - -const OrderCreation = (props: orderProps) => { - const dispatch = useApplicationDispatch(); - const getUsersActions = () => dispatch(getUsersAction); - const selectSite = (site: Site) => dispatch(new SelectElementAction(site)); - - const [showForm, setShowForm] = React.useState(true); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [siteInfo, setSiteInfo] = React.useState(''); - //on mount - React.useEffect(() => { - getUsersActions(); - if (props.siteId) { - setShowForm(true); - } else { - setShowForm(false); - sitedocDataService.getSiteIfExists(props.siteId).then(res => { - if (res) { - selectSite(res); - setShowForm(true); - } else { - setSiteInfo('Site not found.'); - } - }); - } - }, []); - - const onCancel = (siteId: string) => { - props.onClose && props.onClose(siteId); - }; - - const onError = () => { - props.onError && props.onError(); - }; - - return <> - { - (props.siteId === null) ? -
Check if site exists...
- : - !showForm - ?
-
Site does not exist
-
- : - } - ; -}; - -const CreateOrderView = withRouter(OrderCreation); - -export default CreateOrderView; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/views/siteManager.tsx b/features/sdnr/odlux/odlux/apps/siteManagerApp/src/views/siteManager.tsx deleted file mode 100644 index 3cb3dd3..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/src/views/siteManager.tsx +++ /dev/null @@ -1,86 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import React, { useState } from 'react'; - -import { AppBar, Tab, Tabs } from '@mui/material'; -import { RouteComponentProps, withRouter } from 'react-router-dom'; - -import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; -import { useApplicationDispatch } from '../../../../framework/src/flux/connect'; - -import { SearchValueAction } from '../actions/siteManagerSiteSearchAction'; -import { SiteManagerTreeView } from '../components/siteManagerTreeview'; -import { SiteTableView } from '../components/siteTable'; - - -type TabId = 'SiteTable' | 'TreeView'; - -type DashboardComponentProps = RouteComponentProps & { activePanel: string }; -const scrollbar = { overflow: 'auto' }; - -const SiteManagerComponent = (props: DashboardComponentProps) => { - const [activeTab, setActiveTab] = useState(props.activePanel); - const dispatch = useApplicationDispatch(); - const navigateToApplication = (applicationName: string, path?: string) => dispatch(new NavigateToApplication(applicationName, path, '')); - const setSearchTerm = (value: string) => dispatch(new SearchValueAction(value)); - - React.useEffect(() => { - if (activeTab == null) { - setActiveTab('SiteTable'); - } - }, []); - - const onHandleTabChange = (event: React.SyntheticEvent, value: TabId) => { - setActiveTab(value); - }; - - const siteTableTab = () => { - setSearchTerm(''); - return navigateToApplication('siteManager', ''); - }; - - const treeViewTab = () => { - return navigateToApplication('siteManager', 'treeview'); - }; - - return ( - <> - - - - - - - {activeTab === 'SiteTable' - ?
- -
- : activeTab === 'TreeView' - ?
- -
- : null} - - ); -}; - - -export const SiteManager = withRouter(SiteManagerComponent); -export default SiteManager; - diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/tsconfig.json b/features/sdnr/odlux/odlux/apps/siteManagerApp/tsconfig.json deleted file mode 100644 index ca65092..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/features/sdnr/odlux/odlux/apps/siteManagerApp/webpack.config.js b/features/sdnr/odlux/odlux/apps/siteManagerApp/webpack.config.js deleted file mode 100644 index 1e5d230..0000000 --- a/features/sdnr/odlux/odlux/apps/siteManagerApp/webpack.config.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); -const proxyConf = require('../../proxy.conf'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - siteManagerApp: ["./pluginSiteManager.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "[name]", - libraryTarget: "umd2", - chunkFilename: "[name].js" - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - }, { - //don't minify images - test: /\.(png|gif|jpg|svg)$/, - use: [{ - loader: 'url-loader', - options: { - limit: 10, - name: './images/[name].[ext]' - } - }] - }] - }, - - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release" ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ]) - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: proxyConf, - } - }]; -} diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/.babelrc b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/.babelrc deleted file mode 100644 index 3d8cd12..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/package.json b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/package.json deleted file mode 100644 index c95c071..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@odlux/unm-fault-management-app", - "version": "0.1.0", - "description": "A react based modular UI to demo the fault management.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Sai Neetha Phulmali", - "license": "Apache-2.0", - "dependencies": { - "@emotion/react": "^11.7.0", - "@emotion/styled": "^11.6.0", - "@mui/icons-material": "^5.2.0", - "@mui/material": "^5.2.2", - "@mui/styles": "^5.2.2", - "@odlux/framework": "*", - "@fortawesome/free-solid-svg-icons": "5.6.3", - "@fortawesome/react-fontawesome": "0.1.14" - }, - "peerDependencies": { - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "@types/react": "17.0.37", - "@types/react-dom": "17.0.11", - "@types/react-router-dom": "5.1.7", - "jquery": "3.3.1", - "react": "17.0.2", - "react-dom": "17.0.2", - "react-router-dom": "5.2.0", - "react-chartjs-2": "^3.0.3" - } -} diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/pom.xml b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/pom.xml deleted file mode 100644 index 98146c9..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - 4.0.0 - - org.o-ran-sc.oam-controller.features.sdnr.odlux - sdnr-odlux-app-unmFaultManagementApp - 1.7.0-SNAPSHOT - jar - - SDNR ODLUX :: ${project.artifactId} - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - - dist - odlux - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - de.jacks-it-lab - frontend-maven-plugin - 1.7.2 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v16.17.0 - v1.22.19 - - - - yarn build - - yarn - - - run build - - - - - - - diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/actions/panelChangeActions.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/actions/panelChangeActions.ts deleted file mode 100644 index fb29e9c..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/actions/panelChangeActions.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { Action } from '../../../../framework/src/flux/action'; - -import { PanelId } from '../models/panelId'; - -export class SetPanelAction extends Action { - constructor(public panelId: PanelId) { - super(); - } -} - -export class RememberCurrentPanelAction extends Action { - constructor(public panelId: PanelId) { - super(); - } -} - -export const setPanelAction = (panelId: PanelId) => { - return new SetPanelAction(panelId); -}; - diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/actions/unmFaultManagementAlarmStatusActions.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/actions/unmFaultManagementAlarmStatusActions.ts deleted file mode 100644 index d53fdc3..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/actions/unmFaultManagementAlarmStatusActions.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { Action } from '../../../../framework/src/flux/action'; -import { getUnmFaultCountBySeverity } from '../services/unmFaultStatusService'; - -export class BaseAction extends Action { } - -export class SetUnmFaultStatusAction extends BaseAction { - constructor(public criticalFaults: number, public majorFaults: number, - public minorFaults: number, public warnings: number, public indeterminate: number) { - super(); - } -} - -export const loadAllUnmFaultStatusCountAsyncAction = async (dispatch: Dispatch) => { - const result = await getUnmFaultCountBySeverity().catch(_ => null); - if (result) { - const statusAction = new SetUnmFaultStatusAction( - result.Critical || 0, - result.Major || 0, - result.Minor || 0, - result.Warning || 0, - result.Indeterminate || 0, - ); - dispatch(statusAction); - return; - } else { - dispatch(new SetUnmFaultStatusAction(0, 0, 0, 0, 0)); - } -}; diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/assets/icons/unmFaultManagementAppIcon.svg b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/assets/icons/unmFaultManagementAppIcon.svg deleted file mode 100644 index aabbf4c..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/assets/icons/unmFaultManagementAppIcon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/refreshUnmFaultLogDialog.tsx b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/refreshUnmFaultLogDialog.tsx deleted file mode 100644 index b6f3474..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/refreshUnmFaultLogDialog.tsx +++ /dev/null @@ -1,112 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; - -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; - -import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { unmFaultLogEntriesReloadAction } from '../handlers/unmFaultLogEntriesHandler'; -import { FaultLog } from '../models/unmFault'; - -export enum RefreshFaultLogDialogMode { - None = 'none', - RefreshFaultLogTable = 'RefreshFaultLogTable', -} - -const mapDispatch = (dispatcher: IDispatcher) => ({ - refreshFaultLog: () => dispatcher.dispatch(unmFaultLogEntriesReloadAction), -}); - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - enableMountIdEditor: boolean; - enableUsernameEditor: boolean; - enableExtendedEditor: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [RefreshFaultLogDialogMode.None]: { - dialogTitle: '', - dialogDescription: '', - applyButtonText: '', - cancelButtonText: '', - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [RefreshFaultLogDialogMode.RefreshFaultLogTable]: { - dialogTitle: 'Do you want to refresh the Fault Log?', - dialogDescription: '', - applyButtonText: 'Yes', - cancelButtonText: 'Cancel', - enableMountIdEditor: true, - enableUsernameEditor: true, - enableExtendedEditor: true, - }, -}; - -type RefreshFaultLogDialogComponentProps = Connect & { - mode: RefreshFaultLogDialogMode; - onClose: () => void; -}; - -type RefreshFaultLogDialogComponentState = FaultLog & { isNameValid: boolean; isHostSet: boolean }; - -class RefreshFaultLogDialogComponent extends React.Component { - render(): JSX.Element { - const setting = settings[this.props.mode]; - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - - - - - - - ); - } - - private onRefresh = () => { - this.props.refreshFaultLog(); - this.props.onClose(); - }; - - private onCancel = () => { - this.props.onClose(); - }; -} - -export const RefreshFaultLogDialog = connect(undefined, mapDispatch)(RefreshFaultLogDialogComponent); -export default RefreshFaultLogDialog; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementAlarmDetailsDialog.tsx b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementAlarmDetailsDialog.tsx deleted file mode 100644 index 47999ed..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementAlarmDetailsDialog.tsx +++ /dev/null @@ -1,172 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; - -import { TextField } from '@mui/material'; -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; - -import { connect, Connect } from '../../../../framework/src/flux/connect'; - -import { FaultLog } from '../models/unmFault'; - -export enum ViewAlarmDetailsDialogMode { - None = 'none', - ViewAlarmDetails = 'viewDetails', -} - -const mapDispatch = () => ({ -}); - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - enableMountIdEditor: boolean; - enableUsernameEditor: boolean; - enableExtendedEditor: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [ViewAlarmDetailsDialogMode.None]: { - dialogTitle: '', - dialogDescription: '', - applyButtonText: '', - cancelButtonText: '', - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [ViewAlarmDetailsDialogMode.ViewAlarmDetails]: { - dialogTitle: 'Alarm Details', - dialogDescription: 'Details', - applyButtonText: 'Save', - cancelButtonText: 'Cancel', - enableMountIdEditor: false, - enableUsernameEditor: true, - enableExtendedEditor: false, - }, -}; - -type ViewAlarmDetailsDialogComponentProps = Connect & { - initialAlarmDetails: FaultLog; - mode: ViewAlarmDetailsDialogMode; - onClose: () => void; -}; - -type ViewAlarmDetailsDialogComponentState = FaultLog & { -}; - -class UnmFaultManagementAlarmDetailsComponent extends React.Component { - constructor(props: ViewAlarmDetailsDialogComponentProps) { - super(props); - this.state = { - nodeId: this.props.initialAlarmDetails.nodeId, - counter: this.props.initialAlarmDetails.counter, - timestamp: this.props.initialAlarmDetails.timestamp, - objectId: this.props.initialAlarmDetails.objectId, - severity: this.props.initialAlarmDetails.severity, - problem: this.props.initialAlarmDetails.problem, - sourceType: this.props.initialAlarmDetails.sourceType, - }; - } - - render(): JSX.Element { - const setting = settings[this.props.mode]; - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - - - - - - - - - - - - - { this.setState({ comment: event.target.value }); }} /> - - - - - - - - ); - } - - public componentDidMount() { - } - - - private onApply = () => { - if (this.props.onClose) this.props.onClose(); - - switch (this.props.mode) { - case ViewAlarmDetailsDialogMode.ViewAlarmDetails: - break; - } - }; - - private onCancel = () => { - if (this.props.onClose) this.props.onClose(); - }; - - static getDerivedStateFromProps(props: ViewAlarmDetailsDialogComponentProps, state: ViewAlarmDetailsDialogComponentState & { initialAlarmDetails: FaultLog }): ViewAlarmDetailsDialogComponentState & { initialAlarmDetails: FaultLog } { - let returnState = state; - if (props.initialAlarmDetails !== state.initialAlarmDetails) { - returnState = { - ...state, - ...props.initialAlarmDetails, - initialAlarmDetails: props.initialAlarmDetails, - }; - } - return returnState; - } -} - -export const ViewAlarmDetailsDialog = connect(undefined, mapDispatch)(UnmFaultManagementAlarmDetailsComponent); -export default ViewAlarmDetailsDialog; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementDashboard.tsx b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementDashboard.tsx deleted file mode 100644 index 690aa7c..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementDashboard.tsx +++ /dev/null @@ -1,111 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; -import { RouteComponentProps } from 'react-router-dom'; - -import { WithStyles, withStyles } from '@mui/styles'; -import createStyles from '@mui/styles/createStyles'; - -import { connect, Connect } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -const styles = () => createStyles({ - pageWidthSettings: { - width: '50%', - float: 'left', - }, - root: { - borderTopWidth: 5, - borderBottomWidth: 5, - borderColor: '#eee', - borderStyle: 'solid', - width: '75%', - padding: '15px', - 'fontfamily': 'Arial, Helvetica, sans-serif', - 'borderCollapse': 'collapse', - 'paddingBottom': '12px', - 'paddingLeft': '25px', - 'text-align': 'left', - 'color': 'black', - }, - -}); - -const scrollbar = { overflow: 'auto', paddingRight: '20px' }; - - -const mapProps = (state: IApplicationStoreState) => ({ - unmAlarmCount: state.unmFaultManagement.unmFaultStatus, -}); - -const mapDispatch = () => ({ -}); - -type UnmFaultManagementComponentProps = RouteComponentProps & Connect & WithStyles; - -class UnmFaultManagementDashboard extends React.Component { - constructor(props: UnmFaultManagementComponentProps) { - super(props); - this.state = { - }; - } - - render(): JSX.Element { - const { classes, unmAlarmCount } = this.props; - return ( - <> -
-

Alarm Overview

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Total number of Alarms

{unmAlarmCount.critical + unmAlarmCount.major + unmAlarmCount.minor - + unmAlarmCount.warning + unmAlarmCount.indeterminate}

Critical

{unmAlarmCount.critical}

Major

{unmAlarmCount.major}

Minor

{unmAlarmCount.minor}

Warning

{unmAlarmCount.warning}

Indeterminate

{unmAlarmCount.indeterminate}
-
-
- - ); - } -} - -export default connect(mapProps, mapDispatch)(withStyles(styles)(UnmFaultManagementDashboard)); diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementFaultLog.tsx b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementFaultLog.tsx deleted file mode 100644 index e26cd58..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/components/unmFaultManagementFaultLog.tsx +++ /dev/null @@ -1,151 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; - -import Refresh from '@mui/icons-material/Refresh'; -import { MenuItem, Typography } from '@mui/material'; - -import { ColumnType, MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import RefreshFaultLogDialog, { RefreshFaultLogDialogMode } from '../components/refreshUnmFaultLogDialog'; -import ViewAlarmDetailsDialog, { ViewAlarmDetailsDialogMode } from '../components/unmFaultManagementAlarmDetailsDialog'; -import { createUnmFaultLogEntriesActions, createUnmFaultLogEntriesProperties } from '../handlers/unmFaultLogEntriesHandler'; -import { FaultLog } from '../models/unmFault'; - -const mapProps = (state: IApplicationStoreState) => ({ - unmFaultLogEntriesProperties: createUnmFaultLogEntriesProperties(state), -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - unmFaultLogEntriesActions: createUnmFaultLogEntriesActions(dispatcher.dispatch), -}); - -type UnmFaultManagementApplicationComponentProps = Connect; - -type UnmFaultManagementApplicationState = { - alarmToEdit: FaultLog; - refreshFaultLogEditorMode: RefreshFaultLogDialogMode; - viewAlarmDetailsMode: ViewAlarmDetailsDialogMode; -}; - -const emptyAlarmElement: FaultLog = -{ - id: '', - nodeId: '', - counter: 0, - timestamp: { value: '' }, - objectId: '', - severity: null, - problem: '', - sourceType: '', -}; - -const FaultLogTable = MaterialTable as MaterialTableCtorType; - -class UnmFaultManagementFaultLogComponent extends React.Component { - constructor(props: UnmFaultManagementApplicationComponentProps) { - super(props); - this.state = { - alarmToEdit: emptyAlarmElement, - refreshFaultLogEditorMode: RefreshFaultLogDialogMode.None, - viewAlarmDetailsMode: ViewAlarmDetailsDialogMode.None, - }; - } - - getContextMenu(rowData: FaultLog): JSX.Element[] { - const buttonArray = [ - this.onOpenViewAlarmDetailsDialog(event, rowData)}>View Details, - ]; - return buttonArray; - } - - - render(): JSX.Element { - const refreshFaultLogAction = { - icon: Refresh, tooltip: 'Refresh Fault log table', ariaLabel: 'refresh', onClick: () => { - this.setState({ - refreshFaultLogEditorMode: RefreshFaultLogDialogMode.RefreshFaultLogTable, - }); - }, - }; - - return ( - <> - { - return ( - rowData.timestamp.value - ); - }, - }, - { property: 'nodeId', title: 'Node Name' }, - { property: 'objectId', title: 'Object Id' }, - { property: 'problem', title: 'Problem' }, - { property: 'sourceType', title: 'Source', width: '140px' }, - ]} {...this.props.unmFaultLogEntriesProperties} {...this.props.unmFaultLogEntriesActions} createContextMenu={rowData => { - return this.getContextMenu(rowData); - }} /> - - - - ); - } - - private onCloseRefreshFaultLogDialog = () => { - this.setState({ - refreshFaultLogEditorMode: RefreshFaultLogDialogMode.None, - }); - }; - - private onOpenViewAlarmDetailsDialog = (event: React.MouseEvent, element: FaultLog) => { - this.setState({ - alarmToEdit: { - nodeId: element.nodeId, - counter: element.counter, - timestamp: element.timestamp, - objectId: element.objectId, - severity: element.severity, - problem: element.problem, - sourceType: element.sourceType, - }, - viewAlarmDetailsMode: ViewAlarmDetailsDialogMode.ViewAlarmDetails, - }); - }; - - private onCloseViewAlarmDetailsDialog = () => { - this.setState({ - viewAlarmDetailsMode: ViewAlarmDetailsDialogMode.None, - }); - }; -} - -export const UnmFaultManagementFaultLog = connect(mapProps, mapDispatch)(UnmFaultManagementFaultLogComponent); -export default UnmFaultManagementFaultLog; diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultLogEntriesHandler.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultLogEntriesHandler.ts deleted file mode 100644 index ccc36de..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultLogEntriesHandler.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { FaultLog } from '../models/unmFault'; - -export interface IUnmFaultLogEntriesState extends IExternalTableState { } - -// create eleactic search data fetch handler -const unmFaultLogEntriesSearchHandler = createSearchDataHandler('faultlog'); - -export const { - actionHandler: unmFaultLogEntriesActionHandler, - createActions: createUnmFaultLogEntriesActions, - createProperties: createUnmFaultLogEntriesProperties, - reloadAction: unmFaultLogEntriesReloadAction, - - // set value action, to change a value -} = createExternal(unmFaultLogEntriesSearchHandler, appState => appState.unmFaultManagement.unmFaultLogEntries); - diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultManagementAlarmStatusHandler.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultManagementAlarmStatusHandler.ts deleted file mode 100644 index 1e96168..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultManagementAlarmStatusHandler.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { IActionHandler } from '../../../../framework/src/flux/action'; - -import { SetUnmFaultStatusAction } from '../actions/unmFaultManagementAlarmStatusActions'; - -export interface IUnmFaultStatusCount { - critical: number; - major: number; - minor: number; - warning: number; - indeterminate: number; -} - -const unmFaultStatusInit: IUnmFaultStatusCount = { - critical: 0, - major: 0, - minor: 0, - warning: 0, - indeterminate: 0, -}; - -export const unmFaultStatusHandler: IActionHandler = (state = unmFaultStatusInit, action) => { - if (action instanceof SetUnmFaultStatusAction) { - state = { - critical: action.criticalFaults, - major: action.majorFaults, - minor: action.minorFaults, - warning: action.warnings, - indeterminate: action.indeterminate, - }; - } - - return state; -}; diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultManagementAppRootHandler.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultManagementAppRootHandler.ts deleted file mode 100644 index c376945..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/handlers/unmFaultManagementAppRootHandler.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// main state handler - -import { IActionHandler } from '../../../../framework/src/flux/action'; -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; -// ** do not remove ** -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import { SetPanelAction } from '../actions/panelChangeActions'; -import { PanelId } from '../models/panelId'; - -import { unmFaultStatusHandler, IUnmFaultStatusCount } from './unmFaultManagementAlarmStatusHandler'; -import { IUnmFaultLogEntriesState, unmFaultLogEntriesActionHandler } from './unmFaultLogEntriesHandler'; - -export interface IUnmFaultManagementAppStoreState { - unmFaultLogEntries: IUnmFaultLogEntriesState; - currentOpenPanel: PanelId | null; - unmFaultStatus: IUnmFaultStatusCount; -} - -const currentOpenPanelHandler: IActionHandler = (state = null, action) => { - if (action instanceof SetPanelAction) { - state = action.panelId; - } - return state; -}; - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - unmFaultManagement: IUnmFaultManagementAppStoreState; - } -} - -const actionHandlers = { - unmFaultLogEntries: unmFaultLogEntriesActionHandler, - currentOpenPanel: currentOpenPanelHandler, - unmFaultStatus: unmFaultStatusHandler, -}; - -export const UnmFaultManagementAppRootHandler = combineActionHandler(actionHandlers); -export default UnmFaultManagementAppRootHandler; diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/index.html b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/index.html deleted file mode 100644 index db570ca..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - UNM Fault Management App - - - -
- - - - - - \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/models/panelId.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/models/panelId.ts deleted file mode 100644 index 4fc789d..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/models/panelId.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -export type PanelId = 'Dashboard' | 'FaultLog'; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/models/unmFault.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/models/unmFault.ts deleted file mode 100644 index d652101..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/models/unmFault.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -export type FaultLog = { - id?: string; - nodeId: string; - counter: number; - objectId: string; - timestamp: { value: string }; - problem: string; - severity: null | 'Warning' | 'Minor' | 'Major' | 'Critical' | 'Indeterminate'; - sourceType?: string; - comment?: string; -}; - - -/** - * Fault status count return - */ -export type FaultsCountReturnType = { - criticals: number; - majors: number; - minors: number; - warnings: number; - indeterminate: number; -}; - -export type FaultType = { - Critical: number; - Major: number; - Minor: number; - Warning: number; - Indeterminate: number; -}; - -export type Faults = { - faults: FaultsCountReturnType; -}; diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/pluginUnmFaultManagement.tsx b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/pluginUnmFaultManagement.tsx deleted file mode 100644 index b1854e0..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/pluginUnmFaultManagement.tsx +++ /dev/null @@ -1,81 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// app configuration and main entry point for the app - - -import React from 'react'; -import { Redirect, Route, RouteComponentProps, Switch, withRouter } from 'react-router-dom'; - -import { connect, Connect, IDispatcher } from '../../../framework/src/flux/connect'; -import applicationManager from '../../../framework/src/services/applicationManager'; - -import { SetPanelAction } from './actions/panelChangeActions'; -import UnmFaultManagementDashboard from './components/unmFaultManagementDashboard'; -import { UnmFaultManagementAppRootHandler } from './handlers/unmFaultManagementAppRootHandler'; -import { PanelId } from './models/panelId'; -import UnmFaultManagementApplication from './views/unmFaultManagementApplication'; - -const appIcon = require('./assets/icons/unmFaultManagementAppIcon.svg'); // select app icon - -let currentMountId: string | undefined = undefined; -let currentSeverity: string | undefined = undefined; - -const mapProps = () => ({ -}); - -const mapDispatch = (dispatcher: IDispatcher) => ({ - setCurrentPanel: (panelId: PanelId) => dispatcher.dispatch(new SetPanelAction(panelId)), -}); - -const UnmFaultManagementApplicationRouteAdapter = connect(mapProps, mapDispatch)((props: RouteComponentProps<{ mountId?: string }> & Connect) => { - if (currentMountId !== props.match.params.mountId) { - currentMountId = props.match.params.mountId || undefined; - } - ; - return ( - - ); -}); - -const UnmFaultManagementApplicationAlarmStatusRouteAdapter = connect(mapProps, mapDispatch)((props: RouteComponentProps<{ severity?: string }> & Connect) => { - if (currentSeverity !== props.match.params.severity) { - currentSeverity = props.match.params.severity || undefined; - } - return ( - - ); -}); - -const App = withRouter((props: RouteComponentProps) => ( - - - - - - -)); - -export function register() { - applicationManager.registerApplication({ - name: 'unmFaultManagement', - icon: appIcon, - rootComponent: App, - rootActionHandler: UnmFaultManagementAppRootHandler, - menuEntry: 'UNM Fault Management', - }); -} \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/services/unmFaultStatusService.ts b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/services/unmFaultStatusService.ts deleted file mode 100644 index 9f61864..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/services/unmFaultStatusService.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ - -import { Result } from '../../../../framework/src/models/elasticSearch'; -import { requestRest } from '../../../../framework/src/services/restService'; - -import { FaultType, Faults } from '../models/unmFault'; - - -export const getUnmFaultCountBySeverity = async (): Promise => { - const path = 'rests/operations/data-provider:read-status'; - const query = { - 'data-provider:input': { - 'filter': [], - 'sortorder': [{ - 'property': 'timestamp', - 'sortorder': 'descending', - }], - 'pagination': { - 'size': 20, - 'page': 1, - }, - }, - }; - const result = await requestRest>(path, { method: 'POST', body: JSON.stringify(query) }); - - let faultType: FaultType = { - Critical: 0, - Major: 0, - Minor: 0, - Warning: 0, - Indeterminate: 0, - }; - let faults: Faults[] | null = null; - - if (result && result['data-provider:output'] && result['data-provider:output'].data) { - faults = result['data-provider:output'].data; - faultType = { - Critical: faults[0].faults.criticals, - Major: faults[0].faults.majors, - Minor: faults[0].faults.minors, - Warning: faults[0].faults.warnings, - Indeterminate: faults[0].faults.indeterminate, - }; - } - return faultType; -}; diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/views/unmFaultManagementApplication.tsx b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/views/unmFaultManagementApplication.tsx deleted file mode 100644 index 94b745e..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/src/views/unmFaultManagementApplication.tsx +++ /dev/null @@ -1,93 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; - -import { AppBar, Tab, Tabs } from '@mui/material'; - -import { useApplicationDispatch, useSelectApplicationState } from '../../../../framework/src/flux/connect'; - -import { setPanelAction } from '../actions/panelChangeActions'; -import { loadAllUnmFaultStatusCountAsyncAction } from '../actions/unmFaultManagementAlarmStatusActions'; -import UnmFaultManagementDashboard from '../components/unmFaultManagementDashboard'; -import UnmFaultManagementFaultLog from '../components/unmFaultManagementFaultLog'; -import { unmFaultLogEntriesReloadAction } from '../handlers/unmFaultLogEntriesHandler'; -import { PanelId } from '../models/panelId'; - - -const UnmFaultManagementApplication: React.FC<{}> = () => { - - const panel = useSelectApplicationState(state => state.unmFaultManagement.currentOpenPanel); - - const dispatch = useApplicationDispatch(); - const onLoadFaultLogEntries = () => dispatch(unmFaultLogEntriesReloadAction); - const onLoadDashboard = () => dispatch(loadAllUnmFaultStatusCountAsyncAction); - const switchActivePanel = (panelId: PanelId) => dispatch(setPanelAction(panelId)); - - const onTogglePanel = (panelId: PanelId) => { - const nextActivePanel = panelId; - switchActivePanel(nextActivePanel); - - - switch (nextActivePanel) { - case 'Dashboard': - onLoadDashboard(); - break; - case 'FaultLog': - onLoadFaultLogEntries(); - break; - case null: - // do nothing if all panels are closed - break; - default: - console.warn('Unknown nextActivePanel [' + nextActivePanel + '] in connectView'); - break; - } - }; - - const onHandleTabChange = (event: React.SyntheticEvent, newValue: PanelId) => { - switchActivePanel(newValue); - onTogglePanel(newValue); - }; - - React.useEffect(() => { - if (panel === null) { - onTogglePanel('Dashboard'); - } - }, []); - - - return ( - <> - - - - - - - { - panel === 'Dashboard' - ? - : panel === 'FaultLog' - ? - : null - } - - ); -}; - -export default UnmFaultManagementApplication; \ No newline at end of file diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/tsconfig.json b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/tsconfig.json deleted file mode 100644 index ca65092..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/webpack.config.js b/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/webpack.config.js deleted file mode 100644 index 8e40dea..0000000 --- a/features/sdnr/odlux/odlux/apps/unmFaultManagementApp/webpack.config.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - unmFaultManagementApp: ["./pluginUnmFaultManagement.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "[name]", - libraryTarget: "umd2", - chunkFilename: "[name].js" - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - },{ - //don't minify images - test: /\.(png|gif|jpg|svg)$/, - use: [{ - loader: 'url-loader', - options: { - limit: 10, - name: './images/[name].[ext]' - } - }] - }] - }, - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release" ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }) - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ]) - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: { - "/oauth2/": { - target: "http://sdncweb:8080", - secure: false - }, - "/database/": { - target: "http://sdncweb:8080", - secure: false - }, - "/restconf/": { - target: "http://sdncweb:8080", - secure: false - }, - "/rests/": { - target: "http://sdncweb:8080", - secure: false - }, - "/help/": { - target: "http://sdncweb:8080", - secure: false - }, - "/websocket": { - target: "http://sdncweb:8080", - ws: true, - changeOrigin: true, - secure: false - } - } - } - }]; -} diff --git a/features/sdnr/odlux/odlux/framework/pom.xml b/features/sdnr/odlux/odlux/framework/pom.xml index 3dd19fe..e45137f 100644 --- a/features/sdnr/odlux/odlux/framework/pom.xml +++ b/features/sdnr/odlux/odlux/framework/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-framework 1.7.0-SNAPSHOT @@ -230,10 +236,6 @@ ##odlux.apps.inventoryApp.buildno## ${odlux.apps.inventoryApp.buildno} - - ##odlux.apps.microwaveApp.buildno## - ${odlux.apps.microwaveApp.buildno} - ##odlux.apps.maintenanceApp.buildno## ${odlux.apps.maintenanceApp.buildno} @@ -242,14 +244,6 @@ ##odlux.apps.mediatorApp.buildno## ${odlux.apps.mediatorApp.buildno} - - ##odlux.apps.networkMapApp.buildno## - ${odlux.apps.networkMapApp.buildno} - - - ##odlux.apps.siteManagerApp.buildno## - ${odlux.apps.siteManagerApp.buildno} - ##odlux.apps.permanceHistoryApp.buildno## ${odlux.apps.permanceHistoryApp.buildno} diff --git a/features/sdnr/odlux/odlux/installer/pom.xml b/features/sdnr/odlux/odlux/installer/pom.xml index f6eccc3..e5a3458 100644 --- a/features/sdnr/odlux/odlux/installer/pom.xml +++ b/features/sdnr/odlux/odlux/installer/pom.xml @@ -24,6 +24,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux sdnr-odlux-installer 1.7.0-SNAPSHOT @@ -149,30 +155,6 @@ jar false - - - ${project.groupId} - sdnr-odlux-app-networkMapApp - ${project.version} - jar - false - - - - ${project.groupId} - sdnr-odlux-app-microwaveApp - ${project.version} - jar - false - - - ${project.groupId} @@ -197,20 +179,6 @@ jar false - - ${project.groupId} - sdnr-odlux-app-siteManagerApp - ${project.version} - jar - false - - - ${project.groupId} - sdnr-odlux-app-unmFaultManagementApp - ${project.version} - jar - false - ${project.groupId} diff --git a/features/sdnr/odlux/odlux/pom.xml b/features/sdnr/odlux/odlux/pom.xml index 1eb3895..c96a428 100644 --- a/features/sdnr/odlux/odlux/pom.xml +++ b/features/sdnr/odlux/odlux/pom.xml @@ -23,6 +23,12 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + oparent + 3.0.2-SNAPSHOT + + org.o-ran-sc.oam-controller.features.sdnr.odlux odlux-top 1.7.0-SNAPSHOT @@ -44,11 +50,7 @@ apps/performanceHistoryApp apps/eventLogApp apps/configurationApp - apps/networkMapApp - apps/microwaveApp - apps/siteManagerApp - apps/unmFaultManagementApp apps/app-installer installer diff --git a/features/sdnr/odlux/pom.xml b/features/sdnr/odlux/pom.xml index 08db10f..7b0eca9 100644 --- a/features/sdnr/odlux/pom.xml +++ b/features/sdnr/odlux/pom.xml @@ -30,6 +30,17 @@ ccsdk-sdnr :: micro-services odlux only SDN-R micro-services odlux only + + + o-ran-sc-releases + https://nexus.o-ran-sc.org/content/repositories/releases + + + o-ran-sc-snapshots + https://nexus.o-ran-sc.org/content/repositories/snapshots + + + helpserver odlux diff --git a/features/sdnr/wt/devicemanager-o-ran-sc/pom.xml b/features/sdnr/wt/devicemanager-o-ran-sc/pom.xml index c0dd3c1..a3b2546 100644 --- a/features/sdnr/wt/devicemanager-o-ran-sc/pom.xml +++ b/features/sdnr/wt/devicemanager-o-ran-sc/pom.xml @@ -21,6 +21,13 @@ 4.0.0 + + org.o-ran-sc.oam-controller.parent + odlparent-lite + 3.0.2-SNAPSHOT + + + org.o-ran-sc.oam-controller.features.sdnr.wt sdnr-wt-devicemanager-o-ran-sc 1.8.0-SNAPSHOT diff --git a/features/sdnr/wt/pom.xml b/features/sdnr/wt/pom.xml index 49ee60c..d3f159a 100644 --- a/features/sdnr/wt/pom.xml +++ b/features/sdnr/wt/pom.xml @@ -21,18 +21,6 @@ 4.0.0 - - - org.opendaylight.mdsal.model - ietf-topology - - - org.o-ran-sc.oam-controller.features.sdnr.wt - sdnr-wt-data-provider-model - 1.8.0-SNAPSHOT - compile - - org.o-ran-sc.oam-controller.parent @@ -49,6 +37,17 @@ ccsdk-sdnr-wireless transport :: micro-services SDN-R wireless transport micro-services + + + o-ran-sc-releases + ${o-ran-sc.nexus.release-url} + + + o-ran-sc-snapshots + ${o-ran-sc.nexus.snapshot-url} + + + common common-yang @@ -62,4 +61,40 @@ oauth-provider featureaggregator + + + + org.opendaylight.mdsal.model + ietf-topology + + + org.o-ran-sc.oam-controller.features.sdnr.wt + sdnr-wt-data-provider-model + 1.8.0-SNAPSHOT + compile + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + false + + + + default-deploy + deploy + + deploy + + + + + + + diff --git a/settings.xml b/settings.xml index 2fd39f7..bef7ca4 100644 --- a/settings.xml +++ b/settings.xml @@ -18,60 +18,55 @@ - onap-settings + o-ran-sc-settings - https://nexus.onap.org - https://nexus.onap.org/content/sites/raw - https://nexus.onap.org/service/local/repositories/raw/content - ecomp-raw + https://nexus.o-ran-sc.org + https://nexus.o-ran-sc.org/content/sites/raw + https://nexus.o-ran-sc.org/service/local/repositories/raw/content + ecomp-raw - nexus3.onap.org:10003 - nexus3.onap.org:10002 - nexus3.onap.org:10001 - nexus3.onap.org:10003 + nexus3.o-ran-sc.org:10003 + nexus3.o-ran-sc.org:10002 + nexus3.o-ran-sc.org:10001 + nexus3.o-ran-sc.org:10003 - github-packages - - - github - github-packages - https://maven.pkg.github.com/o-ran-sc/netconf - - - - - github - github-packages - https://maven.pkg.github.com/o-ran-sc/netconf - - - - - github-packages + onap-releases - github - github-packages - https://maven.pkg.github.com/o-ran-sc/ccsdk-features + onap-releases + onap-releases + https://nexus.onap.org/content/repositories/releases/ + + true + + + false + - github - github-packages - https://maven.pkg.github.com/o-ran-sc/ccsdk-features + onap-releases + onap-releases + https://nexus.onap.org/content/repositories/releases/ + + true + + + false + - onap-snapshots + o-ran-sc-snapshots - onap-snapshots - onap-snapshots - https://nexus.onap.org/content/repositories/snapshots/ + o-ran-sc-snapshots + o-ran-sc-snapshots + https://nexus.o-ran-sc.org/content/repositories/snapshots/ false @@ -82,9 +77,9 @@ - onap-snapshots - onap-snapshots - https://nexus.onap.org/content/repositories/snapshots/ + o-ran-sc-snapshots + o-ran-sc-snapshots + https://nexus.o-ran-sc.org/content/repositories/snapshots/ false @@ -95,12 +90,12 @@ - onap-releases + o-ran-sc-releases - onap-releases - onap-releases - https://nexus.onap.org/content/repositories/releases/ + o-ran-sc-releases + o-ran-sc-releases + https://nexus.o-ran-sc.org/content/repositories/releases/ true @@ -111,9 +106,9 @@ - onap-releases - onap-releases - https://nexus.onap.org/content/repositories/releases/ + o-ran-sc-releases + o-ran-sc-releases + https://nexus.o-ran-sc.org/content/repositories/releases/ true @@ -124,16 +119,16 @@ - onap-public + o-ran-sc-public central https://repo1.maven.org/maven2/ - onap-public - onap-public - https://nexus.onap.org/content/repositories/public/ + o-ran-sc-public + o-ran-sc-public + https://nexus.o-ran-sc.org/content/repositories/public/ true @@ -148,9 +143,9 @@ https://repo1.maven.org/maven2/ - onap-public - onap-public - https://nexus.onap.org/content/repositories/public/ + o-ran-sc-public + o-ran-sc-public + https://nexus.o-ran-sc.org/content/repositories/public/ true @@ -162,17 +157,27 @@ - github-packages - onap-settings - onap-snapshots onap-releases - onap-public + o-ran-sc-settings + o-ran-sc-snapshots + o-ran-sc-releases + o-ran-sc-public - github - o-ran-sc - ${env.GITHUB_TOKEN} - + nexus3.o-ran-sc.org + oam-oam-controller + ${env.NEXUS_PASSWORD} + + + o-ran-sc-releases + oam-oam-controller + ${env.NEXUS_PASSWORD} + + + o-ran-sc-snapshots + oam-oam-controller + ${env.NEXUS_PASSWORD} +