Add support for multiple views per extensibility 87/63887/2
authorArul.Nambi <arul.nambi@amdocs.com>
Thu, 30 Aug 2018 19:19:25 +0000 (15:19 -0400)
committerArul.Nambi <arul.nambi@amdocs.com>
Thu, 30 Aug 2018 19:29:44 +0000 (15:29 -0400)
Issue-ID: AAI-1556
Change-Id: I9af4cf5287cb903f500a59ff15ec3eb5f12d99e9
Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
resources/views/extensibleViews.json
src/app/MainScreenWrapper.jsx

index f3f29a0..192c11d 100644 (file)
@@ -25,7 +25,7 @@ import TierSupport from './tierSupport/TierSupport.jsx';
 import VnfSearch from './vnfSearch/VnfSearch.jsx';
 import MainScreenHeader from './MainScreenHeader.jsx';
 import {decryptParamsForView, changeUrlAddress} from 'utils/Routes.js';
-
+import {isEmpty} from 'lodash';
 
 import {
   Route,
@@ -94,6 +94,13 @@ class MainScreenWrapper extends Component {
 
     let customViewList = [];
     extensibleViews.forEach(function(view,key) {
+
+      let path;
+      if(isEmpty(extensibleViews[key]['routePath'])){
+        path = '/' + view.viewName + '/:extensibleViewParams?';
+      } else {
+        path = '/' + view.viewName  + view.routePath + '/:extensibleViewParams?';
+      }
       var renderComponent = (props) => {
         let viewParams = {};
         if(props.match.params.extensibleViewParams !== undefined) {
@@ -125,7 +132,7 @@ class MainScreenWrapper extends Component {
       };
 
       customViewList.push(
-          <Route key={extensibleViews[key]['viewName'] + 'Route'} path={'/' + extensibleViews[key]['viewName'] + '/:extensibleViewParams?' }
+          <Route key={extensibleViews[key]['viewName'] + 'Route'} path={path}
              render={renderComponent}/>
       );
     });

© 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