Adding Violation History to DIO 99/33199/2
authorsteventh <steve.thomas@amdocs.com>
Tue, 27 Feb 2018 16:40:28 +0000 (11:40 -0500)
committersteventh <steve.thomas@amdocs.com>
Tue, 27 Feb 2018 19:50:13 +0000 (14:50 -0500)
Issue-ID: AAI-817
Change-Id: I2fbdbea3eedc568ef7046d83496890969a0c85ec
Signed-off-by: steventh <steve.thomas@amdocs.com>
src/app/MainScreenWrapper.jsx
src/app/MainScreenWrapperActionHelper.js
src/app/tierSupport/TierSupport.jsx
src/app/tierSupport/TierSupportConstants.js
src/app/tierSupport/TierSupportReducer.js
webpack.devConfig.js

index 1b1088b..d1abf12 100644 (file)
@@ -39,6 +39,7 @@ import {
 import {
   windowResize,
   extensibleViewNetworkCallback,
+  overlayNetworkCallback,
   extensibleViewMessageCallback
 } from './MainScreenWrapperActionHelper.js';
 
@@ -66,6 +67,9 @@ const mapActionsToProps = (dispatch) => {
     },
     onExtensibleViewMessageCallback: (message, messageSevirity) => {
       dispatch(extensibleViewMessageCallback(message, messageSevirity));
+    },
+    onOverlayNetworkCallback: (apiUrl, body, viewName, curViewData, responseEventKey) =>  {
+      dispatch(overlayNetworkCallback(apiUrl, body, viewName, curViewData, responseEventKey));
     }
   };
 };
