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

Add a confirmation modal for relation object deletion #8818

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

khuddite
Copy link
Contributor

Fixes #8698

  1. Summary
    We decided to add a confirmation modal for the relation object deletion. It's gonna a bit of safety to the user interactions because this action can be disruptive even though it can be restored.

  2. Solution
    Used createPortal function to address the issue where the vertical scrollbar shows over the modal. Added a logic that displays a confirmation modal for deletion in this file.
    I can update the text(title, description, and CTA) as necessary based on the feedback.

However, I observed an issue that the deleted object still shows up under the list until hard-refresh. I figured that can be addressed as a separate issue.

  1. Recording
CleanShot.2024-11-29.at.16.02.22.mp4

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds a confirmation modal for deleting related objects in the object detail view, implementing a safety measure to prevent accidental deletions.

  • Added confirmation modal using createPortal in /packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx
  • Contains typo in state setter name setIsDeleteRelatinoModalOpen that needs fixing
  • Known issue: deleted objects remain visible until hard refresh, indicating cache invalidation needs addressing
  • Modal implementation needs to handle edge cases for rapid state changes
  • Warning text clarifies permanent deletion consequences and relationship impacts

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 100 to 101
const [isDeleteRelationModalOpen, setIsDeleteRelatinoModalOpen] =
useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: 'setIsDeleteRelatinoModalOpen' contains a typo ('Relatino')

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.

Clarify "Delete" vs "Detach" Actions in Object Detail View
1 participant