From 45bf787f75acb67d4153be40480b07f48ded4d17 Mon Sep 17 00:00:00 2001 From: sai-neetha Date: Mon, 12 Aug 2019 18:17:46 +0200 Subject: Minor functional fixes in odlux apps Minor functional fixes in odlux apps Issue-ID: SDNC-845 Signed-off-by: sai-neetha Change-Id: I8e64e7c67a21798832ad1a36441b08a070452034 Signed-off-by: sai-neetha --- .../src/handlers/adaptiveModulation15minHandler.ts | 29 ------ .../handlers/adaptiveModulation24hoursHandler.ts | 29 ------ .../src/handlers/adaptiveModulationHandler.ts | 96 +++++++++++++++++++ .../src/handlers/availableLtpsActionHandler.ts | 19 +++- .../connectedNetworkElementsActionHandler.ts | 17 ++++ .../crossPolarDiscrimination15minHandler.ts | 29 ------ .../crossPolarDiscrimination24hoursHandler.ts | 29 ------ .../handlers/crossPolarDiscriminationHandler.ts | 63 ++++++++++++ .../src/handlers/performanceData15minHandler.ts | 28 ------ .../src/handlers/performanceData24hoursHandler.ts | 28 ------ .../src/handlers/performanceDataHandler.ts | 65 +++++++++++++ .../src/handlers/performanceHistoryRootHandler.ts | 106 ++++++++++++--------- .../src/handlers/receiveLevel15minHandler.ts | 29 ------ .../src/handlers/receiveLevel24hoursHandler.ts | 29 ------ .../src/handlers/receiveLevelHandler.ts | 63 ++++++++++++ .../handlers/signalToInterference15minHandler.ts | 29 ------ .../handlers/signalToInterference24hoursHandler.ts | 29 ------ .../src/handlers/signalToInterferenceHandler.ts | 63 ++++++++++++ .../src/handlers/temperature15minHandler.ts | 29 ------ .../src/handlers/temperature24hoursHandler.ts | 29 ------ .../src/handlers/temperatureHandler.ts | 63 ++++++++++++ .../src/handlers/transmissionPower15minHandler.ts | 29 ------ .../handlers/transmissionPower24hoursHandler.ts | 28 ------ .../src/handlers/transmissionPowerHandler.ts | 63 ++++++++++++ 24 files changed, 574 insertions(+), 447 deletions(-) delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulationHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscriminationHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceDataHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevelHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterferenceHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperatureHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.ts delete mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts create mode 100644 sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPowerHandler.ts (limited to 'sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers') diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts deleted file mode 100644 index 6072cf0fb..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation15minHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { AdaptiveModulationDataType, AdaptiveModulation, AdaptiveModulationResult } from '../models/adaptiveModulationDataType'; - -export interface IAdaptiveModulation15minState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for Adaptive modulation from historicalperformance15min database. - */ -const adaptiveModulationSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: adaptiveModulation15minActionHandler, - createActions: createAdaptiveModulation15minActions, - createProperties: createAdaptiveModulation15minProperties, - createPreActions: createAdaptiveModulation15minPreActions, - reloadAction: adaptiveModulation15minReloadAction, -} = createExternal(adaptiveModulationSearchHandler, appState => appState.performanceHistory.adaptiveModulation15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts deleted file mode 100644 index 466b22966..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulation24hoursHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { AdaptiveModulationDataType, AdaptiveModulation, AdaptiveModulationResult } from '../models/adaptiveModulationDataType'; - -export interface IAdaptiveModulation24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for Adaptive modulation from historicalperformance24h database. - */ -const adaptiveModulationSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: adaptiveModulation24hoursActionHandler, - createActions: createAdaptiveModulation24hoursActions, - createProperties: createAdaptiveModulation24hoursProperties, - createPreActions: createAdaptiveModulation24hoursPreActions, - reloadAction: adaptiveModulation24hoursReloadAction, -} = createExternal(adaptiveModulationSearchHandler, appState => appState.performanceHistory.adaptiveModulation24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulationHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulationHandler.ts new file mode 100644 index 000000000..ba765c8cb --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/adaptiveModulationHandler.ts @@ -0,0 +1,96 @@ +/** + * ============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 { AdaptiveModulationDataType, AdaptiveModulationResult } from '../models/adaptiveModulationDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface IAdaptiveModulationState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Adaptive modulation from historicalperformance database. + */ +const adaptiveModulationSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + time2StatesS: hit._source["performance-data"]["time2-states-s"], + time2States: hit._source["performance-data"]["time2-states"], + time2StatesL: hit._source["performance-data"]["time2-states-l"], + time4StatesS: hit._source["performance-data"]["time4-states-s"], + time4States: hit._source["performance-data"]["time4-states"], + time4StatesL: hit._source["performance-data"]["time4-states-l"], + time16StatesS: hit._source["performance-data"]["time16-states-s"], + time16States: hit._source["performance-data"]["time16-states"], + time16StatesL: hit._source["performance-data"]["time16-states-l"], + time32StatesS: hit._source["performance-data"]["time32-states-s"], + time32States: hit._source["performance-data"]["time32-states"], + time32StatesL: hit._source["performance-data"]["time32-states-l"], + time64StatesS: hit._source["performance-data"]["time64-states-s"], + time64States: hit._source["performance-data"]["time64-states"], + time64StatesL: hit._source["performance-data"]["time64-states-l"], + time128StatesS: hit._source["performance-data"]["time128-states-s"], + time128States: hit._source["performance-data"]["time128-states"], + time128StatesL: hit._source["performance-data"]["time128-states-l"], + time256StatesS: hit._source["performance-data"]["time256-states-s"], + time256States: hit._source["performance-data"]["time256-states"], + time256StatesL: hit._source["performance-data"]["time256-states-l"], + time512StatesS: hit._source["performance-data"]["time512-states-s"], + time512States: hit._source["performance-data"]["time512-states"], + time512StatesL: hit._source["performance-data"]["time512-states-l"], + time1024StatesS: hit._source["performance-data"]["time1024-states-s"], + time1024States: hit._source["performance-data"]["time1024-states"], + time1024StatesL: hit._source["performance-data"]["time1024-states-l"], + time2048StatesS: hit._source["performance-data"]["time2048-states-s"], + time2048States: hit._source["performance-data"]["time2048-states"], + time2048StatesL: hit._source["performance-data"]["time2048-states-l"], + time4096StatesS: hit._source["performance-data"]["time4096-states-s"], + time4096States: hit._source["performance-data"]["time4096-states"], + time4096StatesL: hit._source["performance-data"]["time4096-states-l"], + time8192StatesS: hit._source["performance-data"]["time8192-states-s"], + time8192States: hit._source["performance-data"]["time8192-states"], + time8192StatesL: hit._source["performance-data"]["time8192-states-l"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: adaptiveModulationActionHandler, + createActions: createAdaptiveModulationActions, + createProperties: createAdaptiveModulationProperties, + createPreActions: createAdaptiveModulationPreActions, + reloadAction: adaptiveModulationReloadAction, +} = createExternal(adaptiveModulationSearchHandler, appState => appState.performanceHistory.adaptiveModulation); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts index 415b073c9..41aceca9f 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts @@ -1,3 +1,20 @@ +/** + * ============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 { @@ -13,7 +30,7 @@ export interface IAvailableLtpsState { } const connectedNetworkElementsStateInit: IAvailableLtpsState = { - distinctLtps: [], + distinctLtps: [], busy: false }; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts index ad153f0ec..ee14063c2 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/connectedNetworkElementsActionHandler.ts @@ -1,3 +1,20 @@ +/** + * ============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 { AllConnectedNetworkElementsLoadedAction, LoadAllConnectedNetworkElementsAction } from '../actions/connectedNetworkElementsActions'; diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts deleted file mode 100644 index 81418db94..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination15minHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { CrossPolarDiscriminationDataType, CrossPolarDiscrimination, CrossPolarDiscriminationResult } from '../models/crossPolarDiscriminationDataType'; - -export interface ICrossPolarDiscrimination15minState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for CPD from historicalperformance15min database. - */ -const crossPolarDiscriminationSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: crossPolarDiscrimination15minActionHandler, - createActions: createCrossPolarDiscrimination15minActions, - createProperties: createCrossPolarDiscrimination15minProperties, - createPreActions: createCrossPolarDiscrimination15minPreActions, - reloadAction: crossPolarDiscrimination15minReloadAction, -} = createExternal(crossPolarDiscriminationSearchHandler, appState => appState.performanceHistory.crossPolarDiscrimination15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts deleted file mode 100644 index b4d9da393..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscrimination24hoursHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { CrossPolarDiscriminationDataType, CrossPolarDiscrimination, CrossPolarDiscriminationResult } from '../models/crossPolarDiscriminationDataType'; - -export interface ICrossPolarDiscrimination24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for CPD from historicalperformance24h database. - */ -const crossPolarDiscriminationSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: crossPolarDiscrimination24hoursActionHandler, - createActions: createCrossPolarDiscrimination24hoursActions, - createProperties: createCrossPolarDiscrimination24hoursProperties, - createPreActions: createCrossPolarDiscrimination24hoursPreActions, - reloadAction: crossPolarDiscrimination24hoursReloadAction, -} = createExternal(crossPolarDiscriminationSearchHandler, appState => appState.performanceHistory.crossPolarDiscrimination24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscriminationHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscriminationHandler.ts new file mode 100644 index 000000000..074c97d91 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/crossPolarDiscriminationHandler.ts @@ -0,0 +1,63 @@ +/** + * ============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 { CrossPolarDiscriminationDataType, CrossPolarDiscriminationResult } from '../models/crossPolarDiscriminationDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface ICrossPolarDiscriminationState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for CPD from historicalperformance database. + */ +const crossPolarDiscriminationSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + xpdMin: hit._source["performance-data"]["xpd-min"], + xpdAvg: hit._source["performance-data"]["xpd-avg"], + xpdMax: hit._source["performance-data"]["xpd-max"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: crossPolarDiscriminationActionHandler, + createActions: createCrossPolarDiscriminationActions, + createProperties: createCrossPolarDiscriminationProperties, + createPreActions: createCrossPolarDiscriminationPreActions, + reloadAction: crossPolarDiscriminationReloadAction, +} = createExternal(crossPolarDiscriminationSearchHandler, appState => appState.performanceHistory.crossPolarDiscrimination); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts deleted file mode 100644 index 4f284a27e..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData15minHandler.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { PerformanceDataType, Performance,PerformanceResult } from '../models/performanceDataType'; - -export interface IPerformanceData15minState extends IExternalTableState {} - -/** - * Creates elastic search material data fetch handler for performance data from historicalperformance15min database. - */ - const performanceDataSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}` ); - -export const { - actionHandler: performanceData15minActionHandler, - createActions: createPerformanceData15minActions, - createProperties: createPerformanceData15minProperties, - createPreActions: createPerformanceData15minPreActions, - reloadAction: performanceData15minReloadAction -} = createExternal(performanceDataSearchHandler, appState => appState.performanceHistory.performanceData15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts deleted file mode 100644 index 4136ce482..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceData24hoursHandler.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { PerformanceDataType, Performance, PerformanceResult } from '../models/performanceDataType'; - -export interface IPerformanceData24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for performance data from historicalperformance24h database. - */ -const performanceDataSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: performanceData24hoursActionHandler, - createActions: createPerformanceData24hoursActions, - createProperties: createPerformanceData24hoursProperties, - createPreActions: createPerformanceData24hoursPreActions, - reloadAction: performanceData24hoursReloadAction -} = createExternal(performanceDataSearchHandler, appState => appState.performanceHistory.performanceData24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceDataHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceDataHandler.ts new file mode 100644 index 000000000..51b537fea --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceDataHandler.ts @@ -0,0 +1,65 @@ +/** + * ============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 moment from 'moment'; + +import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + +import { PerformanceResult, PerformanceDataType } from '../models/performanceDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface IPerformanceDataState extends IExternalTableState { } + +/** +* Creates elastic search material data fetch handler for performance data from historicalperformance15min database. +*/ +const performanceDataSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + es: hit._source["performance-data"]["es"], + ses: hit._source["performance-data"]["ses"], + unavailability: hit._source["performance-data"]["unavailability"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: performanceDataActionHandler, + createActions: createPerformanceDataActions, + createProperties: createPerformanceDataProperties, + createPreActions: createPerformanceDataPreActions, + reloadAction: performanceDataReloadAction +} = createExternal(performanceDataSearchHandler, appState => appState.performanceHistory.performanceData); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts index 43813e573..85ff01634 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts @@ -1,3 +1,20 @@ +/** + * ============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 { combineActionHandler } from '../../../../framework/src/flux/middleware'; @@ -7,45 +24,46 @@ import { IApplicationStoreState } from '../../../../framework/src/store/applicat import { IActionHandler } from '../../../../framework/src/flux/action'; import { IConnectAppStoreState } from '../../../connectApp/src/handlers/connectAppRootHandler'; -import { IPerformanceData15minState, performanceData15minActionHandler } from './performanceData15minHandler'; -import { IReceiveLevel15minState, receiveLevel15minActionHandler } from './receiveLevel15minHandler'; -import { ITransmissionPower15minState, transmissionPower15minActionHandler } from './transmissionPower15minHandler'; -import { IAdaptiveModulation15minState, adaptiveModulation15minActionHandler } from './adaptiveModulation15minHandler'; -import { ITemperature15minState, temperature15minActionHandler } from './temperature15minHandler'; -import { ISignalToInterference15minState, signalToInterference15minActionHandler } from './signalToInterference15minHandler'; -import { ICrossPolarDiscrimination15minState, crossPolarDiscrimination15minActionHandler } from './crossPolarDiscrimination15minHandler'; -import { IPerformanceData24hoursState, performanceData24hoursActionHandler } from './performanceData24hoursHandler'; -import { IReceiveLevel24hoursState, receiveLevel24hoursActionHandler } from './receiveLevel24hoursHandler'; -import { ITransmissionPower24hoursState, transmissionPower24hoursActionHandler } from './transmissionPower24hoursHandler'; -import { IAdaptiveModulation24hoursState, adaptiveModulation24hoursActionHandler } from './adaptiveModulation24hoursHandler'; -import { ITemperature24hoursState, temperature24hoursActionHandler } from './temperature24hoursHandler'; -import { ISignalToInterference24hoursState, signalToInterference24hoursActionHandler } from './signalToInterference24hoursHandler'; -import { ICrossPolarDiscrimination24hoursState, crossPolarDiscrimination24hoursActionHandler } from './crossPolarDiscrimination24hoursHandler'; +import { IPerformanceDataState, performanceDataActionHandler } from './performanceDataHandler'; +import { IReceiveLevelState, receiveLevelActionHandler } from './receiveLevelHandler'; +import { ITransmissionPowerState, transmissionPowerActionHandler } from './transmissionPowerHandler'; +import { IAdaptiveModulationState, adaptiveModulationActionHandler } from './adaptiveModulationHandler'; +import { ITemperatureState, temperatureActionHandler } from './temperatureHandler'; +import { ISignalToInterferenceState, signalToInterferenceActionHandler } from './signalToInterferenceHandler'; +import { ICrossPolarDiscriminationState, crossPolarDiscriminationActionHandler } from './crossPolarDiscriminationHandler'; import { SetPanelAction } from '../actions/panelChangeActions'; import { IConnectedNetworkElementsState, connectedNetworkElementsActionHandler } from './connectedNetworkElementsActionHandler'; import { IAvailableLtpsState, availableLtpsActionHandler } from './availableLtpsActionHandler'; +import { PmDataInterval } from '../models/performanceDataType'; +import { TimeChangeAction } from '../actions/timeChangeAction'; +import { UpdateMountId } from '../actions/connectedNetworkElementsActions'; export interface IPerformanceHistoryStoreState { + mountId: string; networkElements: IConnectedNetworkElementsState; ltps: IAvailableLtpsState; - performanceData15min: IPerformanceData15minState; - performanceData24hours: IPerformanceData24hoursState; - receiveLevel15min: IReceiveLevel15minState; - receiveLevel24hours: IReceiveLevel24hoursState; - transmissionPower15min: ITransmissionPower15minState; - transmissionPower24hours: ITransmissionPower24hoursState; - adaptiveModulation15min: IAdaptiveModulation15minState; - adaptiveModulation24hours: IAdaptiveModulation24hoursState; - temperature15min: ITemperature15minState; - temperature24hours: ITemperature24hoursState; - signalToInterference15min:ISignalToInterference15minState; - signalToInterference24hours:ISignalToInterference24hoursState; - crossPolarDiscrimination15min: ICrossPolarDiscrimination15minState; - crossPolarDiscrimination24hours: ICrossPolarDiscrimination24hoursState; + performanceData: IPerformanceDataState; + receiveLevel: IReceiveLevelState; + transmissionPower: ITransmissionPowerState; + adaptiveModulation: IAdaptiveModulationState; + temperature: ITemperatureState; + signalToInterference: ISignalToInterferenceState; + crossPolarDiscrimination: ICrossPolarDiscriminationState; currentOpenPanel: string | null; + pmDataIntervalType: PmDataInterval; +} +const mountIdHandler: IActionHandler = (state = "", action) => { + if (action instanceof UpdateMountId) { + state = ""; + if (action.nodeId) { + state = action.nodeId; + } + } + return state; } + const currentOpenPanelHandler: IActionHandler = (state = null, action) => { if (action instanceof SetPanelAction) { state = action.panelId; @@ -53,6 +71,13 @@ const currentOpenPanelHandler: IActionHandler = (state = null, ac return state; } +const currentPMDataIntervalHandler: IActionHandler = (state = PmDataInterval.pmInterval15Min, action) => { + if (action instanceof TimeChangeAction) { + state = action.time; + } + return state; +} + declare module '../../../../framework/src/store/applicationStore' { interface IApplicationStoreState { performanceHistory: IPerformanceHistoryStoreState; @@ -61,23 +86,18 @@ declare module '../../../../framework/src/store/applicationStore' { } const actionHandlers = { + mountId: mountIdHandler, networkElements: connectedNetworkElementsActionHandler, ltps: availableLtpsActionHandler, - performanceData15min: performanceData15minActionHandler, - performanceData24hours: performanceData24hoursActionHandler, - receiveLevel15min: receiveLevel15minActionHandler, - receiveLevel24hours: receiveLevel24hoursActionHandler, - transmissionPower15min: transmissionPower15minActionHandler, - transmissionPower24hours: transmissionPower24hoursActionHandler, - adaptiveModulation15min: adaptiveModulation15minActionHandler, - adaptiveModulation24hours: adaptiveModulation24hoursActionHandler, - temperature15min: temperature15minActionHandler, - temperature24hours: temperature24hoursActionHandler, - signalToInterference15min: signalToInterference15minActionHandler, - signalToInterference24hours: signalToInterference24hoursActionHandler, - crossPolarDiscrimination15min: crossPolarDiscrimination15minActionHandler, - crossPolarDiscrimination24hours: crossPolarDiscrimination24hoursActionHandler, - currentOpenPanel: currentOpenPanelHandler + performanceData: performanceDataActionHandler, + receiveLevel: receiveLevelActionHandler, + transmissionPower: transmissionPowerActionHandler, + adaptiveModulation: adaptiveModulationActionHandler, + temperature: temperatureActionHandler, + signalToInterference: signalToInterferenceActionHandler, + crossPolarDiscrimination: crossPolarDiscriminationActionHandler, + currentOpenPanel: currentOpenPanelHandler, + pmDataIntervalType: currentPMDataIntervalHandler }; const performanceHistoryRootHandler = combineActionHandler(actionHandlers); diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts deleted file mode 100644 index c7c5e177f..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel15minHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { ReceiveLevelDataType, ReceiveLevel, ReceiveLevelResult } from '../models/receiveLevelDataType'; - -export interface IReceiveLevel15minState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for receiveLevel from historicalperformance15min database. - */ -const receiveLevelSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: receiveLevel15minActionHandler, - createActions: createReceiveLevel15minActions, - createProperties: createReceiveLevel15minProperties, - createPreActions: createReceiveLevel15minPreActions, - reloadAction: receiveLevel15minReloadAction, -} = createExternal(receiveLevelSearchHandler, appState => appState.performanceHistory.receiveLevel15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts deleted file mode 100644 index f665dfdc6..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevel24hoursHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { ReceiveLevelDataType, ReceiveLevel, ReceiveLevelResult } from '../models/receiveLevelDataType'; - -export interface IReceiveLevel24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for receiveLevel from historicalperformance24h database. - */ -const receiveLevelSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: receiveLevel24hoursActionHandler, - createActions: createReceiveLevel24hoursActions, - createProperties: createReceiveLevel24hoursProperties, - createPreActions: createReceiveLevel24hoursPreActions, - reloadAction: receiveLevel24hoursReloadAction, -} = createExternal(receiveLevelSearchHandler, appState => appState.performanceHistory.receiveLevel24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevelHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevelHandler.ts new file mode 100644 index 000000000..adb70b120 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/receiveLevelHandler.ts @@ -0,0 +1,63 @@ +/** + * ============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 { ReceiveLevelDataType, ReceiveLevelResult } from '../models/receiveLevelDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface IReceiveLevelState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for receiveLevel from historicalperformance database. + */ +const receiveLevelSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + rxLevelMin: hit._source["performance-data"]["rx-level-min"], + rxLevelAvg: hit._source["performance-data"]["rx-level-avg"], + rxLevelMax: hit._source["performance-data"]["rx-level-max"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: receiveLevelActionHandler, + createActions: createReceiveLevelActions, + createProperties: createReceiveLevelProperties, + createPreActions: createReceiveLevelPreActions, + reloadAction: receiveLevelReloadAction, +} = createExternal(receiveLevelSearchHandler, appState => appState.performanceHistory.receiveLevel); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts deleted file mode 100644 index 536a89ea7..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference15minHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { SignalToInterferenceDataType, SignalToInterference, SignalToInterferenceResult } from '../models/signalToInteferenceDataType'; - -export interface ISignalToInterference15minState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for SINR from historicalperformance15min database. - */ -const signalToInterferenceSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: signalToInterference15minActionHandler, - createActions: createSignalToInterference15minActions, - createProperties: createSignalToInterference15minProperties, - createPreActions: createSignalToInterference15minPreActions, - reloadAction: signalToInterference15minReloadAction, -} = createExternal(signalToInterferenceSearchHandler, appState => appState.performanceHistory.signalToInterference15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts deleted file mode 100644 index a95d0aecf..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterference24hoursHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { SignalToInterferenceDataType, SignalToInterference, SignalToInterferenceResult } from '../models/signalToInteferenceDataType'; - -export interface ISignalToInterference24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for SINR from historicalperformance24h database. - */ -const signalToInterferenceSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: signalToInterference24hoursActionHandler, - createActions: createSignalToInterference24hoursActions, - createProperties: createSignalToInterference24hoursProperties, - createPreActions: createSignalToInterference24hoursPreActions, - reloadAction: signalToInterference24hoursReloadAction, -} = createExternal(signalToInterferenceSearchHandler, appState => appState.performanceHistory.signalToInterference24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterferenceHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterferenceHandler.ts new file mode 100644 index 000000000..aa75ba226 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/signalToInterferenceHandler.ts @@ -0,0 +1,63 @@ +/** + * ============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 { SignalToInterferenceDataType, SignalToInterferenceResult } from '../models/signalToInteferenceDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface ISignalToInterferenceState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for SINR from historicalperformance database. + */ +const signalToInterferenceSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + snirMin: hit._source["performance-data"]["snir-min"], + snirAvg: hit._source["performance-data"]["snir-avg"], + snirMax: hit._source["performance-data"]["snir-max"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: signalToInterferenceActionHandler, + createActions: createSignalToInterferenceActions, + createProperties: createSignalToInterferenceProperties, + createPreActions: createSignalToInterferencePreActions, + reloadAction: signalToInterferenceReloadAction, +} = createExternal(signalToInterferenceSearchHandler, appState => appState.performanceHistory.signalToInterference); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.ts deleted file mode 100644 index 20fb57035..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature15minHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { TemperatureDataType, Temperature, TemperatureResult } from '../models/temperatureDataType'; - -export interface ITemperature15minState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for Temperature from historicalperformance15min database. - */ -const temperatureSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: temperature15minActionHandler, - createActions: createTemperature15minActions, - createProperties: createTemperature15minProperties, - createPreActions: createTemperature15minPreActions, - reloadAction: temperature15minReloadAction, -} = createExternal(temperatureSearchHandler, appState => appState.performanceHistory.temperature15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts deleted file mode 100644 index 1c36ef876..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperature24hoursHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { TemperatureDataType, Temperature, TemperatureResult } from '../models/temperatureDataType'; - -export interface ITemperature24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for temperature from historicalperformance24h database. - */ -const temperatureSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: temperature24hoursActionHandler, - createActions: createTemperature24hoursActions, - createProperties: createTemperature24hoursProperties, - createPreActions: createTemperature24hoursPreActions, - reloadAction: temperature24hoursReloadAction, -} = createExternal(temperatureSearchHandler, appState => appState.performanceHistory.temperature24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperatureHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperatureHandler.ts new file mode 100644 index 000000000..8a9ae7025 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/temperatureHandler.ts @@ -0,0 +1,63 @@ +/** + * ============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 { TemperatureDataType, TemperatureResult } from '../models/temperatureDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface ITemperatureState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Temperature from historicalperformance database. + */ +const temperatureSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + rfTempMin: hit._source["performance-data"]["rf-temp-min"], + rfTempAvg: hit._source["performance-data"]["rf-temp-avg"], + rfTempMax: hit._source["performance-data"]["rf-temp-max"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: temperatureActionHandler, + createActions: createTemperatureActions, + createProperties: createTemperatureProperties, + createPreActions: createTemperaturePreActions, + reloadAction: temperatureReloadAction, +} = createExternal(temperatureSearchHandler, appState => appState.performanceHistory.temperature); + diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.ts deleted file mode 100644 index e6ba90f10..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower15minHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - - -import { TransmissionPowerDataType, TransmissionPower, TransmissionPowerResult } from '../models/transmissionPowerDataType'; - -export interface ITransmissionPower15minState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for Transmission power from historicalperformance15min database. - */ -const transmissionPowerSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance15min", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: transmissionPower15minActionHandler, - createActions: createTransmissionPower15minActions, - createProperties: createTransmissionPower15minProperties, - createPreActions: createTransmissionPower15minPreActions, - reloadAction: transmissionPower15minReloadAction, -} = createExternal(transmissionPowerSearchHandler, appState => appState.performanceHistory.transmissionPower15min); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts deleted file mode 100644 index de50629e1..000000000 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPower24hoursHandler.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { TransmissionPowerDataType, TransmissionPower, TransmissionPowerResult } from '../models/transmissionPowerDataType'; - -export interface ITransmissionPower24hoursState extends IExternalTableState { } - -/** - * Creates elastic search material data fetch handler for transmission power from historicalperformance24h database. - */ -const transmissionPowerSearchHandler = createSearchDataHandler( - "sdnperformance/historicalperformance24h", - null, - (hit) => ({ - _id: hit._id, - ...hit._source, - ...hit._source["performance-data"] - }), - (name) => `${name}`); - -export const { - actionHandler: transmissionPower24hoursActionHandler, - createActions: createTransmissionPower24hoursActions, - createProperties: createTransmissionPower24hoursProperties, - createPreActions: createTransmissionPower24hoursPreActions, - reloadAction: transmissionPower24hoursReloadAction, -} = createExternal(transmissionPowerSearchHandler, appState => appState.performanceHistory.transmissionPower24hours); - diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPowerHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPowerHandler.ts new file mode 100644 index 000000000..c2ad82183 --- /dev/null +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/transmissionPowerHandler.ts @@ -0,0 +1,63 @@ +/** + * ============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 { TransmissionPowerDataType, TransmissionPowerResult } from '../models/transmissionPowerDataType'; +import { getFilter } from '../utils/tableUtils'; + +export interface ITransmissionPowerState extends IExternalTableState { } + +/** + * Creates elastic search material data fetch handler for Transmission power from historicalperformance database. + */ +const transmissionPowerSearchHandler = createSearchDataHandler( + getFilter, + null, + (hit) => ({ + _id: hit._id, + radioSignalId: hit._source["radio-signal-id"], + scannerId: hit._source["scanner-id"], + utcTimeStamp: hit._source["time-stamp"], + suspectIntervalFlag: hit._source["suspect-interval-flag"], + txLevelMin: hit._source["performance-data"]["tx-level-min"], + txLevelAvg: hit._source["performance-data"]["tx-level-avg"], + txLevelMax: hit._source["performance-data"]["tx-level-max"], + }), + (pmDataEntry: string) => { + switch (pmDataEntry) { + case "radioSignalId": + return "radio-signal-id"; + case "scannerId": + return "scanner-id"; + case "utcTimeStamp": + return "time-stamp" + case "suspectIntervalFlag": + return "suspect-interval-flag"; + } + return pmDataEntry + }); + +export const { + actionHandler: transmissionPowerActionHandler, + createActions: createTransmissionPowerActions, + createProperties: createTransmissionPowerProperties, + createPreActions: createTransmissionPowerPreActions, + reloadAction: transmissionPowerReloadAction, +} = createExternal(transmissionPowerSearchHandler, appState => appState.performanceHistory.transmissionPower); + -- cgit 1.2.3-korg