Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java
index 56c948ec27..a5edc23a6b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.world;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -23,6 +24,7 @@ import org.eclipse.osee.ats.api.query.AtsSearchUserType;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workflow.WorkItemType;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.search.widget.ActionableItemSearchWidget;
import org.eclipse.osee.ats.search.widget.ColorTeamSearchWidget;
@@ -72,6 +74,9 @@ public abstract class WorldEditorParameterSearchItem extends WorldSearchItem imp
private final Pattern displayName = Pattern.compile("displayName=\"(.*?)\"");
private String shortName = "";
private final List<String> widgetOrder = new LinkedList<>();
+ private static List<WorkItemType> GOAL_SPRINT_BACKLOG_WORKITEMTYPES =
+ Arrays.asList(WorkItemType.AgileBacklog, WorkItemType.AgileSprint, WorkItemType.Goal);
+ private static List<WorkItemType> TEAM_DEF_WORKITEMTYPES = null;
private TitleSearchWidget title;
private StateTypeSearchWidget stateType;
private UserSearchWidget user;
@@ -121,7 +126,7 @@ public abstract class WorldEditorParameterSearchItem extends WorldSearchItem imp
if (workItemType != null && workItemType.get().isEmpty()) {
return new Result("You must select a workflow type.");
}
- if ((teamDef != null && teamDef.get().isEmpty()) && (ai != null && ai.get().isEmpty())) {
+ if ((teamDef != null && teamDef.get() != null && teamDef.get().isEmpty()) && (ai != null && ai.get().isEmpty()) && isTeamDefWorkItemTypesSelected()) {
return new Result("You must select either Actionable Item(s) or Team Definition(s).");
}
return Result.TrueResult;
@@ -131,6 +136,26 @@ public abstract class WorldEditorParameterSearchItem extends WorldSearchItem imp
}
}
+ private List<WorkItemType> getTeamDefWorkItemTypes() {
+ if (TEAM_DEF_WORKITEMTYPES == null) {
+ TEAM_DEF_WORKITEMTYPES = new LinkedList<>();
+ for (WorkItemType type : WorkItemType.values()) {
+ if (!GOAL_SPRINT_BACKLOG_WORKITEMTYPES.contains(type)) {
+ TEAM_DEF_WORKITEMTYPES.add(type);
+ }
+ }
+ }
+ return TEAM_DEF_WORKITEMTYPES;
+ }
+
+ /**
+ * @return true if any of the work item types are related to team defs and ais
+ */
+ private boolean isTeamDefWorkItemTypesSelected() {
+ boolean sel = !Collections.setIntersection(getTeamDefWorkItemTypes(), workItemType.get()).isEmpty();
+ return sel;
+ }
+
@Override
public void run(WorldEditor worldEditor, SearchType searchType, boolean forcePend) {
boolean pend = Collections.getAggregate(tableLoadOptions).contains(TableLoadOption.ForcePend) || forcePend;

Back to the top