Updates: Improve bulk update failure notice
When doing a bulk update, if there are failures the user needs to know about that. This makes it clearer that you can click on the notification to see more details, especially for screen reader users. Fixes #37510. Props juhise, Ankit K Gupta, afercia, jorbin, ocean90. Built from https://develop.svn.wordpress.org/trunk@38185 git-svn-id: http://core.svn.wordpress.org/trunk@38126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ada44f2e13
commit
94ac1499cf
|
@ -3024,7 +3024,8 @@ img {
|
||||||
|
|
||||||
/* Metabox collapse arrow indicators */
|
/* Metabox collapse arrow indicators */
|
||||||
.js .sidebar-name .sidebar-name-arrow:before,
|
.js .sidebar-name .sidebar-name-arrow:before,
|
||||||
.js .meta-box-sortables .postbox .toggle-indicator:before {
|
.js .meta-box-sortables .postbox .toggle-indicator:before,
|
||||||
|
.bulk-action-notice .toggle-indicator:before {
|
||||||
content: "\f142";
|
content: "\f142";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font: normal 20px/1 dashicons;
|
font: normal 20px/1 dashicons;
|
||||||
|
@ -3035,7 +3036,8 @@ img {
|
||||||
}
|
}
|
||||||
|
|
||||||
.js .widgets-holder-wrap.closed .sidebar-name-arrow:before,
|
.js .widgets-holder-wrap.closed .sidebar-name-arrow:before,
|
||||||
.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before {
|
.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,
|
||||||
|
.bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before {
|
||||||
content: "\f140";
|
content: "\f140";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3065,6 +3067,12 @@ img {
|
||||||
text-indent: 1px; /* account for the dashicon alignment */
|
text-indent: 1px; /* account for the dashicon alignment */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bulk-action-notice .toggle-indicator:before {
|
||||||
|
line-height: 16px;
|
||||||
|
vertical-align: top;
|
||||||
|
color: #72777c;
|
||||||
|
}
|
||||||
|
|
||||||
.js .postbox .handlediv:focus {
|
.js .postbox .handlediv:focus {
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3024,7 +3024,8 @@ img {
|
||||||
|
|
||||||
/* Metabox collapse arrow indicators */
|
/* Metabox collapse arrow indicators */
|
||||||
.js .sidebar-name .sidebar-name-arrow:before,
|
.js .sidebar-name .sidebar-name-arrow:before,
|
||||||
.js .meta-box-sortables .postbox .toggle-indicator:before {
|
.js .meta-box-sortables .postbox .toggle-indicator:before,
|
||||||
|
.bulk-action-notice .toggle-indicator:before {
|
||||||
content: "\f142";
|
content: "\f142";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font: normal 20px/1 dashicons;
|
font: normal 20px/1 dashicons;
|
||||||
|
@ -3035,7 +3036,8 @@ img {
|
||||||
}
|
}
|
||||||
|
|
||||||
.js .widgets-holder-wrap.closed .sidebar-name-arrow:before,
|
.js .widgets-holder-wrap.closed .sidebar-name-arrow:before,
|
||||||
.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before {
|
.js .meta-box-sortables .postbox.closed .handlediv .toggle-indicator:before,
|
||||||
|
.bulk-action-notice .bulk-action-errors-collapsed .toggle-indicator:before {
|
||||||
content: "\f140";
|
content: "\f140";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3065,6 +3067,12 @@ img {
|
||||||
text-indent: 1px; /* account for the dashicon alignment */
|
text-indent: 1px; /* account for the dashicon alignment */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bulk-action-notice .toggle-indicator:before {
|
||||||
|
line-height: 16px;
|
||||||
|
vertical-align: top;
|
||||||
|
color: #72777c;
|
||||||
|
}
|
||||||
|
|
||||||
.js .postbox .handlediv:focus {
|
.js .postbox .handlediv:focus {
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -634,7 +634,7 @@ function wp_print_admin_notice_templates() {
|
||||||
<div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{{ data.message }}}</p></div>
|
<div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{{ data.message }}}</p></div>
|
||||||
</script>
|
</script>
|
||||||
<script id="tmpl-wp-bulk-updates-admin-notice" type="text/html">
|
<script id="tmpl-wp-bulk-updates-admin-notice" type="text/html">
|
||||||
<div id="{{ data.id }}" class="notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
|
<div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
|
||||||
<p>
|
<p>
|
||||||
<# if ( data.successes ) { #>
|
<# if ( data.successes ) { #>
|
||||||
<# if ( 1 === data.successes ) { #>
|
<# if ( 1 === data.successes ) { #>
|
||||||
|
@ -664,25 +664,25 @@ function wp_print_admin_notice_templates() {
|
||||||
<# } #>
|
<# } #>
|
||||||
<# } #>
|
<# } #>
|
||||||
<# if ( data.errors ) { #>
|
<# if ( data.errors ) { #>
|
||||||
|
<button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
|
||||||
<# if ( 1 === data.errors ) { #>
|
<# if ( 1 === data.errors ) { #>
|
||||||
<button class="button-link">
|
|
||||||
<?php
|
<?php
|
||||||
/* translators: %s: Number of failures */
|
/* translators: %s: Number of failed updates */
|
||||||
printf( __( '%s failure.' ), '{{ data.errors }}' );
|
printf( __( '%s update failed.' ), '{{ data.errors }}' );
|
||||||
?>
|
?>
|
||||||
</button>
|
|
||||||
<# } else { #>
|
<# } else { #>
|
||||||
<button class="button-link">
|
|
||||||
<?php
|
<?php
|
||||||
/* translators: %s: Number of failures */
|
/* translators: %s: Number of failed updates */
|
||||||
printf( __( '%s failures.' ), '{{ data.errors }}' );
|
printf( __( '%s updates failed.' ), '{{ data.errors }}' );
|
||||||
?>
|
?>
|
||||||
</button>
|
|
||||||
<# } #>
|
<# } #>
|
||||||
|
<span class="screen-reader-text"><?php _e( 'Show more details' ); ?></span>
|
||||||
|
<span class="toggle-indicator" aria-hidden="true"></span>
|
||||||
|
</button>
|
||||||
<# } #>
|
<# } #>
|
||||||
</p>
|
</p>
|
||||||
<# if ( data.errors ) { #>
|
<# if ( data.errors ) { #>
|
||||||
<ul class="hidden">
|
<ul class="bulk-action-errors hidden">
|
||||||
<# _.each( data.errorMessages, function( errorMessage ) { #>
|
<# _.each( data.errorMessages, function( errorMessage ) { #>
|
||||||
<li>{{ errorMessage }}</li>
|
<li>{{ errorMessage }}</li>
|
||||||
<# } ); #>
|
<# } ); #>
|
||||||
|
|
|
@ -2023,6 +2023,7 @@
|
||||||
|
|
||||||
wp.updates.addAdminNotice( {
|
wp.updates.addAdminNotice( {
|
||||||
id: 'bulk-action-notice',
|
id: 'bulk-action-notice',
|
||||||
|
className: 'bulk-action-notice',
|
||||||
successes: success,
|
successes: success,
|
||||||
errors: error,
|
errors: error,
|
||||||
errorMessages: errorMessages,
|
errorMessages: errorMessages,
|
||||||
|
@ -2030,7 +2031,12 @@
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$bulkActionNotice = $( '#bulk-action-notice' ).on( 'click', 'button', function() {
|
$bulkActionNotice = $( '#bulk-action-notice' ).on( 'click', 'button', function() {
|
||||||
$bulkActionNotice.find( 'ul' ).toggleClass( 'hidden' );
|
// $( this ) is the clicked button, no need to get it again.
|
||||||
|
$( this )
|
||||||
|
.toggleClass( 'bulk-action-errors-collapsed' )
|
||||||
|
.attr( 'aria-expanded', ! $( this ).hasClass( 'bulk-action-errors-collapsed' ) );
|
||||||
|
// Show the errors list.
|
||||||
|
$bulkActionNotice.find( '.bulk-action-errors' ).toggleClass( 'hidden' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
if ( error > 0 && ! wp.updates.queue.length ) {
|
if ( error > 0 && ! wp.updates.queue.length ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38183';
|
$wp_version = '4.7-alpha-38185';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue