Show modal dialog during pulling of images

Before this change, during docker-compose pulling images
the user of the UI would not see any progress for several
minutes.

Now the user sees a message explaining that docker images
are being downloaded.

Bug: Issue 9954
Change-Id: I2bd179158c109f3b136d1da6f71b46073fa9b449
diff --git a/src/main/resources/static/js/analyticswizard.js b/src/main/resources/static/js/analyticswizard.js
index 73cf24a..c46d73a 100644
--- a/src/main/resources/static/js/analyticswizard.js
+++ b/src/main/resources/static/js/analyticswizard.js
@@ -28,15 +28,18 @@
 }
 
 function waitForImport() {
-  hideAllAlerts();
-  waitingDialog.show(
-  'Importing analytics data. Be patient, this might take a while...', {
-    dialogSize: 'lg',
-    progressType: 'success'
-  });
+  showLoading('Importing analytics data. Be patient, this might take a while...', 'success');
   pollStatusEndpoint();
 }
 
+function showLoading(text, type) {
+  hideAllAlerts();
+  waitingDialog.show(text, {
+    dialogSize: 'lg',
+    progressType: type
+  });
+}
+
 function pollStatusEndpoint() {
     setTimeout(function () { checkStatusRequest()}, 5000);
 }
@@ -110,6 +113,7 @@
       action: command,
       dashboard_name: $("#input-dashboard-name").val()
     };
+    showLoading('Getting docker containers ready. Be patient, this might take a while...', 'info');
     $.ajax({
       type : "POST",
       url : `/a/projects/${projectName}/analytics-wizard~server`,
@@ -124,6 +128,7 @@
       },
       error: function(jqXHR, textStatus, errorThrown) {
         if(jqXHR.status != 201) {
+          waitingDialog.hide();
           showFailureWithText("Error starting your dashboard: " + errorThrown)
         }
       }