Commit 8dce8ce5 authored by Malo Toudic's avatar Malo Toudic
Browse files

fix ui in project and execution detail pages

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/simulators/gazelle-webservice-tester/trunk@62564 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent 3f6c18bb
......@@ -9,6 +9,7 @@ import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.security.Identity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -33,6 +34,10 @@ public class ProjectDetailBean {
projectDetail = new ProjectDetail();
projectDetail.setSoapuiProject(SoapuiProjectDao.getSoapuiProjectById(Integer.parseInt(projectIdString)));
projectDetail.setTree(Tree.getComponentAsTree(projectDetail.getSoapuiProject().getGwtProject(), true));
String edit = urlParams.get("edit");
if (edit != null && edit.equals("true") && Identity.instance().hasRole("admin_role")) {
editProject = true;
}
}
public boolean isEditProject() {
......
......@@ -240,13 +240,13 @@ public class GwtTestStepResult implements Serializable {
public void downloadRequest() {
final String content = this.getMessages().getRequest().getContentAsString();
final String fileName = this.testStep.getLabel() + ".xml";
final String fileName = this.testStep.getLabel() + "_request.xml";
DownloadFile.exportToFile("text/xml", content, fileName);
}
public void downloadResponse() {
final String content = this.getMessages().getResponse().getContentAsString();
final String fileName = this.testStep.getLabel() + ".xml";
final String fileName = this.testStep.getLabel() + "_response.xml";
DownloadFile.exportToFile("text/xml", content, fileName);
}
......
......@@ -159,6 +159,10 @@ public class SoapuiProject implements Serializable {
}
}
public String edit() {
return "/project/projectDetail.seam?id=" + id + "&edit=true";
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......
......@@ -140,7 +140,8 @@
<div class="row">
<div class="col-md-6">
<rich:tree id="treeOfParams" value="#{executionResult.getComponentWithParentsAsTree()}" var="node">
<rich:tree id="treeOfParams" value="#{executionResult.getComponentWithParentsAsTree()}"
var="node">
<rich:treeNode iconExpanded="images/testcase.png"
iconCollapsed="images/testcase.png"
rendered="#{node.data.getClass().getSimpleName() == 'GwtTestCase'}"
......@@ -179,7 +180,8 @@
type="unordered">
<s:decorate template="/layout/form/_checkbox.xhtml">
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">#{propertySelected.customProperty.label}</ui:define>
<ui:define name="label">#{propertySelected.customProperty.label}
</ui:define>
<h:outputText value="#{propertySelected.value}"/>
</s:decorate>
</s:decorate>
......@@ -229,87 +231,105 @@
<gri:panel>
<f:facet name="header">
<h:outputText value="Request"/>
<h:commandLink action="#{testStepResult.downloadRequest()}">
<s:span title="Download file" styleClass="gzl-icon-download text-info"/>
</h:commandLink>
<div class="row">
<div class="col-md-6">
<h:outputText value="Request"/>
<h:commandLink action="#{testStepResult.downloadRequest()}"
rendered="#{testStepResult.getRequestContent() != null}">
<s:span title="Download file" styleClass="gzl-icon-download text-info"/>
</h:commandLink>
</div>
<div class="col-md-6" style="text-align:right">
<h:outputText
value="#{testStepResult.getRequestValidation().validationStatus}"
styleClass="gzl-label #{testStepResult.getRequestValidation().validationStatus}"
rendered="#{testStepResult.getRequestValidation() != null}"/>
<h:commandLink actionListener="#{testStepResult.validateRequest()}"
rendered="#{testStepResult.getRequestValidation() == null}"
target="_blank">
<s:span title="Validate request" styleClass="gzl-icon-play-blue"/>
</h:commandLink>
<h:commandLink actionListener="#{testStepResult.validateRequest()}"
target="_blank"
rendered="#{testStepResult.getRequestValidation() != null}">
<s:span title="Re-validate" styleClass="gzl-icon-repeat"/>
</h:commandLink>
<h:outputLink value="#{testStepResult.getRequestValidation().permanentLink}"
target="_blank">
<s:span title="Validation result" styleClass="gzl-icon-link"/>
</h:outputLink>
</div>
</div>
</f:facet>
<s:div rendered="#{testStepResult.getRequestContent() != null}">
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">EVS Validation</ui:define>
<h:outputText value="#{testStepResult.getRequestValidation().validationStatus}"
styleClass="gzl-label #{testStepResult.getRequestValidation().validationStatus}"
rendered="#{testStepResult.getRequestValidation() != null}"/>
<h:commandLink actionListener="#{testStepResult.validateRequest()}"
rendered="#{testStepResult.getRequestValidation() == null}"
target="_blank">
<s:span title="Validate request" styleClass="gzl-icon-play-blue"/>
</h:commandLink>
</s:decorate>
<h:commandButton value="Re-validate" action="#{testStepResult.validateRequest()}"
styleClass="gzl-btn-blue"
onclick="this.form.target='_blank'"
rendered="#{testStepResult.getRequestValidation() != null}"/>
<s:decorate template="/layout/display/_display.xhtml"
rendered="#{testStepResult.getRequestValidation() != null}">
<ui:define name="label">EVS Validation permanent link</ui:define>
<h:outputLink value="#{testStepResult.getRequestValidation().permanentLink}"
target="_blank">
<h:outputText value="#{testStepResult.getRequestValidation().permanentLink}"/>
</h:outputLink>
</s:decorate>
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">Timestamp</ui:define>
<h:outputText value="#{testStepResult.getTimestamp()}"/>
</s:decorate>
<h:outputText value="#{testStepResult.getRequestContent()}" escape="false"/>
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">Timestamp</ui:define>
<h:outputText value="#{testStepResult.getTimestamp()}"/>
</s:decorate>
<h:outputText value="#{testStepResult.getRequestContent()}" escape="false"/>
</s:div>
<rich:panel styleClass="gzl-alert gzl-alert-yellow"
rendered="#{testStepResult.getRequestContent() == null}">
<span class="gzl-icon-exclamation-triangle"/>
<h:outputText
value="No request found"/>
</rich:panel>
</gri:panel>
<gri:panel>
<f:facet name="header">
<h:outputText value="Response"/>
<h:commandLink action="#{testStepResult.downloadResponse()}">
<s:span title="Download file" styleClass="gzl-icon-download text-info"/>
</h:commandLink>
<div class="row">
<div class="col-md-6">
<h:outputText value="Response"/>
<h:commandLink action="#{testStepResult.downloadResponse()}"
rendered="#{testStepResult.getResponseContent() != null}">
<s:span title="Download file" styleClass="gzl-icon-download text-info"/>
</h:commandLink>
</div>
<div class="col-md-6" style="text-align:right">
<h:outputText
value="#{testStepResult.getRequestValidation().validationStatus}"
styleClass="gzl-label #{testStepResult.getResponseValidation().validationStatus}"
rendered="#{testStepResult.getRequestValidation() != null}"/>
<h:commandLink actionListener="#{testStepResult.validateResponse()}"
rendered="#{testStepResult.getRequestValidation() == null}"
target="_blank">
<s:span title="Validate request" styleClass="gzl-icon-play-blue"/>
</h:commandLink>
<h:commandLink actionListener="#{testStepResult.validateResponse()}"
target="_blank"
rendered="#{testStepResult.getRequestValidation() != null}">
<s:span title="Re-validate" styleClass="gzl-icon-repeat"/>
</h:commandLink>
<h:outputLink value="#{testStepResult.getResponseValidation().permanentLink}"
target="_blank">
<s:span title="Validation result" styleClass="gzl-icon-link"/>
</h:outputLink>
</div>
</div>
</f:facet>
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">EVS Validation</ui:define>
<h:outputText value="#{testStepResult.getResponseValidation().validationStatus}"
styleClass="gzl-label #{testStepResult.getResponseValidation().validationStatus}"
rendered="#{testStepResult.getResponseValidation() != null}"/>
<h:commandLink actionListener="#{testStepResult.validateResponse()}"
rendered="#{testStepResult.getResponseValidation() == null}"
target="_blank">
<s:span title="Validate response" styleClass="gzl-icon-play-blue"/>
</h:commandLink>
</s:decorate>
<h:commandButton value="Re-validate" action="#{testStepResult.validateResponse()}"
styleClass="gzl-btn-blue"
onclick="this.form.target='_blank'"
rendered="#{testStepResult.getResponseValidation() != null}"/>
<s:decorate template="/layout/display/_display.xhtml"
rendered="#{testStepResult.getResponseValidation() != null}">
<ui:define name="label">EVS Validation permanent link</ui:define>
<h:outputLink value="#{testStepResult.getResponseValidation().permanentLink}"
target="_blank">
<h:outputText value="#{testStepResult.getResponseValidation().permanentLink}"/>
</h:outputLink>
</s:decorate>
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">Timestamp</ui:define>
<h:outputText value="#{testStepResult.getResponseTimestamp()}"/>
</s:decorate>
<h:outputText value="#{testStepResult.getResponseContent()}" escape="false"/>
<s:div rendered="#{testStepResult.getResponseContent() != null}">
<s:decorate template="/layout/display/_display.xhtml">
<ui:define name="label">Timestamp</ui:define>
<h:outputText value="#{testStepResult.getResponseTimestamp()}"/>
</s:decorate>
<h:outputText value="#{testStepResult.getResponseContent()}" escape="false"/>
</s:div>
<rich:panel styleClass="gzl-alert gzl-alert-yellow"
rendered="#{testStepResult.getResponseContent() == null}">
<span class="gzl-icon-exclamation-triangle"/>
<h:outputText
value="No response found"/>
</rich:panel>
</gri:panel>
</gri:tab>
......
......@@ -141,11 +141,6 @@
</div>
</gri:panel>
<f:facet name="footer">
<a4j:commandButton value="Disable project"
action="#{projectDetail.projectDetail.setActive(false)}"
styleClass="gzl-btn-blue"
rendered="#{projectDetail.editProject == false and s:hasRole('admin_role') and projectDetail.projectDetail.soapuiProject.active == true}"
render="pageDiv"/>
<a4j:commandButton value="Activate project"
action="#{projectDetail.projectDetail.setActive(true)}"
styleClass="gzl-btn-blue"
......@@ -156,6 +151,7 @@
<h:commandButton value="Save" action="#{projectDetail.saveEditProject()}"
styleClass="gzl-btn-blue" render="pageDiv" rendered="#{projectDetail.editProject}"/>
<h:commandButton value="Cancel" action="#{projectDetail.setEditProject(false)}" styleClass="gzl-btn" rendered="#{projectDetail.editProject}" immediate="true" render="pageDiv"/>
<h:commandButton value="Back to list" action="/project/projectList.seam" styleClass="gzl-btn"/>
</f:facet>
</gri:panel>
</s:div>
......
......@@ -96,6 +96,9 @@
<h:outputLink value="/gazelle-webservice-tester/project/projectDetail.seam?id=#{project.id}">
<s:span title="Details" styleClass="gzl-icon-search"/>
</h:outputLink>
<h:commandLink action="#{project.edit()}" rendered="#{identity.loggedIn}">
<s:span title="Edit" styleClass="gzl-icon-pencil"/>
</h:commandLink>
<a4j:commandLink actionListener="#{projectList.deleteProject(project)}"
rendered="#{s:hasRole('admin_role')}" render="globalForm">
<s:span styleClass="gzl-icon-trash-o "/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment