mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-04 20:11:39 +00:00
Privacy: Make the progress indicator for export and erasure visible even if not hovered over.
Follow-up to [47246]. Props pbiron, garrett-eclipse. Fixes #44264. git-svn-id: https://develop.svn.wordpress.org/trunk@47395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -60,6 +60,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
$action = $this.parents( '.export-personal-data' ),
|
||||
$requestRow = $this.parents( 'tr' ),
|
||||
$progress = $requestRow.find( '.export-progress' ),
|
||||
$rowActions = $this.parents( '.row-actions' ),
|
||||
requestID = $action.data( 'request-id' ),
|
||||
nonce = $action.data( 'nonce' ),
|
||||
exportersCount = $action.data( 'exporters-count' ),
|
||||
@@ -68,6 +69,8 @@ jQuery( document ).ready( function( $ ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$rowActions.addClass( 'processing' );
|
||||
|
||||
$action.blur();
|
||||
clearResultsAfterRow( $requestRow );
|
||||
setExportProgress( 0 );
|
||||
@@ -78,13 +81,14 @@ jQuery( document ).ready( function( $ ) {
|
||||
setActionState( $action, 'export-personal-data-success' );
|
||||
|
||||
appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, [] );
|
||||
$this.hide();
|
||||
|
||||
if ( 'undefined' !== typeof zipUrl ) {
|
||||
window.location = zipUrl;
|
||||
} else if ( ! sendAsEmail ) {
|
||||
onExportFailure( strings.noExportFile );
|
||||
}
|
||||
|
||||
setTimeout( function(){ $rowActions.removeClass( 'processing' ); }, 500 );
|
||||
}
|
||||
|
||||
function onExportFailure( errorMessage ) {
|
||||
@@ -92,6 +96,8 @@ jQuery( document ).ready( function( $ ) {
|
||||
if ( errorMessage ) {
|
||||
appendResultsAfterRow( $requestRow, 'notice-error', strings.exportError, [ errorMessage ] );
|
||||
}
|
||||
|
||||
setTimeout( function(){ $rowActions.removeClass( 'processing' ); }, 500 );
|
||||
}
|
||||
|
||||
function setExportProgress( exporterIndex ) {
|
||||
@@ -118,26 +124,24 @@ jQuery( document ).ready( function( $ ) {
|
||||
var responseData = response.data;
|
||||
|
||||
if ( ! response.success ) {
|
||||
|
||||
// e.g. invalid request ID.
|
||||
onExportFailure( response.data );
|
||||
setTimeout( function(){ onExportFailure( response.data ); }, 500 );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! responseData.done ) {
|
||||
setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) );
|
||||
} else {
|
||||
setExportProgress( exporterIndex );
|
||||
if ( exporterIndex < exportersCount ) {
|
||||
setExportProgress( exporterIndex );
|
||||
setTimeout( doNextExport( exporterIndex + 1, 1 ) );
|
||||
} else {
|
||||
onExportDoneSuccess( responseData.url );
|
||||
setTimeout( function(){ onExportDoneSuccess( responseData.url ); }, 500 );
|
||||
}
|
||||
}
|
||||
}).fail( function( jqxhr, textStatus, error ) {
|
||||
|
||||
// e.g. Nonce failure.
|
||||
onExportFailure( error );
|
||||
setTimeout( function(){ onExportFailure( error ); }, 500 );
|
||||
});
|
||||
}
|
||||
|
||||
@@ -151,6 +155,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
$action = $this.parents( '.remove-personal-data' ),
|
||||
$requestRow = $this.parents( 'tr' ),
|
||||
$progress = $requestRow.find( '.erasure-progress' ),
|
||||
$rowActions = $this.parents( '.row-actions' ),
|
||||
requestID = $action.data( 'request-id' ),
|
||||
nonce = $action.data( 'nonce' ),
|
||||
erasersCount = $action.data( 'erasers-count' ),
|
||||
@@ -158,8 +163,11 @@ jQuery( document ).ready( function( $ ) {
|
||||
hasRetained = false,
|
||||
messages = [];
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$rowActions.addClass( 'processing' );
|
||||
|
||||
$action.blur();
|
||||
clearResultsAfterRow( $requestRow );
|
||||
setErasureProgress( 0 );
|
||||
@@ -186,12 +194,15 @@ jQuery( document ).ready( function( $ ) {
|
||||
}
|
||||
}
|
||||
appendResultsAfterRow( $requestRow, classes, summaryMessage, messages );
|
||||
$this.hide();
|
||||
|
||||
setTimeout( function(){ $rowActions.removeClass( 'processing' ); }, 500 );
|
||||
}
|
||||
|
||||
function onErasureFailure() {
|
||||
setActionState( $action, 'remove-personal-data-failed' );
|
||||
appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] );
|
||||
|
||||
setTimeout( function(){ $rowActions.removeClass( 'processing' ); }, 500 );
|
||||
}
|
||||
|
||||
function setErasureProgress( eraserIndex ) {
|
||||
@@ -215,7 +226,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
var responseData = response.data;
|
||||
|
||||
if ( ! response.success ) {
|
||||
onErasureFailure();
|
||||
setTimeout( function(){ onErasureFailure(); }, 500 );
|
||||
return;
|
||||
}
|
||||
if ( responseData.items_removed ) {
|
||||
@@ -230,15 +241,15 @@ jQuery( document ).ready( function( $ ) {
|
||||
if ( ! responseData.done ) {
|
||||
setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) );
|
||||
} else {
|
||||
setErasureProgress( eraserIndex );
|
||||
if ( eraserIndex < erasersCount ) {
|
||||
setErasureProgress( eraserIndex );
|
||||
setTimeout( doNextErasure( eraserIndex + 1, 1 ) );
|
||||
} else {
|
||||
onErasureDoneSuccess();
|
||||
setTimeout( function(){ onErasureDoneSuccess(); }, 500 );
|
||||
}
|
||||
}
|
||||
}).fail( function() {
|
||||
onErasureFailure();
|
||||
setTimeout( function(){ onErasureFailure(); }, 500 );
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1206,6 +1206,10 @@ table.form-table td .updated p {
|
||||
color: #72777c;
|
||||
}
|
||||
|
||||
.privacy_requests .row-actions.processing {
|
||||
position: static;
|
||||
}
|
||||
|
||||
.privacy_requests tbody .has-request-results th {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user