Skip to content

Commit

Permalink
Merge pull request #3157 from NCI-Agency/fix-missing-navigation
Browse files Browse the repository at this point in the history
Ensure left-side navigation menu is present when needed
  • Loading branch information
VassilIordanov committed Aug 26, 2020
2 parents a2500d4 + d19bebc commit 228f600
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
18 changes: 16 additions & 2 deletions client/src/pages/dashboards/BoardDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ import {
PathFindingLinkFactory,
DagreEngine
} from "@projectstorm/react-diagrams-routing"
import { DEFAULT_PAGE_PROPS } from "actions"
import LinkTo from "components/LinkTo"
import MultiTypeAdvancedSelectComponent from "components/advancedSelectWidget/MultiTypeAdvancedSelectComponent"
import { mapPageDispatchersToProps } from "components/Page"
import {
mapPageDispatchersToProps,
PageDispatchersPropType,
useBoilerplate
} from "components/Page"
import FileSaver from "file-saver"
import * as Models from "models"
import PropTypes from "prop-types"
Expand Down Expand Up @@ -96,7 +101,12 @@ PrototypeNode.propTypes = {
onClick: PropTypes.func
}

const BoardDashboard = () => {
const BoardDashboard = ({ pageDispatchers }) => {
// Make sure we have a navigation menu
useBoilerplate({
pageProps: DEFAULT_PAGE_PROPS,
pageDispatchers
})
const { dashboard } = useParams()
const dashboardSettings = Settings.dashboards.find(o => o.label === dashboard)
const [dropEvent, setDropEvent] = useState(null)
Expand Down Expand Up @@ -331,4 +341,8 @@ const BoardDashboard = () => {
)
}

BoardDashboard.propTypes = {
pageDispatchers: PageDispatchersPropType
}

export default connect(null, mapPageDispatchersToProps)(BoardDashboard)
21 changes: 19 additions & 2 deletions client/src/pages/positions/MyCounterparts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import { DEFAULT_PAGE_PROPS } from "actions"
import AppContext from "components/AppContext"
import Fieldset from "components/Fieldset"
import {
mapPageDispatchersToProps,
PageDispatchersPropType,
useBoilerplate
} from "components/Page"
import PositionTable from "components/PositionTable"
import React, { useContext } from "react"
import { connect } from "react-redux"

const MyCounterparts = () => {
const MyCounterparts = ({ pageDispatchers }) => {
// Make sure we have a navigation menu
useBoilerplate({
pageProps: DEFAULT_PAGE_PROPS,
pageDispatchers
})
const { currentUser } = useContext(AppContext)
return (
<div>
Expand All @@ -13,4 +25,9 @@ const MyCounterparts = () => {
</div>
)
}
export default MyCounterparts

MyCounterparts.propTypes = {
pageDispatchers: PageDispatchersPropType
}

export default connect(null, mapPageDispatchersToProps)(MyCounterparts)
9 changes: 8 additions & 1 deletion client/src/pages/reports/MyReports.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { DEFAULT_PAGE_PROPS } from "actions"
import AppContext from "components/AppContext"
import Fieldset from "components/Fieldset"
import { AnchorNavItem } from "components/Nav"
import {
mapPageDispatchersToProps,
PageDispatchersPropType,
mapPageDispatchersToProps
useBoilerplate
} from "components/Page"
import ReportCollection, {
FORMAT_CALENDAR,
Expand All @@ -20,6 +22,11 @@ import { Nav } from "react-bootstrap"
import { connect } from "react-redux"

const MyReports = ({ pageDispatchers, searchQuery }) => {
// Make sure we have a navigation menu
useBoilerplate({
pageProps: DEFAULT_PAGE_PROPS,
pageDispatchers
})
const {
currentUser: { uuid }
} = useContext(AppContext)
Expand Down
10 changes: 8 additions & 2 deletions client/src/pages/tasks/MyTasks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { setPagination } from "actions"
import { DEFAULT_PAGE_PROPS, setPagination } from "actions"
import AppContext from "components/AppContext"
import Fieldset from "components/Fieldset"
import LinkTo from "components/LinkTo"
import {
mapPageDispatchersToProps,
PageDispatchersPropType,
mapPageDispatchersToProps
useBoilerplate
} from "components/Page"
import {
SearchQueryPropType,
Expand All @@ -25,6 +26,11 @@ const MyTasks = ({
pagination,
setPagination
}) => {
// Make sure we have a navigation menu
useBoilerplate({
pageProps: DEFAULT_PAGE_PROPS,
pageDispatchers
})
const { currentUser } = useContext(AppContext)
const taskShortLabel = Settings.fields.task.shortLabel
// Memo'ize the search query parameters we use to prevent unnecessary re-renders
Expand Down

0 comments on commit 228f600

Please sign in to comment.