Ticket #44264: 44264.3.diff
File 44264.3.diff, 5.1 KB (added by , 5 years ago) |
---|
-
src/js/_enqueues/admin/privacy-tools.js
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' ), … … 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; … … 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 ) { … … 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 { … … 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 ); … … 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' ), … … 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; … … 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, … … 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(); -
src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php
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 -
src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php
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