Skip to content

Commit

Permalink
Merge pull request #516 from onaio/515-enabling-editing-on-finalized-…
Browse files Browse the repository at this point in the history
…plans

515 enabling editing on finalized IRS plans
  • Loading branch information
Conor Kelly authored Oct 18, 2019
2 parents fcf2b2d + 7dc3edf commit 29cd005
Show file tree
Hide file tree
Showing 16 changed files with 1,662 additions and 488 deletions.
17 changes: 16 additions & 1 deletion src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { Helmet } from 'react-helmet';
import { Route, Switch } from 'react-router';
import { Col, Container, Row } from 'reactstrap';
import Loading from '../components/page/Loading';
import { WEBSITE_NAME } from '../configs/env';
import { DISABLE_LOGIN_PROTECTION } from '../configs/env';
import { WEBSITE_NAME } from '../configs/env';
import { providers } from '../configs/settings';
import {
ACTIVE_IRS_PLAN_URL,
ASSIGN_IRS_PLAN_URL,
CREATE_ORGANIZATION_URL,
DRAFT_IRS_PLAN_URL,
EDIT_ORGANIZATION_URL,
Expand Down Expand Up @@ -47,6 +48,7 @@ import NewPlan from '../containers/pages/InterventionPlan/NewPlan/General';
import NewIRSPlan from '../containers/pages/InterventionPlan/NewPlan/IRS';
import ConnectedPlanDefinitionList from '../containers/pages/InterventionPlan/PlanDefinitionList';
import ConnectedUpdatePlan from '../containers/pages/InterventionPlan/UpdatePlan';
import ConnectedIRSAssignmentPlansList from '../containers/pages/IRS/assignments';
import ConnectedJurisdictionReport from '../containers/pages/IRS/JurisdictionsReport';
import ConnectedIRSReportingMap from '../containers/pages/IRS/Map';
import ConnectedIRSPlansList from '../containers/pages/IRS/plans';
Expand Down Expand Up @@ -148,6 +150,19 @@ class App extends Component {
path={`${REPORT_IRS_PLAN_URL}/:planId/:jurisdictionId/${MAP}`}
component={ConnectedIRSReportingMap}
/>
{/* IRS Assignment views */}
<ConnectedPrivateRoute
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact={true}
path={`${ASSIGN_IRS_PLAN_URL}`}
component={ConnectedIRSAssignmentPlansList}
/>
<ConnectedPrivateRoute
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact={true}
path={`${ASSIGN_IRS_PLAN_URL}/:id`}
component={IrsPlan}
/>

{/* Focus Investigation Reporting list view */}
<ConnectedPrivateRoute
Expand Down
352 changes: 260 additions & 92 deletions src/App/tests/__snapshots__/App.test.tsx.snap

Large diffs are not rendered by default.

106 changes: 73 additions & 33 deletions src/components/page/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,27 @@ import {
WEBSITE_NAME,
} from '../../../configs/env';
import {
ADMIN,
ASSIGN,
ASSIGN_IRS_PLAN_URL,
FI_URL,
FOCUS_INVESTIGATION,
HOME,
INTERVENTION_IRS_DRAFTS_URL,
INTERVENTION_IRS_URL,
IRS_REPORTING_TITLE,
IRS_TITLE,
LOGIN_URL,
LOGOUT_URL,
MONITOR,
ORGANIZATIONS_LABEL,
ORGANIZATIONS_LIST_URL,
PLAN_LIST_URL,
PLANNING,
PLAN_TITLE,
PLANS,
PRACTITIONERS,
PRACTITIONERS_LIST_URL,
REPORT_IRS_PLAN_URL,
REPORTING,
} from '../../../constants';
import './Header.css';

Expand Down Expand Up @@ -110,7 +114,7 @@ export class HeaderComponent extends React.Component<HeaderProps, State> {
caret={true}
className={path === INTERVENTION_IRS_URL ? 'nav-link active' : 'nav-link'}
>
{PLANNING}
{PLAN_TITLE}
</DropdownToggle>
<DropdownMenu right={true}>
<DropdownItem>
Expand All @@ -133,21 +137,47 @@ export class HeaderComponent extends React.Component<HeaderProps, State> {
</UncontrolledDropdown>
)}

{ENABLE_IRS && (
// ASSIGN_IRS_PLAN_URL
<UncontrolledDropdown nav={true} inNavbar={true}>
<DropdownToggle
nav={true}
caret={true}
className={path === ASSIGN_IRS_PLAN_URL ? 'nav-link active' : 'nav-link'}
>
{ASSIGN}
</DropdownToggle>
<DropdownMenu right={true}>
{ENABLE_IRS && (
<DropdownItem>
<NavLink
to={ASSIGN_IRS_PLAN_URL}
className="nav-link"
activeClassName="active"
>
{IRS_TITLE}
</NavLink>
</DropdownItem>
)}
</DropdownMenu>
</UncontrolledDropdown>
)}

{(ENABLE_IRS || ENABLE_FI) && (
<UncontrolledDropdown nav={true} inNavbar={true}>
<DropdownToggle
nav={true}
caret={true}
className={path === FI_URL ? 'nav-link active' : 'nav-link'}
>
{REPORTING}
{MONITOR}
</DropdownToggle>
<DropdownMenu right={true}>
{ENABLE_FI && (
<div>
<DropdownItem>
<NavLink to={FI_URL} className="nav-link" activeClassName="active">
Focus Investigation
{FOCUS_INVESTIGATION}
</NavLink>
</DropdownItem>
</div>
Expand All @@ -168,36 +198,46 @@ export class HeaderComponent extends React.Component<HeaderProps, State> {
</DropdownMenu>
</UncontrolledDropdown>
)}
{ENABLE_TEAMS && (
<NavItem>
<NavLink
to={`${ORGANIZATIONS_LIST_URL}`}
className="nav-link"
activeClassName="active"
>
{ORGANIZATIONS_LABEL}
</NavLink>
</NavItem>
)}
{ENABLE_PRACTITIONERS && (
<NavItem>
<NavLink
to={`${PRACTITIONERS_LIST_URL}`}
className="nav-link"
activeClassName="active"
>
{PRACTITIONERS}
</NavLink>
</NavItem>
)}

{ENABLE_USERS && (
<NavItem>
<NavLink to="/404" className="nav-link" activeClassName="active">
Users
</NavLink>
</NavItem>
{(ENABLE_TEAMS || ENABLE_PRACTITIONERS || ENABLE_USERS) && (
<UncontrolledDropdown nav={true} inNavbar={true}>
<DropdownToggle nav={true} caret={true} className={'nav-link'}>
{ADMIN}
</DropdownToggle>
<DropdownMenu right={true}>
{ENABLE_TEAMS && (
<DropdownItem>
<NavLink
to={`${ORGANIZATIONS_LIST_URL}`}
className="nav-link"
activeClassName="active"
>
{ORGANIZATIONS_LABEL}
</NavLink>
</DropdownItem>
)}
{ENABLE_PRACTITIONERS && (
<DropdownItem>
<NavLink
to={`${PRACTITIONERS_LIST_URL}`}
className="nav-link"
activeClassName="active"
>
{PRACTITIONERS}
</NavLink>
</DropdownItem>
)}
{ENABLE_USERS && (
<DropdownItem>
<NavLink to="/404" className="nav-link" activeClassName="active">
Users
</NavLink>
</DropdownItem>
)}
</DropdownMenu>
</UncontrolledDropdown>
)}

{ENABLE_ABOUT && (
<NavItem>
<NavLink to="/404" className="nav-link" activeClassName="active">
Expand Down
Loading

0 comments on commit 29cd005

Please sign in to comment.