@@ -86,7 +90,8 @@ class MainScreenWrapper extends Component {
     const {
       onExtensibleViewNetworkCallback,
       extensibleViewNetworkCallbackData,
-      onExtensibleViewMessageCallback
+      onExtensibleViewMessageCallback,
+      onOverlayNetworkCallback
     } = this.props;
 
     let customViewList = [];
@@ -105,6 +110,9 @@ class MainScreenWrapper extends Component {
               networkingCallback={(apiUrl, body, paramName, curViewData) => {
                 onExtensibleViewNetworkCallback(apiUrl, body, paramName, curViewData);
               }}
+              overlayCallback={(apiUrl, body, paramName, curOverlayData,responseEventKey) => {
+                onOverlayNetworkCallback(apiUrl, body, paramName, curOverlayData, responseEventKey);
+              }}
               messagingCallback ={(message, messageSeverity) => {
                 onExtensibleViewMessageCallback(message, messageSeverity);
               }}
index 6278f29..3e22206 100644 (file)
@@ -20,7 +20,6 @@
  *
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
-import {aaiActionTypes} from './MainScreenWrapperConstants.js';
 import {
   POST,
   POST_HEADER,
@@ -36,6 +35,7 @@ import {
   getSetGlobalMessageEvent,
   getClearGlobalMessageEvent
 } from 'app/globalInlineMessageBar/GlobalInlineMessageBarActions.js';
+import {aaiActionTypes} from 'app/MainScreenWrapperConstants.js';
 
 function createWindowSizeChangeEvent() {
   return {
@@ -64,6 +64,45 @@ export function showMainMenu(show) {
   };
 }
 
+function createOverlayDataFoundEvent(overlayData, paramName, curData, responseEventKey) {
+  return {
+    type: responseEventKey,
+    data: {
+      paramName: paramName,
+      overlayData: overlayData,
+      curData: curData
+    }
+  };
+}
+
+function overlayViewData(dataFetchRequest, paramName, curData, responseEventKey) {
+  return dispatch => {
+    dataFetchRequest().then(
+      (response) => {
+        return response.json();
+      }
+    ).then(
+      (responseJson) => {
+        dispatch(createOverlayDataFoundEvent(responseJson, paramName, curData, responseEventKey));
+      }).catch(
+      () => {
+        dispatch(getSetGlobalMessageEvent(ERROR_RETRIEVING_DATA, MESSAGE_LEVEL_DANGER));
+        dispatch(createOverlayDataFoundEvent({}, paramName, curData, responseEventKey));
+      });
+  };
+}
+
+export function overlayNetworkCallback(urlApi, postBody, paramName, curData, responseEventKey) {
+  let dataFetchRequest =
+    () => fetchRequestObj(BASE_URL + urlApi, POST,
+      POST_HEADER, JSON.stringify(postBody));
+
+
+  return dispatch => {
+    dispatch(overlayViewData(dataFetchRequest, paramName, curData, responseEventKey));
+  };
+}
+
 function createViewDataFoundEvent(viewData, paramName, curViewData) {
   var obj = {};
   obj['data'] = {};
index e51dde8..8495955 100644 (file)
@@ -31,6 +31,10 @@ import ForceDirectedGraph from 'generic-components/graph/ForceDirectedGraph.jsx'
 import SelectedNodeDetails from 'app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx';
 
 
+import {
+  overlayNetworkCallback,
+} from '../MainScreenWrapperActionHelper.js';
+
 import overlaysDetails from 'resources/overlays/overlaysDetails.json';
 import * as Overlays from 'app/overlays/OverlayImports.js';
 
@@ -48,6 +52,7 @@ import {
   TSUI_NODE_DETAILS_INITIAL_WIDTH,
   TSUI_NODE_DETAILS_MIN_WIDTH,
   TSUI_GRAPH_MENU_NODE_DETAILS,
+  tierSupportActionTypes
 } from './TierSupportConstants.js';
 
 let mapStateToProps = (
@@ -114,6 +119,9 @@ let mapActionToProps = (dispatch) => {
     },
     onRequestClearData: () => {
       dispatch(clearVIData());
+    },
+    onOverlayNetworkCallback: (apiUrl, body, viewName, curViewData, responseEventKey) =>  {
+      dispatch(overlayNetworkCallback(apiUrl, body, viewName, curViewData, responseEventKey));
     }
   };
 };
@@ -259,7 +267,17 @@ class TierSupport extends Component {
       if (this.isNotEmpty(this.props.nodeData) && overlayComponent) {
         if (Overlays.default.hasOwnProperty(overlayComponent)) {
           let OverlayComponent = Overlays.default[overlayComponent];
-          secondOverlay = <OverlayComponent nodeDetails={this.props.nodeData}/>;
+          secondOverlay = <OverlayComponent
+            nodeDetails={this.props.nodeData}
+            networkingCallback={(apiUrl, body, paramName, curViewData) => {
+              this.props.onOverlayNetworkCallback(
+                apiUrl,
+                body,
+                paramName,
+                curViewData,
+                tierSupportActionTypes.TS_OVERLAY_NETWORK_CALLBACK_RESPONSE_RECEIVED);
+            }} />;
+
         }
       }
       return secondOverlay;
index d66816e..202f70c 100644 (file)
@@ -34,7 +34,8 @@ export const tierSupportActionTypes = keyMirror({
   SPLIT_PANE_RESIZE: null,
   TIER_SUPPORT_CLEAR_DATA: null,
   TIER_SUPPORT_ACTIVATE_BUSY_FEEDBACK: null,
-  TIER_SUPPORT_DISABLE_BUSY_FEEDBACK: null
+  TIER_SUPPORT_DISABLE_BUSY_FEEDBACK: null,
+  TS_OVERLAY_NETWORK_CALLBACK_RESPONSE_RECEIVED: null
 });
 
 export const TSUI_NODE_DETAILS_INITIAL_WIDTH = 300;
index c9a4faf..7062360 100644 (file)
@@ -98,7 +98,7 @@ export default combineReducers({
         return {
           ...state,
           enableBusyFeedback: false
-        };  
+        };
       case globalAutoCompleteSearchBarActionTypes.SEARCH_WARNING_EVENT:
         let emptyNodesAndLinksWarningEvent = ForceDirectedGraph.generateNewProps([], [], {});
         return {
@@ -118,6 +118,13 @@ export default combineReducers({
         } else {
           return state;
         }
+      case tierSupportActionTypes.TS_OVERLAY_NETWORK_CALLBACK_RESPONSE_RECEIVED:
+        let newNodeData = JSON.parse(JSON.stringify(action.data.curData));
+        newNodeData[action.data.paramName] = action.data.overlayData;
+        return {
+          ...state,
+          nodeData: newNodeData
+        };
     }
 
     return state;
index e21529f..ca3a7ec 100644 (file)
@@ -64,7 +64,7 @@ module.exports = {
                progress: true,
                inline: true,
                debug: true,
-  https: true,
+       https: true,
                stats: {
                        colors: true
                }

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use