Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show WP-CLI progress on sync page #2564

Merged
merged 7 commits into from
Feb 4, 2022
Merged
Next Next commit
Fix to show the progress of wp-cli sync
  • Loading branch information
Rahmon committed Jan 21, 2022
commit d7df1f1459fb6938c660d2084840a851a7957f2d
16 changes: 14 additions & 2 deletions assets/js/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,20 @@ updateLastSyncDateTime(epDash?.ep_last_sync_date);
if (epDash.index_meta) {
if (epDash.index_meta.method === 'cli') {
syncStatus = 'wpcli';
processed = epDash.index_meta.items_indexed;
toProcess = epDash.index_meta.total_items;
processed = epDash?.index_meta?.items_indexed;
toProcess = epDash?.index_meta?.total_items;

activeBox = epDash.index_meta.put_mapping ? deleteAndSyncBox : syncBox;

const progressInfoElement = activeBox.querySelector('.ep-sync-box__progress-info');

progressInfoElement.innerText = __('WP-CLI sync in progress', 'elasticpress');

updateStartDateTime(epDash?.index_meta?.start_date_time);

updateDisabledAttribute(syncButton, true);

showProgress();

updateSyncDash();
cliSync();
Expand Down