summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/app')
-rw-r--r--src/app/MainScreenHeader.jsx30
-rw-r--r--src/app/MainScreenWrapper.jsx33
-rw-r--r--src/app/extensibility/index.js1
-rw-r--r--src/app/globalInlineMessageBar/GlobalInlineMessageBar.jsx5
-rw-r--r--src/app/networking/NetworkCalls.js28
-rw-r--r--src/app/tierSupport/TierSupport.jsx17
-rw-r--r--src/app/tierSupport/launchExternalResource/LaunchExternalResource.jsx3
-rw-r--r--src/app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx7
-rw-r--r--src/app/vnfSearch/VnfSearch.jsx17
-rw-r--r--src/app/vnfSearch/VnfSearchNfRoleVisualization.jsx5
-rw-r--r--src/app/vnfSearch/VnfSearchNfTypeVisualization.jsx5
-rw-r--r--src/app/vnfSearch/VnfSearchOrchestratedStatusVisualization.jsx5
-rw-r--r--src/app/vnfSearch/VnfSearchProvStatusVisualization.jsx5
-rw-r--r--src/app/vnfSearch/VnfSearchTotalCountVisualization.jsx9
14 files changed, 115 insertions, 55 deletions
diff --git a/src/app/MainScreenHeader.jsx b/src/app/MainScreenHeader.jsx
index ec1efda..e485161 100644
--- a/src/app/MainScreenHeader.jsx
+++ b/src/app/MainScreenHeader.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import FontAwesome from 'react-fontawesome';
import {clearFilters} from 'filter-bar-utils';
@@ -29,7 +30,6 @@ import {postAnalyticsData} from 'app/analytics/AnalyticsActions.js';
import GlobalInlineMessageBar from 'app/globalInlineMessageBar/GlobalInlineMessageBar.jsx';
import {getClearGlobalMessageEvent} from 'app/globalInlineMessageBar/GlobalInlineMessageBarActions.js';
import {externalUrlRequest, externalMessageRequest, getSubscriptionPayload} from 'app/contextHandler/ContextHandlerActions.js';
-
import {
filterBarActionTypes
} from 'utils/GlobalConstants.js';
@@ -106,11 +106,11 @@ const mapActionsToProps = (dispatch) => {
class MainScreenHeader extends Component {
static propTypes = {
- showMenu: React.PropTypes.bool,
- toggleButtonActive: React.PropTypes.bool,
- externalRequestFound: React.PropTypes.object,
- secondaryTitle: React.PropTypes.string,
- subscriptionPayload: React.PropTypes.object
+ showMenu: PropTypes.bool,
+ toggleButtonActive: PropTypes.bool,
+ externalRequestFound: PropTypes.object,
+ secondaryTitle: PropTypes.string,
+ subscriptionPayload: PropTypes.object
};
navigationLinkAndCurrentPathMatch(location, to) {
@@ -265,11 +265,19 @@ class MainScreenHeader extends Component {
// add all custom view menu options
for (let view in extensibleViews) {
- menuOptions.push(
- <MenuItem key={extensibleViews[view]['viewName'] + 'Menu'} to={'/' + extensibleViews[view]['viewName']}
- label={extensibleViews[view]['displayName']}
- iconClass={'button-icon ' + extensibleViews[view]['iconClass']}/>
- );
+ let shouldDisplayIcon = false;
+ if(extensibleViews[view]['onlyRoute'] === undefined){
+ shouldDisplayIcon = true;
+ } else if(extensibleViews[view]['onlyRoute'] === false){
+ shouldDisplayIcon = true;
+ }
+ if(shouldDisplayIcon === true){
+ menuOptions.push(
+ <MenuItem key={extensibleViews[view]['viewName'] + 'Menu'} to={'/' + extensibleViews[view]['viewName']}
+ label={extensibleViews[view]['displayName']}
+ iconClass={'button-icon ' + extensibleViews[view]['iconClass']}/>
+ );
+ }
}
let secondaryTitleClass = 'secondary-header';
diff --git a/src/app/MainScreenWrapper.jsx b/src/app/MainScreenWrapper.jsx
index f3f29a0..6689af9 100644
--- a/src/app/MainScreenWrapper.jsx
+++ b/src/app/MainScreenWrapper.jsx
@@ -25,8 +25,8 @@ 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 {genericRequest} from 'app/networking/NetworkCalls.js';
import {
Route,
HashRouter as Router,
@@ -94,9 +94,20 @@ class MainScreenWrapper extends Component {
let customViewList = [];
extensibleViews.forEach(function(view,key) {
+
+ let path = '',
+ extKey = '';
+ if(isEmpty(extensibleViews[key]['viewParams'])){
+ path = '/' + view.viewName + '/:extensibleViewParams?';
+ extKey = view.viewName + 'Route';
+ } else {
+ path = '/' + view.viewName + view.viewParams;
+ extKey = view.viewName + view.viewParams + 'Route';
+ }
+
var renderComponent = (props) => {
let viewParams = {};
- if(props.match.params.extensibleViewParams !== undefined) {
+ if(isEmpty(extensibleViews[key]['viewParams']) && props.match.params.extensibleViewParams !== undefined) {
viewParams = decryptParamsForView(props.match.params.extensibleViewParams);
}
@@ -117,17 +128,25 @@ class MainScreenWrapper extends Component {
changeRouteCallback = {(routeParam, historyObj) => {
changeUrlAddress(routeParam, historyObj);
}}
+ networkingCallbackPromise = {(url, relativeURL, httpMethodType) => {
+ return genericRequest(url, relativeURL, httpMethodType);
+ }}
viewName={view.displayName}
viewData={extensibleViewNetworkCallbackData}
viewParams={viewParams}/>
);
}
};
-
- customViewList.push(
- <Route key={extensibleViews[key]['viewName'] + 'Route'} path={'/' + extensibleViews[key]['viewName'] + '/:extensibleViewParams?' }
- render={renderComponent}/>
+ if(isEmpty(extensibleViews[key]['isExact']) && !extensibleViews[key]['isExact']){
+ customViewList.push(
+ <Route key={extKey} path={path} render={renderComponent}/>
+ );
+ } else {
+ customViewList.push(
+ <Route key={extKey} exact path={path} render={renderComponent}/>
);
+ }
+
});
return (
diff --git a/src/app/extensibility/index.js b/src/app/extensibility/index.js
index 28e61d3..3ca3ef6 100644
--- a/src/app/extensibility/index.js
+++ b/src/app/extensibility/index.js
@@ -21,7 +21,6 @@
// Import section (used as anchor to add extension imports)
let components = {};
-
// Components section (used as an anchor to add extension components)
export default components;
diff --git a/src/app/globalInlineMessageBar/GlobalInlineMessageBar.jsx b/src/app/globalInlineMessageBar/GlobalInlineMessageBar.jsx
index cb8b3df..ff3ccae 100644
--- a/src/app/globalInlineMessageBar/GlobalInlineMessageBar.jsx
+++ b/src/app/globalInlineMessageBar/GlobalInlineMessageBar.jsx
@@ -20,6 +20,7 @@
*/
import {connect} from 'react-redux';
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import InlineMessage from 'generic-components/InlineMessage/InlineMessage.jsx';
@@ -37,8 +38,8 @@ let mapStateToProps = ({globalInlineMessageBar}) => {
export class GlobalInlineMessageBar extends Component {
static propTypes = {
- feedbackMsgText: React.PropTypes.string,
- feedbackMsgSeverity: React.PropTypes.string
+ feedbackMsgText: PropTypes.string,
+ feedbackMsgSeverity: PropTypes.string
};
render() {
diff --git a/src/app/networking/NetworkCalls.js b/src/app/networking/NetworkCalls.js
index af343e1..63c08ed 100644
--- a/src/app/networking/NetworkCalls.js
+++ b/src/app/networking/NetworkCalls.js
@@ -18,6 +18,9 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
+import {BASE_URL} from 'app/networking/NetworkConstants.js';
+
function fetchRequest(URL, POST, POST_HEADER, BODY) {
return fetch(URL, {
credentials: 'same-origin',
@@ -42,13 +45,34 @@ function getRequest(URL, GET) {
return fetch(URL, {
credentials: 'same-origin',
method: GET
- });
+ }).then(
+ (response) => response.json()
+ );
}
+const genericRequest = (url, relativeURL, httpMethodType) => {
+ let URL;
+ if(relativeURL){
+ URL = BASE_URL.concat(url);
+ } else {
+ URL = url;
+ }
+ switch(httpMethodType){
+ case 'GET':
+ return fetch(URL, {
+ credentials: 'same-origin',
+ method: 'GET'
+ }).then(
+ (response) => response.json()
+ );
+ }
+};
+
module.exports = {
fetchRequest: fetchRequest,
fetchRequestObj: fetchRequestObj,
- getRequest: getRequest
+ getRequest: getRequest,
+ genericRequest: genericRequest
};
diff --git a/src/app/tierSupport/TierSupport.jsx b/src/app/tierSupport/TierSupport.jsx
index a081964..5608cd3 100644
--- a/src/app/tierSupport/TierSupport.jsx
+++ b/src/app/tierSupport/TierSupport.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import SplitPane from 'react-split-pane';
import Spinner from 'utils/SpinnerContainer.jsx';
@@ -125,14 +126,14 @@ let mapActionToProps = (dispatch) => {
class TierSupport extends Component {
static propTypes = {
- forceDirectedGraphRawData: React.PropTypes.object,
- windowWidth: React.PropTypes.number,
- windowHeight: React.PropTypes.number,
- graphNodeSelectedMenu: React.PropTypes.string,
- feedbackMsgText: React.PropTypes.string,
- feedbackMsgSeverity: React.PropTypes.string,
- nodeData: React.PropTypes.object,
- enableBusyFeedback: React.PropTypes.bool
+ forceDirectedGraphRawData: PropTypes.object,
+ windowWidth: PropTypes.number,
+ windowHeight: PropTypes.number,
+ graphNodeSelectedMenu: PropTypes.string,
+ feedbackMsgText: PropTypes.string,
+ feedbackMsgSeverity: PropTypes.string,
+ nodeData: PropTypes.object,
+ enableBusyFeedback: PropTypes.bool
};
componentWillReceiveProps(nextProps) {
diff --git a/src/app/tierSupport/launchExternalResource/LaunchExternalResource.jsx b/src/app/tierSupport/launchExternalResource/LaunchExternalResource.jsx
index 4e8cec3..d132d3d 100644
--- a/src/app/tierSupport/launchExternalResource/LaunchExternalResource.jsx
+++ b/src/app/tierSupport/launchExternalResource/LaunchExternalResource.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import {connect} from 'react-redux';
+import { PropTypes } from 'prop-types';
import React, {Component} from 'react';
import {isEmpty} from 'lodash';
import Button from 'react-bootstrap/lib/Button.js';
@@ -33,7 +34,7 @@ let mapStateToProps = ({tierSupport: {launchExternalResourceReducer}}) => {
class LaunchExternalResource extends Component {
static propTypes = {
- externalResourcePayload: React.PropTypes.object
+ externalResourcePayload: PropTypes.object
};
render() {
diff --git a/src/app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx b/src/app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx
index 5750fd9..6ff0e53 100644
--- a/src/app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx
+++ b/src/app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx
@@ -20,6 +20,7 @@
*/
import {connect} from 'react-redux';
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import Table from 'react-bootstrap/lib/Table';
import LaunchInContext from 'app/tierSupport/launchExternalResource/LaunchExternalResource.jsx';
import i18n from 'utils/i18n/i18n';
@@ -41,9 +42,9 @@ let mapStateToProps = ({tierSupport: {selectedNodeDetails}}) => {
export class SelectedNodeDetails extends Component {
static propTypes = {
- nodeData: React.PropTypes.object,
- nodeType: React.PropTypes.string,
- uid: React.PropTypes.string
+ nodeData: PropTypes.object,
+ nodeType: PropTypes.string,
+ uid: PropTypes.string
};
render() {
diff --git a/src/app/vnfSearch/VnfSearch.jsx b/src/app/vnfSearch/VnfSearch.jsx
index a409ce2..edfe8cd 100644
--- a/src/app/vnfSearch/VnfSearch.jsx
+++ b/src/app/vnfSearch/VnfSearch.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import {
@@ -159,14 +160,14 @@ let mapActionToProps = (dispatch) => {
export class vnfSearch extends Component {
static propTypes = {
- feedbackMsgText: React.PropTypes.string,
- feedbackSeverity: React.PropTypes.string,
- vnfFilters: React.PropTypes.object,
- selectedFilterValues: React.PropTypes.object,
- vnfFilterValues: React.PropTypes.object,
- vnfVisualizationPanelClass: React.PropTypes.string,
- unifiedFilterValues: React.PropTypes.object,
- nonConvertedFilters: React.PropTypes.object
+ feedbackMsgText: PropTypes.string,
+ feedbackSeverity: PropTypes.string,
+ vnfFilters: PropTypes.object,
+ selectedFilterValues: PropTypes.object,
+ vnfFilterValues: PropTypes.object,
+ vnfVisualizationPanelClass: PropTypes.string,
+ unifiedFilterValues: PropTypes.object,
+ nonConvertedFilters: PropTypes.object
};
componentWillMount() {
diff --git a/src/app/vnfSearch/VnfSearchNfRoleVisualization.jsx b/src/app/vnfSearch/VnfSearchNfRoleVisualization.jsx
index a71b2ab..93a6695 100644
--- a/src/app/vnfSearch/VnfSearchNfRoleVisualization.jsx
+++ b/src/app/vnfSearch/VnfSearchNfRoleVisualization.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import {
BarChart,
@@ -50,8 +51,8 @@ let mapStateToProps = ({vnfSearch}) => {
export class VnfSearchNfRoleVisualization extends Component {
static propTypes = {
- processedNfRoleCountChartData: React.PropTypes.object,
- enableBusyFeedback: React.PropTypes.bool
+ processedNfRoleCountChartData: PropTypes.object,
+ enableBusyFeedback: PropTypes.bool
};
render() {
diff --git a/src/app/vnfSearch/VnfSearchNfTypeVisualization.jsx b/src/app/vnfSearch/VnfSearchNfTypeVisualization.jsx
index 492d1c9..71e85e8 100644
--- a/src/app/vnfSearch/VnfSearchNfTypeVisualization.jsx
+++ b/src/app/vnfSearch/VnfSearchNfTypeVisualization.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import {
BarChart,
@@ -50,8 +51,8 @@ let mapStateToProps = ({vnfSearch}) => {
export class VnfSearchNfTypeVisualization extends Component {
static propTypes = {
- processedNfTypeCountChartData: React.PropTypes.object,
- enableBusyFeedback: React.PropTypes.bool
+ processedNfTypeCountChartData: PropTypes.object,
+ enableBusyFeedback: PropTypes.bool
};
render() {
diff --git a/src/app/vnfSearch/VnfSearchOrchestratedStatusVisualization.jsx b/src/app/vnfSearch/VnfSearchOrchestratedStatusVisualization.jsx
index 8dc25ca..bb42ef2 100644
--- a/src/app/vnfSearch/VnfSearchOrchestratedStatusVisualization.jsx
+++ b/src/app/vnfSearch/VnfSearchOrchestratedStatusVisualization.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import {
BarChart,
@@ -50,8 +51,8 @@ let mapStateToProps = ({vnfSearch}) => {
export class VnfSearchOrchStatusVisualizations extends Component {
static propTypes = {
- processedOrchStatusCountChartData: React.PropTypes.object,
- enableBusyFeedback: React.PropTypes.bool
+ processedOrchStatusCountChartData: PropTypes.object,
+ enableBusyFeedback: PropTypes.bool
};
render() {
diff --git a/src/app/vnfSearch/VnfSearchProvStatusVisualization.jsx b/src/app/vnfSearch/VnfSearchProvStatusVisualization.jsx
index 07ba988..aec5bac 100644
--- a/src/app/vnfSearch/VnfSearchProvStatusVisualization.jsx
+++ b/src/app/vnfSearch/VnfSearchProvStatusVisualization.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import {
BarChart,
@@ -50,8 +51,8 @@ let mapStateToProps = ({vnfSearch}) => {
export class VnfSearchProvStatusVisualization extends Component {
static propTypes = {
- processedProvStatusCountChartData: React.PropTypes.object,
- enableBusyFeedback: React.PropTypes.bool
+ processedProvStatusCountChartData: PropTypes.object,
+ enableBusyFeedback: PropTypes.bool
};
render() {
diff --git a/src/app/vnfSearch/VnfSearchTotalCountVisualization.jsx b/src/app/vnfSearch/VnfSearchTotalCountVisualization.jsx
index 3c73d22..e115933 100644
--- a/src/app/vnfSearch/VnfSearchTotalCountVisualization.jsx
+++ b/src/app/vnfSearch/VnfSearchTotalCountVisualization.jsx
@@ -19,6 +19,7 @@
* ============LICENSE_END=========================================================
*/
import React, {Component} from 'react';
+import { PropTypes } from 'prop-types';
import {connect} from 'react-redux';
import i18n from 'utils/i18n/i18n';
@@ -40,11 +41,11 @@ let mapStateToProps = ({vnfSearch}) => {
export class VnfSearchTotalCountVisualization extends Component {
static propTypes = {
- count: React.PropTypes.oneOfType([
- React.PropTypes.string,
- React.PropTypes.number
+ count: PropTypes.oneOfType([
+ PropTypes.string,
+ PropTypes.number
]),
- enableBusyFeedback: React.PropTypes.bool
+ enableBusyFeedback: PropTypes.bool
};
render() {