Bladeren bron

HPCC-10667 New ECL Watch Deselection broken

Deselected items would still show up in selections.
Deleted items would still be in selection list.

Fixes HPCC-10667

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 11 jaren geleden
bovenliggende
commit
c7c0c3fc8f

+ 6 - 3
esp/files/scripts/DFUQueryWidget.js

@@ -138,7 +138,7 @@ define([
                 var context = this;
                 WsDfu.DFUArrayAction(this.workunitsGrid.getSelected(), this.i18n.Delete, {
                     load: function (response) {
-                        context.refreshGrid(response);
+                        context.refreshGrid(true);
                     }
                 });
             }
@@ -212,7 +212,7 @@ define([
                 var formData = domForm.toObject(this.id + "AddToSuperfileForm");
                 WsDfu.AddtoSuperfile(this.workunitsGrid.getSelected(), formData.Superfile, formData.ExistingFile, {
                     load: function (response) {
-                        context.refreshGrid(response);
+                        context.refreshGrid();
                     }
                 });
                 registry.byId(this.id + "AddtoDropDown").closeDropDown();
@@ -533,8 +533,11 @@ define([
             });
         },
 
-        refreshGrid: function (args) {
+        refreshGrid: function (clearSelection) {
             this.workunitsGrid.set("query", this.getFilter());
+            if (clearSelection) {
+                this.workunitsGrid.clearSelection();
+            }
         },
 
         refreshActionState: function () {

+ 6 - 1
esp/files/scripts/ESPUtil.js

@@ -195,7 +195,12 @@ define([
             getSelected: function() {
                 var retVal = [];
                 for (var id in this.selection) {
-                    retVal.push(this.store.get(id));
+                    if (this.selection[id]) {
+                        var storeItem = this.store.get(id);
+                        if (storeItem) {
+                            retVal.push(storeItem);
+                        }
+                    }
                 }
                 return retVal;
             }

+ 4 - 1
esp/files/scripts/GetDFUWorkunitsWidget.js

@@ -119,7 +119,7 @@ define([
                 var context = this;
                 FileSpray.DFUWorkunitsAction(this.workunitsGrid.getSelected(), this.i18n.Delete, {
                     load: function (response) {
-                        context.refreshGrid(response);
+                        context.refreshGrid(true);
                     }
                 });
             }
@@ -390,6 +390,9 @@ define([
 
         refreshGrid: function (args) {
             this.workunitsGrid.set("query", this.filter.toObject());
+            if (clearSelection) {
+                this.workunitsGrid.clearSelection();
+            }
         },
 
         refreshActionState: function () {

+ 5 - 2
esp/files/scripts/LZBrowseWidget.js

@@ -178,7 +178,7 @@ define([
                             Names: item.partialPath
                         },
                         load: function (response) {
-                            context.refreshGrid();
+                            context.refreshGrid(true);
                         }
                     });
                 });
@@ -512,10 +512,13 @@ define([
             this.refreshActionState();
         },
 
-        refreshGrid: function (args) {
+        refreshGrid: function (clearSelection) {
             this.landingZonesGrid.set("query", {
                 id: "*"
             });
+            if (clearSelection) {
+                this.landingZonesGrid.clearSelection();
+            }
         },
 
         refreshActionState: function () {

+ 4 - 1
esp/files/scripts/QuerySetQueryWidget.js

@@ -428,13 +428,16 @@ define([
             if (confirm(this.i18n.DeleteSelectedQueries)) {
                 var context = this;
                 WsWorkunits.WUQuerysetQueryAction(this.querySetGrid.getSelected(), "Delete").then(function (response) {
-                    context.refreshGrid();
+                    context.refreshGrid(true);
                 });
             }
         },
 
         refreshGrid: function (args) {
             this.querySetGrid.set("query", this.getFilter());
+            if (clearSelection) {
+                this.workunitsGrid.clearSelection();
+            }
         },
 
         _onSuspend: function(){

+ 5 - 2
esp/files/scripts/WUQueryWidget.js

@@ -123,7 +123,7 @@ define([
                 var selection = this.workunitsGrid.getSelected();
                 WsWorkunits.WUAction(selection, "Delete", {
                     load: function (response) {
-                        context.refreshGrid(response);
+                        context.refreshGrid(true);
                     }
                 });
             }
@@ -422,8 +422,11 @@ define([
             this.workunitsGrid.startup();
         },
 
-        refreshGrid: function (args) {
+        refreshGrid: function (clearSelection) {
             this.workunitsGrid.set("query", this.getFilter());
+            if (clearSelection) {
+                this.workunitsGrid.clearSelection();
+            }
         },
 
         refreshActionState: function () {