-
Notifications
You must be signed in to change notification settings - Fork 7
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
Waitp 1338 add matrices #4725
Waitp 1338 add matrices #4725
Conversation
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.
Looks great
@@ -126,6 +134,7 @@ export const EnlargedDashboardItem = () => { | |||
/> | |||
)} | |||
</TitleWrapper> | |||
{currentReport?.description && <Subheading>{currentReport?.description}</Subheading>} |
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.
Good pick up on this
export const Matrix = ({ viewContent, isEnlarged = false }: MatrixProps) => { | ||
const { columns, rows, ...config } = viewContent; | ||
|
||
const getPlaceholderImage = () => { |
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.
This is very minor but I reckon this would be easier to read if it was placed outside of the Matrix component just above it and just took config or presentationOptions and categoryPresentationOptions as props
`; | ||
|
||
// This is a recursive function that parses the rows of the matrix into a format that the Matrix component can use. | ||
const parseRows = ( |
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.
There's a lot going on here but separating it out into parseRows and parseColumns and all the comments help clarify it a lot.
* Placeholder images for dashboard * Working matrix * Add description and handle no data * Add comments * Fix grouping and width * Move getPlaceholderImage
* Placeholder images for dashboard * Working matrix * Add description and handle no data * Add comments * Fix grouping and width * Move getPlaceholderImage
Issue WAITP-1338: Add matrix component to Tupaia web
Changes:
ui-components
Matrix componentuseReport
to use correct endpointsScreenshots:
Description (subheader)
Enlarged matrix
Dashboard placeholder matrix image