diff options
author | Arul.Nambi <arul.nambi@amdocs.com> | 2018-08-30 15:19:25 -0400 |
---|---|---|
committer | Arul.Nambi <arul.nambi@amdocs.com> | 2018-08-30 15:29:44 -0400 |
commit | 3d6886c9c4ab551d3aefa00c5f1751459ee1140b (patch) | |
tree | 95140cf4cd559449edf5bb4050808796cc792e25 | |
parent | 45de05c45d952d3a302fffc76c79aef7a48b04ed (diff) |
Add support for multiple views per extensibility
Issue-ID: AAI-1556
Change-Id: I9af4cf5287cb903f500a59ff15ec3eb5f12d99e9
Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
-rw-r--r-- | resources/views/extensibleViews.json | 2 | ||||
-rw-r--r-- | src/app/MainScreenWrapper.jsx | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/resources/views/extensibleViews.json b/resources/views/extensibleViews.json index 0d4f101..32960f8 100644 --- a/resources/views/extensibleViews.json +++ b/resources/views/extensibleViews.json @@ -1,2 +1,2 @@ [ -] +]
\ No newline at end of file diff --git a/src/app/MainScreenWrapper.jsx b/src/app/MainScreenWrapper.jsx index f3f29a0..192c11d 100644 --- a/src/app/MainScreenWrapper.jsx +++ b/src/app/MainScreenWrapper.jsx @@ -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}/> ); }); |