diff options
Diffstat (limited to 'src/app/MainScreenHeader.jsx')
-rw-r--r-- | src/app/MainScreenHeader.jsx | 30 |
1 files changed, 19 insertions, 11 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'; |