Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2018-11-14 18:12:14 -0500
committerDavid W. Miller2018-11-15 15:37:32 -0500
commit478175ddcb4ccb6cabab984ec9525eb03bd2f69c (patch)
treebd576d8fd2da4aa585a0be1edcd273b5f610def4
parent251e6bbf1c12dc601bbef404c724d08698ee2b3b (diff)
downloadorg.eclipse.osee-478175ddcb4ccb6cabab984ec9525eb03bd2f69c.tar.gz
org.eclipse.osee-478175ddcb4ccb6cabab984ec9525eb03bd2f69c.tar.xz
org.eclipse.osee-478175ddcb4ccb6cabab984ec9525eb03bd2f69c.zip
bug[ats_TW11683]: Remove unassigned from user dialog when user is already selected
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumnUI.java36
1 files changed, 25 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumnUI.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumnUI.java
index 854689521b..b669f9ad3e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumnUI.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AssigneeColumnUI.java
@@ -21,6 +21,7 @@ import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.column.AtsColumnToken;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
@@ -31,6 +32,7 @@ import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkArtifactImageProvider;
@@ -114,17 +116,29 @@ public class AssigneeColumnUI extends XViewerAtsColumnIdColumn implements IAltLe
return false;
}
}
- UserCheckTreeDialog uld = new UserCheckTreeDialog("Select Assigness", "Select to assign.\nDeSelect to un-assign.",
- AtsClientService.get().getUserServiceClient().getOseeUsers(
- AtsClientService.get().getUserService().getUsers(Active.Active)));
- if (awas.iterator().next().getParentTeamWorkflow() != null) {
- uld.setTeamMembers(AtsClientService.get().getUserServiceClient().getOseeUsers(
- awas.iterator().next().getParentTeamWorkflow().getTeamDefinition().getMembersAndLeads()));
+ User unassigned = AtsClientService.get().getUserServiceClient().getOseeUser(AtsCoreUsers.UNASSIGNED_USER);
+ Collection<User> oseeUsers = AtsClientService.get().getUserServiceClient().getOseeUsers(
+ AtsClientService.get().getUserService().getUsers(Active.Active));
+ AbstractWorkflowArtifact awaI = awas.iterator().next();
+ TeamWorkFlowArtifact twa = awaI != null ? awaI.getParentTeamWorkflow() : null;
+ Collection<User> teamMembers = twa != null ? AtsClientService.get().getUserServiceClient().getOseeUsers(
+ twa.getTeamDefinition().getMembersAndLeads()) : null;
+ Collection<User> selected =
+ awas.size() == 1 && awaI != null ? AtsClientService.get().getUserServiceClient().getOseeUsers(
+ awaI.getStateMgr().getAssignees()) : null;
+
+ // unassigned is not useful in the selection choice dialog
+ oseeUsers.remove(unassigned);
+ if (teamMembers != null) {
+ teamMembers.remove(unassigned);
}
-
- if (awas.size() == 1) {
- uld.setInitialSelections(AtsClientService.get().getUserServiceClient().getOseeUsers(
- awas.iterator().next().getStateMgr().getAssignees()));
+ UserCheckTreeDialog uld =
+ new UserCheckTreeDialog("Select Assignees", "Select to assign.\nDeSelect to un-assign.", oseeUsers);
+ if (teamMembers != null) {
+ uld.setTeamMembers(teamMembers);
+ }
+ if (selected != null) {
+ uld.setInitialSelections(selected);
}
if (uld.open() != 0) {
return false;
@@ -135,7 +149,7 @@ public class AssigneeColumnUI extends XViewerAtsColumnIdColumn implements IAltLe
}
// As a convenience, remove the UnAssigned user if another user is selected
if (users.size() > 1) {
- users.remove(AtsCoreUsers.SYSTEM_USER);
+ users.remove(AtsCoreUsers.UNASSIGNED_USER);
}
for (AbstractWorkflowArtifact awa : awas) {
awa.getStateMgr().setAssignees(users);

Back to the top