-
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
Issue 223/delete client modal scott #287
Issue 223/delete client modal scott #287
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.
Approving these changes since my comments are not essential. The code is clean and addresses the related issue.
|
||
<DialogContent> | ||
<DialogContentText id="dialog-description"> | ||
{`You're about to delete ${client.person} from your client list, do you wish to continue?`} |
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.
Minor point, but I notice in the demonstration video that there's a bit of extra spacing on the right side of the modal. That is, "to continue" is wrapped around but the "DELETE CLIENT" button stretches the modal out further to the right. It might be better if the edge of the buttons is made to align with the edge of the rightmost text, wherever that is.
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.
Interesting, I didn't notice that previously...
Looks like this modal, the Logout Modal, and the Inactivity Message are all this way. Like the dialog buttons are always over on the right, even if the sx styling is removed. Have to look at theme or how to override for this.
</StyledTableCell> | ||
</StyledTableRow> | ||
<> | ||
<StyledTableRow> |
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.
Oh, one thing I want to touch, do we want to start moving these styled-components over to Material UI now, or have it in a separate PR?
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.
My vote would be to do it now, but am also okay with leaving for another PR.
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.
That's Issue #219 assigned to Masen. Pinged them in our Discord DMs.
e3c68b7
to
3df69b1
Compare
My bad, I messed up updating the wrong branch. I've reverted the changes back to your latest commit |
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 you add a snapshot test for the modal? There are some example snapshots in the tests
folder, and I can go over writing them with you if you like.
OK, summary:
|
Thanks to @timbot1789 for giving a crash course in testing! I'm still having issues trying to pass my last test that I'd like to implement for this PR. So, I will describe what it is and the approaches I have tried so far - maybe somebody can see the issue, or think of another approach to try.I want to test that the modal does close without taking any action, when the
|
@xscottxbrownx Another thing you could do is write a simple wrapper component to launch the modal in, and test that:
This test seems to work without issue. One thing I had to look up was the However, the React Testing Library docs do include a set of examples, one of which is testing modals: You can see that they do the same test as you wrote. So I'm fine with either approach, but you're right, the test would be more robust if it checks that the modal is actually dropped. Not that it just calls the |
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.
The changes seems to work fine and the code is running well. I'll approve this.
I meant the uncentered buttons. Actually I just realized we have a couple of different philosophies with button placement. On some modals they're centered and on others they're not. Not something we need to address now, if at all. |
Sounds like a great first issue for someone new to the project. |
Yep, see our convo above... it's basically the modals that are just using |
This PR closes #223
This PR:
DeleteClientModal
component.ClientListTableRow
.AddClientModal
component to achieve more clarity.AddClientModal
component once client has been added to the list.Screen.Recording.2023-07-02.at.1.22.35.PM.mov