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

Data views: Confirm step should be used for permanently destructive actions and not for Move to trash #62185

Open
afercia opened this issue May 31, 2024 · 1 comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented May 31, 2024

Description

Traditionally, for some objects like posts, pages, (optionally) media, etc. WordPress has always used a two-step deletion flow where:

  • Objects are moved to the trash first.
  • Objects can be permanently deleted from the Trash.

Tgis two-step flow is now in use also in the Data VIews but I'm not sure the confirmation steps are ideal.

To me, any action that does not permanently delete something doesn't need a confirmation dialog. In fact, in this scenario the trashed objects can always be restored from the trash.

Instead, any action that does permanently delete something, does need a confirmation dialog.

In the Data Views, this appears to be implemented in the opposite way, which doesn't safeguards used from inadvertently delete something permanently.

RIght now:

  • 'Move to trash' does use a confirmation dialog.
  • 'Permanently delete' does not.

I'd think it should be the opposite.

Step-by-step reproduction instructions

  • Create and publish a new page.
  • Go to the Site Editor > Pages >
  • Locate the page you just created in the list of pages.
  • Click the ellipsis button of that page and click 'Move to trash'.
  • Observe a confirm dialog component appears with the message 'Are you sure you want to move to trash "My new page"?'
  • Click 'Trash'.
  • After the page is trashed, go to Pages > Trash.
  • Locate the page you just trashed in the list of pages.
  • Click the ellipsis button of that page and click 'Permanently delete'.
  • Observe there is no confirm dialog.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@afercia afercia added [Type] Bug An existing feature does not function as intended [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels May 31, 2024
@sarthaknagoshe2002
Copy link
Contributor

I believe this should be addressed by making changes in the core rather than in Gutenberg. If you agree, we can move this issue core.

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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants