Skip to content

Commit

Permalink
Merge pull request #546 from onaio/513-FI-plan-assignment
Browse files Browse the repository at this point in the history
513 FI Plan Assignment
  • Loading branch information
Conor Kelly authored Oct 22, 2019
2 parents 29cd005 + 6e37e41 commit 44e364a
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 386 deletions.
6 changes: 3 additions & 3 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WEBSITE_NAME } from '../configs/env';
import { providers } from '../configs/settings';
import {
ACTIVE_IRS_PLAN_URL,
ASSIGN_IRS_PLAN_URL,
ASSIGN_PLAN_URL,
CREATE_ORGANIZATION_URL,
DRAFT_IRS_PLAN_URL,
EDIT_ORGANIZATION_URL,
Expand Down Expand Up @@ -154,13 +154,13 @@ class App extends Component {
<ConnectedPrivateRoute
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact={true}
path={`${ASSIGN_IRS_PLAN_URL}`}
path={`${ASSIGN_PLAN_URL}`}
component={ConnectedIRSAssignmentPlansList}
/>
<ConnectedPrivateRoute
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact={true}
path={`${ASSIGN_IRS_PLAN_URL}/:id`}
path={`${ASSIGN_PLAN_URL}/:id`}
component={IrsPlan}
/>

Expand Down
108 changes: 23 additions & 85 deletions src/App/tests/__snapshots__/App.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -385,102 +385,40 @@ exports[`App renders App correctly 1`] = `
</Manager>
</Dropdown>
</UncontrolledDropdown>
<UncontrolledDropdown
inNavbar={true}
nav={true}
<NavItem
tag="li"
>
<Dropdown
active={false}
addonType={false}
direction="down"
inNavbar={true}
isOpen={false}
nav={true}
setActiveFromChild={false}
toggle={[Function]}
<li
className="nav-item"
>
<Manager
className="dropdown nav-item"
onKeyDown={[Function]}
tag="li"
<NavLink
activeClassName="active"
aria-current="page"
className="nav-link"
to="/assign"
>
<li
className="dropdown nav-item"
onKeyDown={[Function]}
<Route
path="\\\\/assign"
>
<DropdownToggle
aria-haspopup={true}
caret={true}
<Link
aria-current={null}
className="nav-link"
color="secondary"
nav={true}
replace={false}
to="/assign"
>
<a
aria-expanded={false}
aria-haspopup={true}
className="nav-link dropdown-toggle nav-link"
href="#"
aria-current={null}
className="nav-link"
href="/assign"
onClick={[Function]}
>
Assign
</a>
</DropdownToggle>
<DropdownMenu
flip={true}
right={true}
tag="div"
>
<div
aria-hidden={true}
className="dropdown-menu dropdown-menu-right"
role="menu"
tabIndex="-1"
>
<DropdownItem
tag="button"
toggle={true}
>
<button
className="dropdown-item"
onClick={[Function]}
role="menuitem"
tabIndex="0"
type="button"
>
<NavLink
activeClassName="active"
aria-current="page"
className="nav-link"
to="/intervention/irs/assign"
>
<Route
path="\\\\/intervention\\\\/irs\\\\/assign"
>
<Link
aria-current={null}
className="nav-link"
replace={false}
to="/intervention/irs/assign"
>
<a
aria-current={null}
className="nav-link"
href="/intervention/irs/assign"
onClick={[Function]}
>
IRS
</a>
</Link>
</Route>
</NavLink>
</button>
</DropdownItem>
</div>
</DropdownMenu>
</li>
</Manager>
</Dropdown>
</UncontrolledDropdown>
</Link>
</Route>
</NavLink>
</li>
</NavItem>
<UncontrolledDropdown
inNavbar={true}
nav={true}
Expand Down
30 changes: 6 additions & 24 deletions src/components/page/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import {
ADMIN,
ASSIGN,
ASSIGN_IRS_PLAN_URL,
ASSIGN_PLAN_URL,
FI_URL,
FOCUS_INVESTIGATION,
HOME,
Expand Down Expand Up @@ -137,30 +137,12 @@ 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'}
>
{(ENABLE_IRS || ENABLE_FI) && (
<NavItem>
<NavLink to={ASSIGN_PLAN_URL} className="nav-link" activeClassName="active">
{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>
</NavLink>
</NavItem>
)}

{(ENABLE_IRS || ENABLE_FI) && (
Expand Down
Loading

0 comments on commit 44e364a

Please sign in to comment.