-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDA Lite Reporting #1536
Merged
Merged
MDA Lite Reporting #1536
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
f0c0b16
Add MDA-Lite plans reporting page
ciremusyoka edb4a4c
Document and add envs to sample file
ciremusyoka 07b3be6
Add MDA-Lite jurisdictions reporting view
ciremusyoka 5a42291
Document and add MDA-Lite jurisdiction reporting envs to sample file
ciremusyoka 63fb63d
Group MDA-Lite columns
ciremusyoka a616020
Merge branch 'master' into branch 'endfund-reports'
ciremusyoka e7ac908
Add MDA-Lite jurisdiction reporting column accessors
ciremusyoka 512771c
Add Component for formating the drill down links
ciremusyoka 0be6c2f
MDA-Lite add ward level columns
ciremusyoka 1692382
Change color of returned to supervisor if less than remaining with CDD
ciremusyoka 0735233
Add MDA-Lite CDD and Supervisor report columns
ciremusyoka 336d82e
MDA-Lite add CDD reporting page
ciremusyoka f7524b6
MDA-Lite CDD reports get drillDownTable props from a function and add…
ciremusyoka 5d373c3
Clean up
ciremusyoka d4846d3
Add MDA-Lite CDDs reducer and actions
ciremusyoka a42729d
Add MDA-Lite supervisors reducer and actions
ciremusyoka 7160355
Connect MDA-Lite CDD report component with store
ciremusyoka 00cedc8
MDA-Lite connect Supervisor reports component to store
ciremusyoka 89d207e
Clean up and create links for CDD and supervisor views
ciremusyoka 43c6652
Fix tests failling after add MDA-lite Reports
ciremusyoka 33b6d6d
Add MDA-Lite plans tests
ciremusyoka 6e12096
Add MDA-Lite jurisdictions report fixtures
ciremusyoka 1aaae84
Add MDA-Lite jurisdiction reports tests
ciremusyoka 95b7ea3
Update CDDs columns
ciremusyoka 396c6db
Add MDA Lite wards reducer
ciremusyoka 9a6a143
Add MDA Lite wards report page
ciremusyoka 29ed5ef
Link all MDA Lite views correctly
ciremusyoka b98abb4
Add MDA Lite Map component
ciremusyoka 2d831cc
Fix failling test
ciremusyoka dce92b9
Test MDA Lite wards Reducer
ciremusyoka 5285f76
Test MDA Lite supervisors Reducer
ciremusyoka c81e430
Add MDA Lite cdd supervisor tests
ciremusyoka 4bd2649
Add MDA Lite wards tests
ciremusyoka 739d732
Add MDA Lite map tests
ciremusyoka e2dadba
Add MDA Lite CDDs reducre test
ciremusyoka b26f1f3
Add MDA Lite CDDs report page test
ciremusyoka c814575
Clean up
ciremusyoka adb6626
Marge branch 'master' into branch 'endfund_reports'
ciremusyoka f2b2183
Translate MDA Lite table headers
ciremusyoka 5ba8756
Clean up: Update comments and remove unused code
ciremusyoka 3a8babe
Tests use equality assertions instead of snapshot
ciremusyoka bf55e0f
Translate missed string
ciremusyoka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { DropDownCellProps } from '@onaio/drill-down-table'; | ||
import { Dictionary } from '@onaio/utils'; | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { Col, Row } from 'reactstrap'; | ||
import { SHOW_MAP_AT_JURISDICTION_LEVEL } from '../../configs/env'; | ||
import { MAP, REPORT_MDA_LITE_WARD_URL } from '../../constants'; | ||
|
||
/** Interface for linked cell props */ | ||
export interface LinkedCellProps extends DropDownCellProps { | ||
urlPath?: string; | ||
} | ||
|
||
/** Component that will be rendered in drop-down table cells showing a link | ||
* that moves you to the next hierarchical level. | ||
*/ | ||
const MDALiteTableCell: React.ElementType<LinkedCellProps> = (props: LinkedCellProps) => { | ||
const { cell, cellValue, hasChildren, urlPath } = props; | ||
const original: Dictionary = cell.row.original; | ||
const { jurisdiction_id, jurisdiction_depth, plan_id } = original; | ||
const url = `${urlPath}/${jurisdiction_id}`; | ||
const wardUrl = `${REPORT_MDA_LITE_WARD_URL}/${plan_id}/${jurisdiction_id}`; | ||
const jurLink = <Link to={url}>{cellValue}</Link>; | ||
if (SHOW_MAP_AT_JURISDICTION_LEVEL === +jurisdiction_depth) { | ||
return ( | ||
<div style={{ minWidth: '100%' }}> | ||
<Row> | ||
<Col sm={8}> | ||
<Link to={wardUrl}>{cellValue}</Link> | ||
</Col> | ||
<Col sm={4}> | ||
<Link style={{ paddingLeft: '20px' }} to={`${url}/${MAP}`}> | ||
<FontAwesomeIcon icon={['fas', MAP]} /> | ||
</Link> | ||
</Col> | ||
</Row> | ||
</div> | ||
); | ||
} | ||
const val = hasChildren ? ( | ||
jurLink | ||
) : ( | ||
<span className="plan-jurisdiction-name name-label">{cellValue}</span> | ||
); | ||
return <div>{val}</div>; | ||
}; | ||
|
||
export default MDALiteTableCell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the enable/disable also work at the route level? i.e Can you access the route if the menu link is disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the link will be accessible. Fixing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kelvin-muchiri this is affecting all routes in reveal and have created an issue here to address it.