diff --git a/src/js/_enqueues/admin/privacy-tools.js b/src/js/_enqueues/admin/privacy-tools.js
index 90b3a49233..f31e2d6d55 100644
--- a/src/js/_enqueues/admin/privacy-tools.js
+++ b/src/js/_enqueues/admin/privacy-tools.js
@@ -59,6 +59,7 @@ jQuery( document ).ready( function( $ ) {
var $this = $( this ),
$action = $this.parents( '.export-personal-data' ),
$requestRow = $this.parents( 'tr' ),
+ $progress = $requestRow.find( '.export-progress' );
requestID = $action.data( 'request-id' ),
nonce = $action.data( 'nonce' ),
exportersCount = $action.data( 'exporters-count' ),
@@ -69,6 +70,7 @@ jQuery( document ).ready( function( $ ) {
$action.blur();
clearResultsAfterRow( $requestRow );
+ setExportProgress( 0 );
function onExportDoneSuccess( zipUrl ) {
var summaryMessage = strings.emailSent;
@@ -77,7 +79,7 @@ jQuery( document ).ready( function( $ ) {
appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, [] );
$this.hide();
-
+
if ( 'undefined' !== typeof zipUrl ) {
window.location = zipUrl;
} else if ( ! sendAsEmail ) {
@@ -92,6 +94,12 @@ jQuery( document ).ready( function( $ ) {
}
}
+ function setExportProgress( exporterIndex ) {
+ var progress = ( exportersCount > 0 ? exporterIndex / exportersCount : 0 );
+ var progressString = Math.round( progress * 100 ).toString() + '%';
+ $progress.html( progressString );
+ }
+
function doNextExport( exporterIndex, pageIndex ) {
$.ajax(
{
@@ -120,6 +128,7 @@ jQuery( document ).ready( function( $ ) {
setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) );
} else {
if ( exporterIndex < exportersCount ) {
+ setExportProgress( exporterIndex );
setTimeout( doNextExport( exporterIndex + 1, 1 ) );
} else {
onExportDoneSuccess( responseData.url );
@@ -141,6 +150,7 @@ jQuery( document ).ready( function( $ ) {
var $this = $( this ),
$action = $this.parents( '.remove-personal-data' ),
$requestRow = $this.parents( 'tr' ),
+ $progress = $requestRow.find( '.erasure-progress' );
requestID = $action.data( 'request-id' ),
nonce = $action.data( 'nonce' ),
erasersCount = $action.data( 'erasers-count' ),
@@ -152,6 +162,7 @@ jQuery( document ).ready( function( $ ) {
$action.blur();
clearResultsAfterRow( $requestRow );
+ setErasureProgress( 0 );
function onErasureDoneSuccess() {
var summaryMessage = strings.noDataFound;
@@ -183,6 +194,12 @@ jQuery( document ).ready( function( $ ) {
appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] );
}
+ function setErasureProgress( eraserIndex ) {
+ var progress = ( erasersCount > 0 ? eraserIndex / erasersCount : 0 );
+ var progressString = Math.round( progress * 100 ).toString() + '%';
+ $progress.html( progressString );
+ }
+
function doNextErasure( eraserIndex, pageIndex ) {
$.ajax({
url: window.ajaxurl,
@@ -214,6 +231,7 @@ jQuery( document ).ready( function( $ ) {
setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) );
} else {
if ( eraserIndex < erasersCount ) {
+ setErasureProgress( eraserIndex );
setTimeout( doNextErasure( eraserIndex + 1, 1 ) );
} else {
onErasureDoneSuccess();
diff --git a/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php b/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php
index 880af8cd04..3898f8ef05 100644
--- a/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php
+++ b/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php
@@ -57,7 +57,7 @@ class WP_Privacy_Data_Export_Requests_List_Table extends WP_Privacy_Requests_Tab
'">';
$download_data_markup .= '' .
- '' . __( 'Downloading Data...' ) . '' .
+ '' . __( 'Downloading Data...' ) . ' ' .
'' .
'' . __( 'Download failed.' ) . ' ';
@@ -100,7 +100,7 @@ class WP_Privacy_Data_Export_Requests_List_Table extends WP_Privacy_Requests_Tab
?>
-
+
';
$remove_data_markup .= '' .
- '' . __( 'Erasing Data...' ) . '' .
+ '' . __( 'Erasing Data...' ) . ' ' .
'' . __( 'Erasure completed.' ) . '' .
'' . __( 'Force Erasure has failed.' ) . ' ';
@@ -106,7 +106,7 @@ class WP_Privacy_Data_Removal_Requests_List_Table extends WP_Privacy_Requests_Ta
?>
-
+