Skip to content

Commit

Permalink
Fixes #37827 - Bring back sync status progress bars on initial page load
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz authored and sbernhard committed Sep 23, 2024
1 parent 8c01c7c commit 1fd6f0a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions app/assets/javascripts/katello/sync_management/sync_management.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,22 @@ KT.content = (function () {
$(this).collapse();
});
};
populate_repo_status = function () {
var ids = [];
$.each(KT.repo_status, function (repo_id, status) {
if (status.is_running) {
ids.push(repo_id);
KT.content.draw_syncing(repo_id, status.progress.progress, status.sync_id);
}
});
KT.content.reset_products(KT.repo_status);
KT.content_actions.addSyncing(ids);
}

return {
updateProduct: updateProduct,
updateRepo: updateRepo,
populateRepoStatus: populate_repo_status,
finishRepo: finishRepo,
select_all: select_all,
select_none: select_none,
Expand Down Expand Up @@ -346,15 +358,7 @@ KT.content_actions = (function () {
};
})();

var ids = [];
$.each(KT.repo_status, function (repo_id, status) {
if (status.is_running) {
ids.push(repo_id);
KT.content.draw_syncing(repo_id, status.progress.progress, status.sync_id);
}
});
KT.content.reset_products(KT.repo_status);
KT.content_actions.addSyncing(ids);
KT.content.populateRepoStatus();

$("#select_all").on("click", KT.content.select_all);
$("#select_none").on("click", KT.content.select_none);
Expand Down
2 changes: 1 addition & 1 deletion app/views/katello/sync_management/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"complete": "<%= escape_javascript(_('Sync complete.')) %>",
"no_start_time": "<%= escape_javascript(_('No start time currently available.')) %>"
});

KT.repo_status = JSON.parse('<%= escape_javascript(@repo_status.to_json.html_safe) %>');
KT.permissions = { "syncable" : <%= any_syncable? %> };
KT.content.populateRepoStatus();
</script>
<% end -%>

Expand Down

0 comments on commit 1fd6f0a

Please sign in to comment.