Opened 4 years ago
Closed 4 years ago
#8304 closed enhancement (fixed)
Add `Delete Permanently` link to activity edit page
Reported by: | oztaser | Owned by: | slaFFik |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | normal |
Severity: | normal | Version: | 1.6 |
Component: | Administration | Keywords: | has-patch commit |
Cc: |
Description
There is a Delete Permanently
link in the activities table and I think it will be useful if we add the same link to the activity edit page.
Attachments (4)
Change History (12)
#1
@
4 years ago
- Component changed from Activity to Administration
- Keywords has-patch reporter-feedback added
- Milestone changed from Awaiting Review to 7.0.0
- Owner set to slaFFik
- Version set to 1.6
#2
@
4 years ago
- Keywords reporter-feedback removed
Hi @imath,
Thanks for your suggestion. I am gonna work on it.
#3
@
4 years ago
Hi again @imath,
I've uploaded the new patch which use regular confirmation screen for activity delete. Can you review?
#4
@
4 years ago
Hi again @oztaser
After a quick look, it's looking pretty nice! I'll test the patch asap and will give you more advices (if needed)
#5
@
4 years ago
I've tested the patch and you're almost done. Great work!
1) Could you include 8304-2b.patch to your patch: it removes the javascript:confirm
from the delete action of the Activity WP List Table that is no more necessary.
2) Instead of the content or the activity action, I think it would be better to use something like this for the bullet points of the confirmation page:
"Action/type" activity submitted by username on date with a link to the activity on the date. Eg:
- "New post published" activity submitted by imath on may 24, 2020
3) finally, here are some minor improvements
// Add a space between ! and empty. + if ( ! empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', 'delete', 'bulk_delete' ) ) ) { // Use === instead of ==. + if ( 'edit' === $doaction && ! empty( $_GET['aid'] ) ) { bp_activity_admin_edit(); + } // Add a full stop at the end of the comment. + // This is a request to delete single or multiple item. // Use esc_html_e() instead of _e(). + <h1><?php esc_html_e( 'Delete Activities', 'buddypress' ) ?></h1> + <p><?php esc_html_e( 'You are about to delete the following activities:', 'buddypress' ) ?></p> + <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p> + <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a> + <a class="submitdelete deletion" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-activities-delete' ) ); ?>"><?php esc_html_e( 'Delete Permanently', 'buddypress' ) ?></a>
Thanks again for your great work 👍
#6
@
4 years ago
1) Could you include 8304-2b.patch to your patch: it removes the javascript:confirm from the delete action of the Activity WP List Table that is no more necessary.
Nice catch, I added your update to my patch.
2) Instead of the content or the activity action, I think it would be better to use something like this for the bullet points of the confirmation page: "Action/type" activity submitted by username on date with a link to the activity on the date.
Thanks for the advice, I was not sure about this. Everything is clear now.
I've also updated the code style based on your suggestions. Thanks again for the review, I hope it's ready to commit.
Hi @oztaser
Thanks a lot for your ticket and for your patch. I agree we should add this delete link to the activity edit page. But something bothers me: the javascript confirm as we are using a regular confirmation screen when deleting group or signup. I believe we should try to do the same thing everywhere : use a regular confirmation screen.
Here's the Group's delete confirmation screen: https://buddypress.trac.wordpress.org/browser/trunk/src/bp-groups/bp-groups-admin.php#L688
Here's the Signup action confirmation screen: https://buddypress.trac.wordpress.org/browser/trunk/src/bp-members/classes/class-bp-members-admin.php#L2147
Could you update your patch into this direction?