From 3d6a6700502e969fdc3142342df21bd3726f9e83 Mon Sep 17 00:00:00 2001 From: zkofiro Date: Mon, 31 Jul 2023 20:01:38 -0700 Subject: [PATCH] QOL changes - multiple selection + added emptyMessage --- .../tank/project/AssociateDataFileBean.java | 36 +++++++++---------- .../intuit/tank/project/WorkloadScripts.java | 36 +++++++++---------- .../main/webapp/projects/associateFiles.xhtml | 8 ++--- .../main/webapp/projects/projectview.xhtml | 8 ++--- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/web/web_support/src/main/java/com/intuit/tank/project/AssociateDataFileBean.java b/web/web_support/src/main/java/com/intuit/tank/project/AssociateDataFileBean.java index faa011f90..53decb92b 100644 --- a/web/web_support/src/main/java/com/intuit/tank/project/AssociateDataFileBean.java +++ b/web/web_support/src/main/java/com/intuit/tank/project/AssociateDataFileBean.java @@ -44,24 +44,24 @@ public class AssociateDataFileBean implements Serializable { private DualListModel selectionModel; - private DataFile selectedAvailableFile; - private DataFile selectedSelectedFile; + private List selectedAvailableFiles; + private List selectedSelectedFiles; - public DataFile getSelectedAvailableFile() { - return selectedAvailableFile; + public List getSelectedAvailableFiles() { + return selectedAvailableFiles; } - public void setSelectedAvailableFile(DataFile selectedAvailableFile) { - this.selectedAvailableFile = selectedAvailableFile; + public void setSelectedAvailableFiles(List selectedAvailableFiles) { + this.selectedAvailableFiles = selectedAvailableFiles; } - public DataFile getSelectedSelectedFile() { - return selectedSelectedFile; + public List getSelectedSelectedFiles() { + return selectedSelectedFiles; } - public void setSelectedSelectedFile(DataFile selectedSelectedFile) { - this.selectedSelectedFile = selectedSelectedFile; + public void setSelectedSelectedFiles(List selectedSelectedFiles) { + this.selectedSelectedFiles = selectedSelectedFiles; } public void addAllToTarget() { @@ -70,16 +70,16 @@ public void addAllToTarget() { } public void addToTarget() { - if(selectedAvailableFile != null) { - selectionModel.getTarget().add(0, selectedAvailableFile); - selectionModel.getSource().remove(selectedAvailableFile); + if(!selectedAvailableFiles.isEmpty()) { + selectionModel.getTarget().addAll(0, selectedAvailableFiles); + selectionModel.getSource().removeAll(selectedAvailableFiles); } } public void removeFromTarget() { - if(selectedSelectedFile != null) { - selectionModel.getSource().add(0, selectedSelectedFile); - selectionModel.getTarget().remove(selectedSelectedFile); + if(!selectedSelectedFiles.isEmpty()) { + selectionModel.getSource().addAll(0, selectedSelectedFiles); + selectionModel.getTarget().removeAll(selectedSelectedFiles); } } @@ -89,11 +89,11 @@ public void removeAllFromTarget() { } public void onSourceSelect(SelectEvent event) { - selectedAvailableFile = (DataFile) event.getObject(); + selectedAvailableFiles = (List) event.getObject(); } public void onTargetSelect(SelectEvent event) { - selectedSelectedFile = (DataFile) event.getObject(); + selectedSelectedFiles = (List) event.getObject(); } /** diff --git a/web/web_support/src/main/java/com/intuit/tank/project/WorkloadScripts.java b/web/web_support/src/main/java/com/intuit/tank/project/WorkloadScripts.java index 1e8a16a8a..29ec97280 100644 --- a/web/web_support/src/main/java/com/intuit/tank/project/WorkloadScripts.java +++ b/web/web_support/src/main/java/com/intuit/tank/project/WorkloadScripts.java @@ -65,8 +65,8 @@ public class WorkloadScripts implements Serializable { private int tabIndex = 0; - private Script selectedAvailableScript; - private Script selectedSelectedScript; + private List