Skip to content

Add confirm dialog before Permanently delete - #67824

Merged
ntsekouras merged 19 commits into
WordPress:trunkfrom
karthick-murugan:add/confirm-box-to-delete-page
Dec 20, 2024
Merged

ntsekouras merged 19 commits into
WordPress:trunkfrom
karthick-murugan:add/confirm-box-to-delete-page

Conversation

@karthick-murugan

Copy link
Copy Markdown
Contributor

What?

Fixes #60383, where the "Permanently Delete" action for trashed posts in the WordPress editor was not functioning as expected. This PR improves the logic and introduces a confirmation modal to ensure users can confirm their actions before permanently deleting posts.

Why?

The current implementation of the "Permanently Delete" action did not provide a clear user experience and lacked safeguards like a confirmation modal. This could lead to unintentional deletions. By addressing this issue, the PR ensures a better and more accessible user experience while reducing the likelihood of errors.

How?

Added a modal confirmation step to confirm the deletion of selected posts.

Testing Instructions

  • Open the WordPress admin dashboard.
  • Navigate to any list of posts.
  • Move one or more posts to the trash.
  • Select the trashed posts and use the "Permanently Delete" option.
  • Confirm the deletion in the modal dialog.
  • Observe the success or error notices for both individual and bulk deletion scenarios.

Screenshots or screencast

REC-20241211165122.mp4

@github-actions

github-actions Bot commented Dec 11, 2024 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: karthick-murugan <karthickmurugan@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: ammar-Mohamed-elz3eeem <ammarmassoud@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka

Copy link
Copy Markdown
Member

@karthick-murugan, entity actions already have built-in support for confirmation modals. See delete-post and trash-post actions for examples.

@Mamaduka
Mamaduka requested review from jorgefilipecosta and youknowriad and removed request for youknowriad December 12, 2024 06:48
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Dec 12, 2024

@ntsekouras ntsekouras left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! This looks good code wise. I've left a comment regarding the copy. Also it would be good to rebase.

Comment thread packages/fields/src/actions/permanently-delete-post.tsx Outdated

@ntsekouras ntsekouras left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thank you!

@ntsekouras ntsekouras changed the title Confirm box before Trash and Permanently delete Add confirm dialog before Permanently delete Dec 20, 2024
@ntsekouras
ntsekouras enabled auto-merge (squash) December 20, 2024 09:24
@ntsekouras
ntsekouras merged commit 94df941 into WordPress:trunk Dec 20, 2024
@github-actions github-actions Bot added this to the Gutenberg 20.0 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data Views: Pages: Improve clarity of the Trash and Permanently delete flows

3 participants