diff --git a/src/js/_enqueues/admin/privacy-tools.js b/src/js/_enqueues/admin/privacy-tools.js
index 802ec88f4b..23e876de65 100644
a
|
b
|
jQuery( document ).ready( function( $ ) { |
59 | 59 | var $this = $( this ), |
60 | 60 | $action = $this.parents( '.export-personal-data' ), |
61 | 61 | $requestRow = $this.parents( 'tr' ), |
| 62 | $progress = $requestRow.find( '.export-progress' ); |
62 | 63 | requestID = $action.data( 'request-id' ), |
63 | 64 | nonce = $action.data( 'nonce' ), |
64 | 65 | exportersCount = $action.data( 'exporters-count' ), |
… |
… |
jQuery( document ).ready( function( $ ) { |
69 | 70 | |
70 | 71 | $action.blur(); |
71 | 72 | clearResultsAfterRow( $requestRow ); |
| 73 | setExportProgress( 0 ); |
72 | 74 | |
73 | 75 | function onExportDoneSuccess( zipUrl ) { |
74 | 76 | var summaryMessage = strings.emailSent; |
… |
… |
jQuery( document ).ready( function( $ ) { |
77 | 79 | |
78 | 80 | appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, [] ); |
79 | 81 | $this.hide(); |
80 | | |
| 82 | |
81 | 83 | if ( 'undefined' !== typeof zipUrl ) { |
82 | 84 | window.location = zipUrl; |
83 | 85 | } else if ( ! sendAsEmail ) { |
… |
… |
jQuery( document ).ready( function( $ ) { |
92 | 94 | } |
93 | 95 | } |
94 | 96 | |
| 97 | function setExportProgress( exporterIndex ) { |
| 98 | var progress = exporterIndex / exportersCount; |
| 99 | var progressString = Math.round( progress * 100 ).toString() + '%'; |
| 100 | $progress.html( progressString ); |
| 101 | } |
| 102 | |
95 | 103 | function doNextExport( exporterIndex, pageIndex ) { |
96 | 104 | $.ajax( |
97 | 105 | { |
… |
… |
jQuery( document ).ready( function( $ ) { |
120 | 128 | setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) ); |
121 | 129 | } else { |
122 | 130 | if ( exporterIndex < exportersCount ) { |
| 131 | setExportProgress( exporterIndex ); |
123 | 132 | setTimeout( doNextExport( exporterIndex + 1, 1 ) ); |
124 | 133 | } else { |
125 | 134 | onExportDoneSuccess( responseData.url ); |
… |
… |
jQuery( document ).ready( function( $ ) { |
141 | 150 | var $this = $( this ), |
142 | 151 | $action = $this.parents( '.remove-personal-data' ), |
143 | 152 | $requestRow = $this.parents( 'tr' ), |
| 153 | $progress = $requestRow.find( '.erasure-progress' ); |
144 | 154 | requestID = $action.data( 'request-id' ), |
145 | 155 | nonce = $action.data( 'nonce' ), |
146 | 156 | erasersCount = $action.data( 'erasers-count' ), |
… |
… |
jQuery( document ).ready( function( $ ) { |
152 | 162 | |
153 | 163 | $action.blur(); |
154 | 164 | clearResultsAfterRow( $requestRow ); |
| 165 | setErasureProgress( 0 ); |
155 | 166 | |
156 | 167 | function onErasureDoneSuccess() { |
157 | 168 | var summaryMessage = strings.noDataFound; |
… |
… |
jQuery( document ).ready( function( $ ) { |
183 | 194 | appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] ); |
184 | 195 | } |
185 | 196 | |
| 197 | function setErasureProgress( eraserIndex ) { |
| 198 | var progress = eraserIndex / erasersCount; |
| 199 | var progressString = Math.round( progress * 100 ).toString() + '%'; |
| 200 | $progress.html( progressString ); |
| 201 | } |
| 202 | |
186 | 203 | function doNextErasure( eraserIndex, pageIndex ) { |
187 | 204 | $.ajax({ |
188 | 205 | url: window.ajaxurl, |
… |
… |
jQuery( document ).ready( function( $ ) { |
214 | 231 | setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) ); |
215 | 232 | } else { |
216 | 233 | if ( eraserIndex < erasersCount ) { |
| 234 | setErasureProgress( eraserIndex ); |
217 | 235 | setTimeout( doNextErasure( eraserIndex + 1, 1 ) ); |
218 | 236 | } else { |
219 | 237 | 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 683ea69697..023cc9e3e6 100644
a
|
b
|
class WP_Privacy_Data_Export_Requests_List_Table extends WP_Privacy_Requests_Tab |
57 | 57 | '">'; |
58 | 58 | |
59 | 59 | $download_data_markup .= '<span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data' ) . '</button></span>' . |
60 | | '<span class="export-personal-data-processing hidden">' . __( 'Downloading Data...' ) . '</span>' . |
| 60 | '<span class="export-personal-data-processing hidden">' . __( 'Downloading Data...' ) . ' ' . '<span class="export-progress"></span></span>' . |
61 | 61 | '<span class="export-personal-data-success hidden"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data Again' ) . '</button></span>' . |
62 | 62 | '<span class="export-personal-data-failed hidden">' . __( 'Download failed.' ) . ' <button type="button" class="button-link">' . __( 'Retry' ) . '</button></span>'; |
63 | 63 | |
… |
… |
class WP_Privacy_Data_Export_Requests_List_Table extends WP_Privacy_Requests_Tab |
100 | 100 | |
101 | 101 | ?> |
102 | 102 | <span class="export-personal-data-idle"><button type="button" class="button export-personal-data-handle"><?php _e( 'Send Export Link' ); ?></button></span> |
103 | | <span class="export-personal-data-processing button updating-message hidden"><?php _e( 'Sending Email...' ); ?></span> |
| 103 | <span class="export-personal-data-processing button updating-message hidden"><?php _e( 'Sending Email...' ); ?> <span class="export-progress"></span></span> |
104 | 104 | <span class="export-personal-data-success success-message hidden"><?php _e( 'Email sent.' ); ?></span> |
105 | 105 | <span class="export-personal-data-failed hidden"><?php _e( 'Email could not be sent.' ); ?> <button type="button" class="button export-personal-data-handle"><?php _e( 'Retry' ); ?></button></span> |
106 | 106 | <?php |
diff --git a/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php b/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php
index 8e2efa0379..51756248fd 100644
a
|
b
|
class WP_Privacy_Data_Removal_Requests_List_Table extends WP_Privacy_Requests_Ta |
62 | 62 | '">'; |
63 | 63 | |
64 | 64 | $remove_data_markup .= '<span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle">' . __( 'Force Erase Personal Data' ) . '</button></span>' . |
65 | | '<span class="remove-personal-data-processing hidden">' . __( 'Erasing Data...' ) . '</span>' . |
| 65 | '<span class="remove-personal-data-processing hidden">' . __( 'Erasing Data...' ) . ' ' . '<span class="erasure-progress"></span></span>' . |
66 | 66 | '<span class="remove-personal-data-success hidden">' . __( 'Erasure completed.' ) . '</span>' . |
67 | 67 | '<span class="remove-personal-data-failed hidden">' . __( 'Force Erasure has failed.' ) . ' <button type="button" class="button-link remove-personal-data-handle">' . __( 'Retry' ) . '</button></span>'; |
68 | 68 | |
… |
… |
class WP_Privacy_Data_Removal_Requests_List_Table extends WP_Privacy_Requests_Ta |
106 | 106 | |
107 | 107 | ?> |
108 | 108 | <span class="remove-personal-data-idle"><button type="button" class="button remove-personal-data-handle"><?php _e( 'Erase Personal Data' ); ?></button></span> |
109 | | <span class="remove-personal-data-processing button updating-message hidden"><?php _e( 'Erasing Data...' ); ?></span> |
| 109 | <span class="remove-personal-data-processing button updating-message hidden"><?php _e( 'Erasing Data...' ); ?> <span class="erasure-progress"></span></span> |
110 | 110 | <span class="remove-personal-data-success success-message hidden" ><?php _e( 'Erasure completed.' ); ?></span> |
111 | 111 | <span class="remove-personal-data-failed hidden"><?php _e( 'Data Erasure has failed.' ); ?> <button type="button" class="button remove-personal-data-handle"><?php _e( 'Retry' ); ?></button></span> |
112 | 112 | <?php |