Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-11-26 18:32:19 +0000
committerAngel Avila2014-11-26 18:32:19 +0000
commitcc9fb01fab7a3f5e2e390e5c2535adce4974392d (patch)
tree3b932e6bdee0e330947e8f2967c00a5576e915ca /plugins
parent9f47598b91f745f1581db5c5d104f496fc9a340f (diff)
downloadorg.eclipse.osee-cc9fb01fab7a3f5e2e390e5c2535adce4974392d.tar.gz
org.eclipse.osee-cc9fb01fab7a3f5e2e390e5c2535adce4974392d.tar.xz
org.eclipse.osee-cc9fb01fab7a3f5e2e390e5c2535adce4974392d.zip
feature[ats_ATS142363]: Improve ATS Web UI
- Add complete/cancelled information - Always use action title Change-Id: Ic3e148839955ff61620bc2dbeeb711950c27d935
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/resources/ActionUiResource.java6
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ActionPage.java33
2 files changed, 23 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/resources/ActionUiResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/resources/ActionUiResource.java
index 96023857af..98fb35b7cb 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/resources/ActionUiResource.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/resources/ActionUiResource.java
@@ -68,7 +68,7 @@ public final class ActionUiResource {
if (workItems.size() == 1) {
ActionPage page =
new ActionPage(logger, atsServer, (ArtifactReadable) workItems.iterator().next().getStoreObject(),
- "Action - " + ids, false);
+ false);
return page.generate();
} else {
String idStr = "";
@@ -96,7 +96,7 @@ public final class ActionUiResource {
if (action == null) {
return RestUtil.simplePage(String.format("Action with id [%s] can not be found", id));
}
- ActionPage page = new ActionPage(logger, atsServer, action, "Action - " + id, true);
+ ActionPage page = new ActionPage(logger, atsServer, action, true);
return page.generate();
}
@@ -164,7 +164,7 @@ public final class ActionUiResource {
return RestUtil.simplePage(String.format("Action with id [%s] can not be found", id));
}
IAtsWorkItem workItem = atsServer.getWorkItemFactory().getWorkItem(action);
- ActionPage page = new ActionPage(logger, atsServer, workItem, "Action - " + workItem.getAtsId(), false);
+ ActionPage page = new ActionPage(logger, atsServer, workItem, false);
page.setAddTransition(true);
return page.generate();
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ActionPage.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ActionPage.java
index da3f1edb21..1cc8d2f5f8 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ActionPage.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/ActionPage.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.ats.impl.IAtsServer;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -54,7 +55,6 @@ public class ActionPage {
private static final String ROLE_WIDGET_NAME = "Role";
private String pageTemplate;
private IAtsWorkItem workItem;
- private final String title;
private final ArtifactReadable action;
private final IAtsServer atsServer;
private final Log logger;
@@ -65,16 +65,15 @@ public class ActionPage {
private static List<String> ignoredWidgets;
private final boolean details;
- public ActionPage(Log logger, IAtsServer atsServer, IAtsWorkItem workItem, String title, boolean details) {
- this(logger, atsServer, (ArtifactReadable) workItem.getStoreObject(), title, details);
+ public ActionPage(Log logger, IAtsServer atsServer, IAtsWorkItem workItem, boolean details) {
+ this(logger, atsServer, (ArtifactReadable) workItem.getStoreObject(), details);
this.workItem = workItem;
}
- public ActionPage(Log logger, IAtsServer atsServer, ArtifactReadable action, String title, boolean details) {
+ public ActionPage(Log logger, IAtsServer atsServer, ArtifactReadable action, boolean details) {
this.logger = logger;
this.atsServer = atsServer;
this.action = action;
- this.title = title;
this.details = details;
}
@@ -90,11 +89,7 @@ public class ActionPage {
Conditions.checkNotNull(workItem, "workItem");
ViewModel page = new ViewModel("action.html");
- if (Strings.isValid(title)) {
- page.param("title", title);
- } else {
- page.param("title", action.getSoleAttributeAsString(AtsAttributeTypes.Title, ""));
- }
+ page.param("title", action.getSoleAttributeAsString(AtsAttributeTypes.Title, ""));
page.param("description", action.getSoleAttributeAsString(AtsAttributeTypes.Description, ""));
page.param("team", getTeamStr(atsServer, action));
page.param("ais", getAIStr(action));
@@ -224,7 +219,8 @@ public class ActionPage {
private void addStates(ViewModel page, IAtsWorkItem workItem, ArtifactReadable action) throws Exception {
StringBuilder statesSb = new StringBuilder();
IAtsWorkDefinition workDefinition = workItem.getWorkDefinition();
- Collection<String> visitedStates = workItem.getStateMgr().getVisitedStateNames();
+ IAtsStateManager stateMgr = workItem.getStateMgr();
+ Collection<String> visitedStates = stateMgr.getVisitedStateNames();
List<IAtsStateDefinition> statesOrderedByOrdinal =
atsServer.getWorkDefService().getStatesOrderedByOrdinal(workDefinition);
for (int index = statesOrderedByOrdinal.size() - 1; index >= 0; index--) {
@@ -233,8 +229,19 @@ public class ActionPage {
String stateHtmlTemplate = getStateHtmlTemplate();
String stateName = state.getName();
- if (stateName.equals(workItem.getStateMgr().getCurrentStateName())) {
- stateName = "CURRENT STATE => " + stateName;
+ if (stateName.equals(stateMgr.getCurrentStateName())) {
+ stateName = String.format("CURRENT STATE => <b>%s</b>", stateName);
+ if (stateMgr.getStateType().isCompleted()) {
+ stateName =
+ String.format("%s - on <b>%s</b> - by <b>%s</b>", stateName,
+ DateUtil.getMMDDYYHHMM(workItem.getCompletedDate()), workItem.getCompletedBy().getName());
+ } else if (stateMgr.getStateType().isCancelled()) {
+ stateName =
+ String.format("%s - on <b>%s</b> - by <b>%s</b><br/>from <b>%s</b> - reason <b>[%s]</b>",
+ stateName, DateUtil.getMMDDYYHHMM(workItem.getCancelledDate()),
+ workItem.getCancelledBy().getName(), workItem.getCancelledFromState(),
+ workItem.getCancelledReason());
+ }
}
stateHtmlTemplate = stateHtmlTemplate.replace("TITLE", stateName);

Back to the top