Skip to content
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

Merged
merged 8 commits into from
Jul 12, 2023
Merged

Conversation

alexd-bes
Copy link
Contributor

Issue WAITP-1338: Add matrix component to Tupaia web

Changes:

  • Added a Matrix component that processes data to pass to the ui-components Matrix component
  • Added Matrix response types
  • Updated useReport to use correct endpoints
  • Fix some overlapping styles in the dashboard
  • Added description to enlarged dashboard item when applicable

Screenshots:

Description (subheader)
Screenshot 2023-07-12 at 9 47 45 am

Enlarged matrix
Screenshot 2023-07-12 at 9 49 18 am

Dashboard placeholder matrix image
Screenshot 2023-07-12 at 9 49 34 am

Copy link
Contributor

@tcaiger tcaiger left a 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>}
Copy link
Contributor

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 = () => {
Copy link
Contributor

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 = (
Copy link
Contributor

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.

@alexd-bes alexd-bes merged commit 35a56e9 into epic-frontend-rewrite Jul 12, 2023
@alexd-bes alexd-bes deleted the waitp-1338-add-matrices branch July 12, 2023 01:36
tcaiger pushed a commit that referenced this pull request Jul 12, 2023
* Placeholder images for dashboard

* Working matrix

* Add description and handle no data

* Add comments

* Fix grouping and width

* Move getPlaceholderImage
tcaiger pushed a commit that referenced this pull request Jul 12, 2023
* Placeholder images for dashboard

* Working matrix

* Add description and handle no data

* Add comments

* Fix grouping and width

* Move getPlaceholderImage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants