-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement soft deletes for crash notes #1540
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.
deleted my note, found it in the db table and tested the down migration
✅
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.
It works perfectly! So nice to have this in place—thank you!
I would like your feedback on a suggestion I made about the styling of the delete confirmation modal.
Also—I noticed this modal closes immediately, regardless of if the delete mutation resolved. I will open a backlog issue to hook the modal close into the mutation request , just like @chiaberry did in cityofaustin/atd-moped#1399
@@ -286,7 +286,7 @@ function Crash(props) { | |||
notes={crashRecord?.crash?.crash_notes} | |||
INSERT_NOTE={INSERT_NOTE} | |||
UPDATE_NOTE={UPDATE_NOTE} | |||
DELETE_NOTE={DELETE_NOTE} | |||
SOFT_DELETE_NOTE={SOFT_DELETE_NOTE} |
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 love this kind of detail!
@@ -30,7 +30,7 @@ const Notes = ({ | |||
// declare mutation functions | |||
const [addNote] = useMutation(INSERT_NOTE); | |||
const [editNote] = useMutation(UPDATE_NOTE); | |||
const [deleteNote] = useMutation(DELETE_NOTE); | |||
const [deleteNote] = useMutation(SOFT_DELETE_NOTE); |
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.
yeah i am very down to remove the note text completely!
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.
thanks, Rose! 🚢
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 tested this locally, and I could add, edit, and soft delete crash notes. I see the is_deleted
column update as expected in the database too. Such an improvement and some nice code details along the way!! 🚀 🚢
@@ -12,7 +12,7 @@ const Notes = ({ | |||
notes, | |||
INSERT_NOTE, | |||
UPDATE_NOTE, | |||
DELETE_NOTE, | |||
SOFT_DELETE_NOTE, |
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.
🚀
Associated issues
Closes cityofaustin/atd-data-tech#18788
Users cant delete recommendations only edit, so we dont need to implement soft-deletes for them.
Testing
URL to test:
Local
Steps to test:
crash_notes
table but the is_deleted column will say true.Ship list