WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#37603 closed defect (bug) (fixed)

Missing visual feedback when deleting themes/plugins

Reported by: ocean90 Owned by: ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.6
Component: Plugins Keywords: has-patch commit
Focuses: ui, javascript, administration Cc:

Description

Only on wp-admin/themes.php the delete button changes to "Deleting…". Also, when I cancel the credential modal the button remains at "Deleting…".

Attachments (5)

37603.diff (1.6 KB) - added by swissspidy 5 years ago.
37603.2.diff (2.5 KB) - added by swissspidy 5 years ago.
37603.3.diff (3.0 KB) - added by swissspidy 5 years ago.
37603.4.diff (3.1 KB) - added by ocean90 5 years ago.
37603.5.diff (2.9 KB) - added by jorbin 5 years ago.

Download all attachments as: .zip

Change History (16)

This ticket was mentioned in Slack in #feature-shinyupdates by ocean90. View the logs.


5 years ago

@swissspidy
5 years ago

#2 @swissspidy
5 years ago

  • Keywords has-patch added; needs-patch removed

37603.diff removes the lines in questions from wp.updates.deletePlugin as they're indeed not needed and fixes the issue on themes.php

#3 @ocean90
5 years ago

  • Keywords needs-patch added; has-patch removed

37603.diff is not what I wanted: 1) Instead of removing the code we should make it work. 2) 'themes' === pagenow in the credential-modal-cancel callback is also true for a canceled update job, we have to check if it's a delete job.

@swissspidy
5 years ago

@swissspidy
5 years ago

#4 @swissspidy
5 years ago

Thanks for the clarification.

37603.3.diff actually changes the "Delete" link for plugins and properly distinguishes updates and deletions in the credential-modal-cancel callback.

#5 @swissspidy
5 years ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #core by ocean90. View the logs.


5 years ago

#7 @ocean90
5 years ago

  • Owner set to ocean90
  • Status changed from new to reviewing

@ocean90
5 years ago

#8 @ocean90
5 years ago

  • Keywords commit added
  • Owner changed from ocean90 to jorbin

37603.4.diff renames $message to $link and changes

if ( 'update-theme' === job.action ) {
        $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.update-message' );
} else if ( 'delete-theme' === job.action ) {
        if ( 'themes-network' === pagenow ) {
                $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.row-actions a.delete' );
        } else {
                $message = $( '.theme-actions .delete-theme' );
        }
}

to

if ( 'update-theme' === job.action ) {
        $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.update-message' );
} else if ( 'delete-theme' === job.action && 'themes-network' === pagenow ) {
        $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.row-actions a.delete' );
} else if ( 'delete-theme' === job.action && 'themes' === pagenow ) {
        $message = $( '.theme-actions .delete-theme' );
}

which makes it more readable IMO.

@jorbin
5 years ago

#9 @jorbin
5 years ago

  • Owner changed from jorbin to ocean90

patch no longer applies clean after [38221].

New patch applies clean. @ocean90 Back to you.

#10 @ocean90
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 38227:

Updates: Add visual feedback when deleting themes/plugins.

This corrects the selector for the delete link in wp.updates.deletePlugin() so the text can be changed to 'Deleting…'. wp.updates.deleteTheme() already worked on wp-admin/themes.php but not on wp-admin/network/themes.php because the network screen is similar to the plugins list table, this is now fixed too.
The credential-modal-cancel handler has been updated to support canceled delete jobs.

Props swissspidy.
Props jorbin for review.
Fixes #37603.

#11 @ocean90
5 years ago

In 38228:

Updates: Add visual feedback when deleting themes/plugins.

This corrects the selector for the delete link in wp.updates.deletePlugin() so the text can be changed to 'Deleting…'. wp.updates.deleteTheme() already worked on wp-admin/themes.php but not on wp-admin/network/themes.php because the network screen is similar to the plugins list table, this is now fixed too.
The credential-modal-cancel handler has been updated to support canceled delete jobs.

Merge of [38227] to the 4.6 branch.

Props swissspidy.
Props jorbin for review.
See #37603.

Note: See TracTickets for help on using tickets.