LP#1482400: use determinate prograess bar during asset creation
authorGalen Charlton <gmc@esilibrary.com>
Tue, 11 Aug 2015 17:38:39 +0000 (17:38 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 11 Aug 2015 17:38:39 +0000 (17:38 +0000)
The progress bar now updates to 33% upon completion of
Vandelay queue processing, to 67% upon completion of
bib record creation, and to 100% upon completion of copy
record creation.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/acq/common/li_table.js

index 12e177d..dfda02d 100644 (file)
@@ -2945,7 +2945,7 @@ function AcqLiTable() {
         var self = this;
         var vlArgs = (noVl) ? {} : {vandelay : this.vlAgent.values()};
         this.batchProgress = {};
-        progressDialog.show(true);
+        progressDialog.show(false);
         progressDialog.attr("title", localeStrings.LI_CREATING_ASSETS);
         fieldmapper.standardRequest(
             ['open-ils.acq', 'open-ils.acq.purchase_order.assets.create'],
@@ -3258,9 +3258,10 @@ function AcqLiTable() {
         this.vlAgent.handleResponse(resp,
             function(resp, res) {
                 if (clearProgressDialog) {
+                    progressDialog.update({ "progress": 100});
+                    progressDialog.update_message();
                     progressDialog.hide();
                     progressDialog.attr("title", "");
-                    progressDialog.update_message();
                 }
                 if(reloadOnComplete)
                      location.href = location.href;
@@ -3280,6 +3281,13 @@ function AcqLiTable() {
                         [ resp[keys[i]] ]
                     )
                 );
+                // for asset creation, three main phases:
+                // Vandelay, bibs, then copies
+                if (keys[i] == 'bibs') {
+                    progressDialog.update({ "progress": 33});
+                } else if (keys[i] == "copies") {
+                    progressDialog.update({ "progress": 67});
+                }
                 break;
             }
         }