-
Notifications
You must be signed in to change notification settings - Fork 27
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
[Enhancement] - Replace existing Contact List with MUI Data Grid #457
Conversation
… contactProfile.profileImage in ProfileImageField.jsx
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.
If we could resolve the button nested in an a
tag, that would be great. Thank you!
Thanks for the review @milofultz! I'll have the changes made in a bit. |
Is there an associated issue for this? @milofultz This is valuable feedback, at least for my own understanding. More insight into accessibility is really helpful for the project. |
I was looking around the issues. There doesn't seem to be one for this or the ones that were there was closed. |
…; Removed Button, but left ContactPageIcon for Link
I think the data grid is a good enhancement over the current view. I especially like how we can easily add sorting to it (which may eliminate the need for pinning / favoriting). How would you say it relates to this ticket, where I talk about converting the contacts list into a series of cards? |
I think we could certainly have this link this to that issue since it does update the UI. If we want to, think we could also separate out different fields from |
When I last talked to UX about this, they said they were still working on the desktop version of these cards. So that combined with temporarily focusing on documentation recently, I haven't done a ton with #343 lately (and should really have moved that to the backlog). I'm still willing to complete that, it would just mean waiting until this is merged before continuing. |
That sounds good to me. I personally like the card look more than the table. IMO it's more humanizing, and shows the data in a more familiar way. And I think it will work well in a desktop environment. The table view is good when you have several rows worth of data you need to look at all at once, but I don't know how often that will be the case here. |
@@ -34,6 +34,7 @@ | |||
"@mui/material": "^5.12.2", | |||
"@mui/styled-engine-sc": "^5.12.0", | |||
"@mui/system": "^5.12.1", | |||
"@mui/x-data-grid": "^6.16.2", |
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.
Isn't this data grid what we used months back when creating the original table and implementing MUI? I don't recall why we decided not to go with it at that time.
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 was the same one as before. I think at the time we didn't went with it was because there were still a few thing we wish to discuss, although I don't remember which things.
@andycwilliams @leekahung The issues I had when using VoiceOver on the data grid (which I'll admit isn't technically super proficient) were just basic navigation. In comparison to a data grid like this one from W3 which was super easy to navigate and interact with, the MUI one on their site was almost unusable. I don't quite have to technical know how with grid yet to understand why this is the case, but I saw similar complaints in their backlog (mui/mui-x#4749, mui/mui-x#4658, mui/mui-x#4282). Again, don't know how much of this is them, us, or me, but I saw a little bit of signal confirming my suspicions in their backlog so thought I'd bring it up. edit: oop misread the original post, but leaving this here for clarity anyway, sorry for the erroneous tag now :) |
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.
Just one small thing, but not a blocker
Got everything updated from the suggestions. Let me know if there's still anything that needs to be reviewed for this PR. |
Hey @xscottxbrownx @andycwilliams. Think I've manage to touch on the things you guys mentioned. Let me know if there's still other things you guys need to review or it's good to go? |
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.
Overall, it looks really nice. It's strange seeing the data grid again after all these months.
I think it would have been good to first create an issue before opening a PR as we normally do.
Curious, is the grid also intended to be implemented with the documents table?
@@ -44,31 +50,74 @@ const ContactListTable = ({ contacts, deleteContact }) => { | |||
const contactsCopy = [...contacts]; | |||
const sortedContacts = contactsCopy.sort(comparePerson); |
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.
With the new data grid, is a custom sorting function still necessary? Unless I'm mistaken, it should be possible to use initialState
in DataGrid
for the same results.
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.
We could certainly drop the custom sort and leave it as an initial state.
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.
Got the custom sort dropped for sorting from initialState
const columnTitlesArray = [ | ||
{ | ||
field: 'First Name', | ||
width: 120, |
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.
Could we possibly expand the table a bit when in desktop views? The quickest way would be by widening the columns.
I know there isn't a ton of data to display at the moment, but it'd help to use up some of all the empty space. Plus, in case anyone has a longer name, it'd prevent that from being cut off.
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 like to keep the minimum width of the overall grid to 300px for mobile, but I'll play around with the column widths.
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.
Made text columns flexible. If we get more columns included in between them in the future, we could make them flexible as well.
Screen.Recording.2023-10-22.at.22.27.06.mov
field: 'actions', | ||
type: 'actions', | ||
width: 70, | ||
getActions: (contactData) => [ |
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.
Although it's not essential, I think it'd be nicer to have a title for the delete column. If only because it's a bit odd to have one nameless column. The same kind of column in the documents is named, so this'd make it more consistent.
Adding headerName: 'Delete',
here would accomplish this.
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'll add one. I'll expand the width of this too.
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.
Got this included.
Yeah, I think the grid would work well for the document list as well. Think we could have an issue created for that. |
Issue with rendering size on skinny mobile devices (like Galaxy Fold and similar), but not too worried about for MVP. |
Yeah, I believe those screen sizes are at around 280px width? At an earlier discussion, I believe we've talked about limiting the lower screen limit to about 300px. Think I could adjust it to make it fit the smaller size using Screen.Recording.2023-10-23.at.12.35.01.mov |
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.
Looking better. There's a plan to add at least one more column (an icon button to allow for direct messaging), so that will help fill out the table.
I'm seeing some large gaps between the navbar and table (see screenshot) when using larger viewports. Looks to be caused by justifyContent: 'center'
on line 58 in Contacts.jsx
Is this the desired effect? It might be nicer to have it consistent on all viewports and make the table always close to the navbar. Just want to be sure.
I'd really like to hear from case workers about how small the screens they actually use are. It may not even be an issue to set a 300px limit. But it may take time to get feedback.
I could certainly pull the Data Grid back up closer the the Navbar without the Screen.Recording.2023-10-23.at.17.33.35.mov
With regards to the mobile width limit, what we're making here should be quite flexible down to 280px and lower, so I don't think we need to worry about that point now. (As you can see below, the grid content stretches out to 380px, but the grid itself can remain small (around ~210px in the example clip) thanks to the horizontal scrolling implemented with the grid.) Screen.Recording.2023-10-23.at.17.37.52.mov |
I believe the changes here are now adequate? |
This PR:
Updates existing table used for our Contact List with MUI Data Grid. The module for MUI Data Grid has been included to package.json. The column with originally with the link to the contact profile has been split up into the original text and a button icon in order to allow for filtering via MUI Data Grid. Other than that, the grid should function similarly to our previous table.
The unused
ContactListTableRow.jsx
is removed and a new componentContactProfileIcon.jsx
is created for the React Router Link to the contact profile page.The PR also includes a minor correction for
contactProfile.profileImage
insrc/components/Profile/ProfileImageField.jsx
. Before the profileImage would be incorrectly rendered because of the incorrect variable name,profileImg
, which doesn't exist as part ofcontactProfile
.The column with pinning has been removed (UX team believes if there's already a filter + sorting capability with MUI Data Grid, this might not be necessary; it'll be better to have this moved as a type of status instead). The name from Person has been split up into "First Name" and "Last Name" for a better sorting experience.
The files this PR effects:
Components
src/components/Contacts/ContactListTable.jsx
src/components/Contacts/ContactListTableRow.jsx
(file removed)src/components/Contacts/ContactProfileIcon.jsx
(file added)src/components/Profile/ProfileImageField.jsx
Test Files
test/components/Contacts/ContactsListTable.test.jsx
test/components/Profile/ProfileImageField.test.jsx
test/pages/Contacts.test.jsx
Other Files
src/components/Contacts/index.js
package.json
package-lock.json
Screenshots (if applicable):
Screen.Recording.2023-10-19.at.10.30.59.mov
Future Considerations: