Pārlūkot izejas kodu

HPCC-10053 Display "busy" indicator on multi search

Fixes HPCC-10053

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 11 gadi atpakaļ
vecāks
revīzija
a62110ea5f

+ 3 - 0
esp/files/scripts/GridDetailsWidget.js

@@ -48,11 +48,14 @@ define([
         idProperty: "Change Me",
 
         store: null,
+        toolbar: null,
+        gridTab: null,
         grid: null,
         contextMenu: null,
 
         postCreate: function (args) {
             this.inherited(arguments);
+            this.toolbar = registry.byId(this.id + "Toolbar");
             this.gridTab = registry.byId(this.id + "_Grid");
         },
 

+ 48 - 32
esp/files/scripts/SearchResultsWidget.js

@@ -18,9 +18,12 @@ define([
     "dojo/_base/lang",
     "dojo/_base/array",
     "dojo/on",
+    "dojo/promise/all",
 
     "dijit/form/Button",
 
+    "dojox/widget/Standby",
+
     "dgrid/OnDemandGrid",
     "dgrid/Keyboard",
     "dgrid/Selection",
@@ -38,8 +41,9 @@ define([
     "hpcc/SFDetailsWidget",
     "hpcc/ESPUtil"
 
-], function (declare, lang, arrayUtil, on,
+], function (declare, lang, arrayUtil, on, all,
                 Button,
+                Standby,
                 OnDemandGrid, Keyboard, Selection, selector, ColumnResizer, DijitRegistry,
                 GridDetailsWidget, WsWorkunits, FileSpray, WsDfu, WUDetailsWidget, DFUWUDetailsWidget, LFDetailsWidget, SFDetailsWidget, ESPUtil) {
     return declare("SearchResultsWidget", [GridDetailsWidget], {
@@ -98,6 +102,11 @@ define([
                     context._onRowDblClick(row);
                 }
             });
+
+            this.standby = new Standby({ target: domID });
+            document.body.appendChild(this.standby.domNode);
+            this.standby.startup();
+
             return retVal;
         },
 
@@ -239,39 +248,46 @@ define([
             this.store.setData([]);
             this.grid.refresh();
             if (this.searchText) {
+                this.standby.show();
                 var context = this;
                 //  ECL WU  ---
-                WsWorkunits.WUQuery({ request: { Wuid: this.searchText }, suppressExceptionToaster: true }).then(function (response) {
-                    context.loadWUQueryResponse("Wuid", response);
-                });
-                WsWorkunits.WUQuery({ request: { Jobname: "*" + this.searchText + "*" } }).then(function (response) {
-                    context.loadWUQueryResponse("Job Name", response);
-                });
-                WsWorkunits.WUQuery({ request: { Owner: this.searchText } }).then(function (response) {
-                    context.loadWUQueryResponse("Owner", response);
-                });
-                WsWorkunits.WUQuery({ request: { ECL: this.searchText } }).then(function (response) {
-                    context.loadWUQueryResponse("ECL", response);
-                });
-                //  DFU WU  ---
-                FileSpray.GetDFUWorkunit({ request: { wuid: this.searchText }, suppressExceptionToaster: true }).then(function (response) {
-                    context.loadGetDFUWorkunitResponse("Wuid", response);
-                });
-                FileSpray.GetDFUWorkunits({ request: { Jobname: "*" + this.searchText + "*" } }).then(function (response) {
-                    context.loadGetDFUWorkunitsResponse("Job Name", response);
-                });
-                FileSpray.GetDFUWorkunits({ request: { Owner: this.searchText } }).then(function (response) {
-                    context.loadGetDFUWorkunitsResponse("Owner", response);
-                });
-                //  Logical Files  ---
-                WsDfu.DFUQuery({ request: { LogicalName: "*" + this.searchText + "*" } }).then(function (response) {
-                    context.loadDFUQueryResponse("Logical Name", response);
-                });
-                WsDfu.DFUQuery({ request: { Description: "*" + this.searchText + "*" } }).then(function (response) {
-                    context.loadDFUQueryResponse("Description", response);
-                });
-                WsDfu.DFUQuery({ request: { Owner: this.searchText } }).then(function (response) {
-                    context.loadDFUQueryResponse("Owner", response);
+                all([
+                    WsWorkunits.WUQuery({ request: { Wuid: this.searchText }, suppressExceptionToaster: true }).then(function (response) {
+                        context.loadWUQueryResponse("Wuid", response);
+                    }),
+                    WsWorkunits.WUQuery({ request: { Jobname: "*" + this.searchText + "*" } }).then(function (response) {
+                        context.loadWUQueryResponse("Job Name", response);
+                    }),
+                    WsWorkunits.WUQuery({ request: { Owner: this.searchText } }).then(function (response) {
+                        context.loadWUQueryResponse("Owner", response);
+                    }),
+                    WsWorkunits.WUQuery({ request: { ECL: this.searchText } }).then(function (response) {
+                        context.loadWUQueryResponse("ECL", response);
+                    }),
+                    //  DFU WU  ---
+                    FileSpray.GetDFUWorkunit({ request: { wuid: this.searchText }, suppressExceptionToaster: true }).then(function (response) {
+                        context.loadGetDFUWorkunitResponse("Wuid", response);
+                    }),
+                    FileSpray.GetDFUWorkunits({ request: { Jobname: "*" + this.searchText + "*" } }).then(function (response) {
+                        context.loadGetDFUWorkunitsResponse("Job Name", response);
+                    }),
+                    FileSpray.GetDFUWorkunits({ request: { Owner: this.searchText } }).then(function (response) {
+                        context.loadGetDFUWorkunitsResponse("Owner", response);
+                    }),
+                    //  Logical Files  ---
+                    WsDfu.DFUQuery({ request: { LogicalName: "*" + this.searchText + "*" } }).then(function (response) {
+                        context.loadDFUQueryResponse("Logical Name", response);
+                    }),
+                    WsDfu.DFUQuery({ request: { Description: "*" + this.searchText + "*" } }).then(function (response) {
+                        context.loadDFUQueryResponse("Description", response);
+                    }),
+                    WsDfu.DFUQuery({ request: { Owner: this.searchText } }).then(function (response) {
+                        context.loadDFUQueryResponse("Owner", response);
+                    })
+                ]).then(function (results) {
+                    context.standby.hide();
+                }, function (error) {
+                    context.standby.hide();
                 });
             }
         },