-
Notifications
You must be signed in to change notification settings - Fork 8
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
Move report table to own component #610
Conversation
* Report table is now it's own component * Activity reports table replaced with new stand alone component * My alerts still needs to be updated to use new component. There are a few difference between the two tables that need to be handled. Saving for a later date to keep the change smaller * withWidgetData uses deep compare to prevent multiple renders * Moved table related tests from landing page to new component * Add report table to grantee dashboard
collaborators, | ||
lastSaved, | ||
calculatedStatus, | ||
legacyId, |
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.
Would it be better to make the API for generating the report more generic, and an instance of the API have the required specifics?
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 it would be nice to have some way of defining which fields are required for the table be passed in as props. We will need something like that when we update the "My Alerts" table to use this component. However in this PR I'm trying to keep changes to a minimum, only want to move the table to a new component, not make any substantial changes.
); | ||
}; | ||
|
||
const displayReports = reports.length ? reports : [emptyReport]; |
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.
I'm probably not understanding something - do we want an row with an empty report rather than an empty array?
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.
I'm not too sure, I was trying to move over the table to it's own component without changing how the report works in any way. Now that it is in it's own component it is easier to refactor.
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 good
I did notice while testing it out a bit that those ariaLiveContext.annouce functions weren't reading anything off to me, but that is a pre-existing condition, nothing to do with this.
Conflicts: frontend/src/pages/GranteeRecord/index.js frontend/src/pages/GranteeRecord/pages/TTAHistory.js
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.
Still looks good!
Description of change
withWidgetData
uses deep compare to prevent multiple rendersOnly added functionality is the ability to show or hide the filter menu on report tables, and dynamically setting the table caption.
How to test
View activity reports table on landing page. Check the following:
View reports on the grantee TTA record page. Check the same as above. There won't be filter controls and the reports should be scoped to the current grantee.
Issue(s)
Notes
This PR will wait for global filters to show up on the grantee TTA page before merging.
Checklists
Every PR
Production Deploy
After merge/deploy