2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 import React, {Component} from 'react';
27 import {connect} from 'react-redux';
29 import TierSupport from './tierSupport/TierSupport.jsx';
30 import VnfSearch from './vnfSearch/VnfSearch.jsx';
31 import MainScreenHeader from './MainScreenHeader.jsx';
33 import DynamicViewLoader from
34 'generic-components/dynamicViewLoader/dynamicViewLoader.jsx';
41 } from 'react-router-dom';
45 } from './MainScreenWrapperActionHelper.js';
47 import customViews from 'resources/views/customViews.json';
49 const mapStateToProps = ({mainWrapper}) => {
52 toggleButtonActive = false
61 const mapActionsToProps = (dispatch) => {
63 onWindowSizeChange: () => dispatch(windowResize())
67 class MainScreenWrapper extends Component {
71 window.addEventListener('resize', () => {
72 this.props.onWindowSizeChange();
77 let customViewList = [];
79 // add all custom views
80 for (let view in customViews) {
82 <Route path={'/' + customViews[view]['viewName']}
83 component={DynamicViewLoader}/>
91 <Redirect from='/' exact to='/viewInspect'/>
93 <Route path='/' component={MainScreenHeader}/>
94 <Route path='/viewInspect/:viParam?' component={TierSupport}/>
95 <Route path='/vnfSearch/:vnfParam?' component={VnfSearch}/>
103 export default connect(mapStateToProps, mapActionsToProps)(MainScreenWrapper);