-
Notifications
You must be signed in to change notification settings - Fork 3
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
updates phases table to use mui confirmation modal #1467
updates phases table to use mui confirmation modal #1467
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.
Works great - thanks for updating so these all work the same now! 🙌 🚢
@@ -133,7 +134,7 @@ const useColumns = ({ deleteInProgress, onDeletePhase, setEditPhase }) => | |||
aria-label="delete" | |||
sx={{ color: "inherit" }} | |||
onClick={() => | |||
onDeletePhase({ project_phase_id: row.project_phase_id }) | |||
handleDeleteOpen({ project_phase_id: row.project_phase_id }) |
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.
thank you for renaming this - very nice detail! 🙏 ✨
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 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 like the handle
prefix more than on
but the DeleteOpen
part is a little confusing to me. Maybe handleDeleteModalOpen
would clarify it for me.
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.
or it could read even nicer if it was openDeleteModal
. That would make the code more readable to the actually story of, "on click of the delete icon, it opens the delete modal." I'm getting way too deep into the semantics.
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.
test steps check out 🚀 i wonder if theres a way to fix the bug where the table resizes for a second on delete before going back? but not a big deal and this is 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.
🚢 Testest according to the steps and all looks good.
I do notice inconsistency within the two tables on the Timelime tab where the Milestones table has a row inline to confim delete while this Phases table uses the nice modal as implemented by Tilly. I assume bringing the Milestones one on board to the model UX is on @mddilley's radar and accounted for in the backlog.
@@ -133,7 +134,7 @@ const useColumns = ({ deleteInProgress, onDeletePhase, setEditPhase }) => | |||
aria-label="delete" | |||
sx={{ color: "inherit" }} | |||
onClick={() => | |||
onDeletePhase({ project_phase_id: row.project_phase_id }) | |||
handleDeleteOpen({ project_phase_id: row.project_phase_id }) |
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.
➕
@@ -133,7 +134,7 @@ const useColumns = ({ deleteInProgress, onDeletePhase, setEditPhase }) => | |||
aria-label="delete" | |||
sx={{ color: "inherit" }} | |||
onClick={() => | |||
onDeletePhase({ project_phase_id: row.project_phase_id }) | |||
handleDeleteOpen({ project_phase_id: row.project_phase_id }) |
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 like the handle
prefix more than on
but the DeleteOpen
part is a little confusing to me. Maybe handleDeleteModalOpen
would clarify it for me.
@@ -133,7 +134,7 @@ const useColumns = ({ deleteInProgress, onDeletePhase, setEditPhase }) => | |||
aria-label="delete" | |||
sx={{ color: "inherit" }} | |||
onClick={() => | |||
onDeletePhase({ project_phase_id: row.project_phase_id }) | |||
handleDeleteOpen({ project_phase_id: row.project_phase_id }) |
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.
or it could read even nicer if it was openDeleteModal
. That would make the code more readable to the actually story of, "on click of the delete icon, it opens the delete modal." I'm getting way too deep into the semantics.
setDeleteConfirmationId(project_phase_id); | ||
}, []); | ||
|
||
const handleDeleteClick = useCallback( |
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.
not sure what we call similar functions that use that pattern (I just checked and most of them are anonymous functions) but a nice name here could be confirmDelete
. But I do see this same name used in ProjectFiles and Funding so being consistent with the pattern is probably best.
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.
Nice to keep knocking out these UX improvements
Naming things is hard, I agree with Mateo that we could do a better job naming these (I'm afraid to check and see that it was me who named these functions). but this does follow the pattern we have everywhere else, so if we do rename this it should be across all our confirmation modals
thanks for pointing that out, @chiaberry! you're right, i was following the existing patterns and i totally agree about keeping it consistent. so i'm not sure if i should go ahead and rename these functions in other components in this pr or stick with the naming convention we have now and then perhaps we can come up with guidelines for a new naming convention and follow up with that as tech debt. @mddilley do you have any leanings? |
@tillyw Yeah, renaming them all sounds good to me to keep the code consistent. If you don't mind updating in this PR, then go for it! I like |
I went ahead and created a snackoo for Mateo's suggestion about function naming earlier in the PR conversation. cityofaustin/atd-data-tech#19814 @tillyw This is good to merge! |
Associated issues
fixes cityofaustin/atd-data-tech#19436
Testing
URL to test:
https://deploy-preview-1467--atd-moped-main.netlify.app/
Steps to test:
Ship list
[ ] Product manager added to QA test script if applicable