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

updates phases table to use mui confirmation modal #1467

Merged

Conversation

tillyw
Copy link
Contributor

@tillyw tillyw commented Oct 24, 2024

Associated issues

fixes cityofaustin/atd-data-tech#19436

Testing

URL to test:

https://deploy-preview-1467--atd-moped-main.netlify.app/

Steps to test:

  • go to a project's timeline tab and click the delete icon next to a phase
  • confirm that an mui confirmation modal appears asking 'Are you sure you want to delete this phase?'
  • click 'delete' and confirm the correct phase was deleted

Ship list

Copy link
Collaborator

@mddilley mddilley left a 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 })
Copy link
Collaborator

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! 🙏 ✨

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

@roseeichelmann roseeichelmann left a 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!

Copy link
Contributor

@mateoclarke mateoclarke left a 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.

Screenshot 2024-10-29 at 4 51 54 PM

@@ -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 })
Copy link
Contributor

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 })
Copy link
Contributor

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 })
Copy link
Contributor

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

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.

Copy link
Member

@chiaberry chiaberry left a 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

@tillyw
Copy link
Contributor Author

tillyw commented Oct 30, 2024

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?

@mddilley
Copy link
Collaborator

mddilley commented Nov 4, 2024

@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 handleDeleteModalOpen that Mateo suggested above. I can also spin off an issue if you want to move on from this PR.

@mddilley
Copy link
Collaborator

mddilley commented Nov 7, 2024

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!

@mddilley mddilley merged commit 203e289 into main Nov 7, 2024
4 checks passed
@mddilley mddilley deleted the 19436_update_phases_table_to_use_mui_confirmation_modal branch November 7, 2024 17:21
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.

Update phases table to use MUI confirm modal
5 participants