Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
fix(frontend): protect double quotes that were breaking the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Bodet authored and maxhbr committed Jan 15, 2018
1 parent 39c6ffc commit e8ed405
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 27 deletions.
Expand Up @@ -55,7 +55,7 @@
<link rel="stylesheet" href="<%=request.getContextPath()%>/webjars/jquery-ui/1.12.1/jquery-ui.css">

<div id="header"></div>
<p class="pageHeader"><span class="pageHeaderBigSpan">Component: ${component.name}</span>
<p class="pageHeader"><span class="pageHeaderBigSpan">Component: <sw360:out value="${component.name}"/></span>
<span class="pull-right">
<core_rt:if test="${isUserAllowedToMerge}">
<input type="button" data-component-id="${component.id}" id="merge" value="Merge" class="addButton">
Expand Down
Expand Up @@ -59,7 +59,7 @@
<script type="text/javascript" src="<%=request.getContextPath()%>/js/releaseTools.js"></script>

<div id="header"></div>
<p class="pageHeader"><label id="releaseHeaderLabel"> <span class="pageHeaderBigSpan"> Component: ${component.name}</span>
<p class="pageHeader"><label id="releaseHeaderLabel"> <span class="pageHeaderBigSpan"> Component: <sw360:out value="${component.name}"/>}</span>
<select id="releaseSelect" onchange="this.options[this.selectedIndex].value
&& (window.location = createDetailURLfromReleaseId (this.options[this.selectedIndex].value) );">
<core_rt:forEach var="releaseItr" items="${component.releases}">
Expand Down
Expand Up @@ -63,7 +63,7 @@
result.push({
"DT_RowId": "${release.id}",
"0": "<sw360:out value="${release.name}"/>",
"1": "<a href='<portlet:renderURL ><portlet:param name="<%=PortalConstants.COMPONENT_ID%>" value="${component.id}"/><portlet:param name="<%=PortalConstants.RELEASE_ID%>" value="${release.id}"/><portlet:param name="<%=PortalConstants.PAGENAME%>" value="<%=PortalConstants.PAGENAME_RELEASE_DETAIL%>"/></portlet:renderURL>' target='_self'>" + "${release.version}" + "</a>",
"1": "<a href='<portlet:renderURL ><portlet:param name="<%=PortalConstants.COMPONENT_ID%>" value="${component.id}"/><portlet:param name="<%=PortalConstants.RELEASE_ID%>" value="${release.id}"/><portlet:param name="<%=PortalConstants.PAGENAME%>" value="<%=PortalConstants.PAGENAME_RELEASE_DETAIL%>"/></portlet:renderURL>' target='_self'><sw360:out value="${release.version}"/></a>",
"2": "<span id='clearingState${release.id}'><sw360:DisplayEnum value="${release.clearingState}"/></span>",
"3": "<sw360:DisplayDownloadReport attachments="${release.attachments}" filterAttachmentType="<%=AttachmentType.CLEARING_REPORT%>" var="attachment"><sw360:DisplayDownloadApprovedClearingReport attachment="${attachment}" contextType="${release.type}" contextId="${release.id}" /></sw360:DisplayDownloadReport>",
"4": "<span id='mainlineState${release.id}'><sw360:DisplayEnum value="${release.mainlineState}"/></span>",
Expand Down
Expand Up @@ -21,7 +21,7 @@
<td width="33%">
<label class="textlabel stackedLabel mandatory" for="comp_name">Name</label>
<input id="comp_name" name="<portlet:namespace/><%=Component._Fields.NAME%>" type="text" placeholder="Enter Name" required="" class="followedByImg"
value="${component.name}"/>
value="<sw360:out value="${component.name}"/>"/>
<img class="infopic" src="<%=request.getContextPath()%>/images/ic_info.png"
title="Name of the component"/>
</td>
Expand Down
14 changes: 7 additions & 7 deletions frontend/sw360-portlet/src/main/webapp/html/components/view.jsp
Expand Up @@ -115,14 +115,14 @@
<td>
<label for="component_name">Component Name</label>
<input type="text" class="searchbar filterInput" name="<portlet:namespace/><%=Component._Fields.NAME%>"
value="${name}" id="component_name">
value="<sw360:out value="${name}"/>" id="component_name">
</td>
</tr>
<tr>
<td>
<label for="categories">Categories</label>
<input type="text" class="searchbar filterInput" name="<portlet:namespace/><%=Component._Fields.CATEGORIES%>"
value="${categories}" id="categories">
value="<sw360:out value="${categories}"/>" id="categories">
</td>
</tr>
<tr>
Expand All @@ -139,39 +139,39 @@
<td>
<label for="languages">Languages</label>
<input type="text" class="searchbar filterInput" name="<portlet:namespace/><%=Component._Fields.LANGUAGES%>"
value="${languages}" id="languages">
value="<sw360:out value="${languages}"/>" id="languages">
</td>
</tr>
<tr>
<td>
<label for="software_platforms">Software Platforms</label>
<input type="text" class="searchbar filterInput"
name="<portlet:namespace/><%=Component._Fields.SOFTWARE_PLATFORMS%>"
value="${softwarePlatforms}" id="software_platforms">
value="<sw360:out value="${softwarePlatforms}"/>" id="software_platforms">
</td>
</tr>
<tr>
<td>
<label for="operating_systems">Operating Systems</label>
<input type="text" class="searchbar filterInput"
name="<portlet:namespace/><%=Component._Fields.OPERATING_SYSTEMS%>"
value="${operatingSystems}" id="operating_systems">
value="<sw360:out value="${operatingSystems}"/>" id="operating_systems">
</td>
</tr>
<tr>
<td>
<label for="vendor_names">Vendors</label>
<input type="text" class="searchbar filterInput"
name="<portlet:namespace/><%=Component._Fields.VENDOR_NAMES%>"
value="${vendorNames}" id="vendor_names">
value="<sw360:out value="${vendorNames}"/>" id="vendor_names">
</td>
</tr>
<tr>
<td>
<label for="main_licenses">Main Licenses</label>
<input type="text" class="searchbar filterInput"
name="<portlet:namespace/><%=Component._Fields.MAIN_LICENSE_IDS%>"
value="${mainLicenseIds}" id="main_licenses">
value="<sw360:out value="${mainLicenseIds}"/>" id="main_licenses">
</td>
</tr>
</tbody>
Expand Down
Expand Up @@ -53,21 +53,21 @@
<td>
<label class="textlabel mandatory" for="given_name">First Name</label>
<input type="text" name="<portlet:namespace/><%=User._Fields.GIVENNAME%>" required=""
value="${newuser.givenname}" id="given_name">
value="<sw360:out value="${newuser.givenname}"/>" id="given_name">
</td>
</tr>
<tr>
<td>
<label class="textlabel mandatory" for="last_name">Last Name</label>
<input type="text" name="<portlet:namespace/><%=User._Fields.LASTNAME%>" required=""
value="${newuser.lastname}" id="last_name">
value="<sw360:out value="${newuser.lastname}"/>" id="last_name">
</td>
</tr>
<tr>
<td>
<label class="textlabel mandatory" for="email">Email</label>
<input type="text" name="<portlet:namespace/><%=User._Fields.EMAIL%>" required=""
value="${newuser.email}" id="email">
value="<sw360:out value="${newuser.email}"/>" id="email">
</td>
</tr>
<tr>
Expand Down
Expand Up @@ -55,7 +55,7 @@
<core_rt:if test="${empty attributeNotFoundException}">
<div id="header"></div>
<p class="pageHeader"><span
class="pageHeaderBigSpan">License: ${licenseDetail.fullname} (${licenseDetail.shortname})</span>
class="pageHeaderBigSpan">License: <sw360:out value="${licenseDetail.fullname}"/> (<sw360:out value="${licenseDetail.shortname}"/>)</span>
<core_rt:if test="${isUserAtLeastClearingAdmin == 'Yes'}">
<span class="pull-right">
<input type="button" onclick="editLicense()" id="edit" value="Edit License Details and Text"
Expand Down
Expand Up @@ -10,7 +10,7 @@
~ http://www.eclipse.org/legal/epl-v10.html
--%>
<table class="table info_table" id="licenseDetailOverview">
<thead><tr><th colspan="2">License Details: ${licenseDetail.fullname} (${licenseDetail.shortname})</th></tr></thead>
<thead><tr><th colspan="2">License Details: <sw360:out value="${licenseDetail.fullname}"/> (<sw360:out value="${licenseDetail.shortname}"/>)</th></tr></thead>
<tr><td>Fullname:</td><td><sw360:out value="${licenseDetail.fullname}"/></td></tr>
<tr><td>Shortname:</td><td><sw360:out value="${licenseDetail.shortname}"/></td></tr>
<tr><td>Type:</td><td><sw360:out value="${licenseDetail.licenseType.licenseType}"/></td></tr>
Expand Down
Expand Up @@ -39,7 +39,7 @@
<%@include file="/html/moderation/includes/moderationActions.jspf"%>

<div id="header"></div>
<p class="pageHeader"><span class="pageHeaderBigSpan">Moderation Delete Component: ${component.name}</span>
<p class="pageHeader"><span class="pageHeaderBigSpan">Moderation Delete Component: <sw360:out value="${component.name}"/></span>
<span class="pageHeaderBigSpan" style="float:right">(<sw360:DisplayEnum value="${moderationRequest.componentType}"/>)</span>
</p>
<%@include file="/html/moderation/includes/moderationActionButtons.jspf"%>
Expand Down
Expand Up @@ -39,7 +39,7 @@
<%@include file="/html/moderation/includes/moderationActions.jspf"%>

<div id="header"></div>
<p class="pageHeader"><span class="pageHeaderBigSpan">Moderation Change Component: ${component.name}</span>
<p class="pageHeader"><span class="pageHeaderBigSpan">Moderation Change Component: <sw360:out value="${component.name}"/></span>
<span class="pageHeaderBigSpan" style="float:right">(<sw360:DisplayEnum value="${moderationRequest.componentType}"/>)</span>
</p>
<%@include file="/html/moderation/includes/moderationActionButtons.jspf"%>
Expand Down
Expand Up @@ -100,7 +100,7 @@
<td>
<label for="project_name">Project Name</label>
<input type="text" class="searchbar" name="<portlet:namespace/><%=Project._Fields.NAME%>"
value="${name}" id="project_name" class="filterInput">
value="<sw360:out value="${name}"/>" id="project_name" class="filterInput">
</td>
</tr>
<tr>
Expand Down
Expand Up @@ -73,7 +73,7 @@
/* Print all attachment table data as array into the html page */
<core_rt:forEach items="${attachments}" var="attachment">
attachmentJSON.push({
"fileName": "${attachment.filename}",
"fileName": "<sw360:out value="${attachment.filename}"/>",
"size": "n/a",
"type": "<sw360:DisplayEnumShort value="${attachment.attachmentType}"/>",
"uploadedTeam": "<sw360:DisplayEllipsisString value="${attachment.createdTeam}"/>",
Expand All @@ -83,13 +83,13 @@
"usage": "n/a",
"actions": "<sw360:DisplayDownloadAttachmentFile attachment="${attachment}" contextType="${documentType}" contextId="${documentID}"/>",
"sha1": "${attachment.sha1}",
"uploadedOn": "${attachment.createdOn}",
"sha1": "<sw360:out value="${attachment.sha1}"/>",
"uploadedOn": "<sw360:out value="${attachment.createdOn}"/>",
"uploadedComment": "<core_rt:if test="${not empty attachment.createdComment}">Comment: <sw360:DisplayEllipsisString value="${attachment.createdComment}"/></core_rt:if>",
"checkedOn": "${attachment.checkedOn}",
"checkedOn": "<sw360:out value="${attachment.checkedOn}"/>",
"checkedComment": "<core_rt:if test="${not empty attachment.checkedComment}">Comment: <sw360:DisplayEllipsisString value="${attachment.checkedComment}"/></core_rt:if>",
"checkStatus": "${attachment.checkStatus}"
"checkStatus": "<sw360:out value="${attachment.checkStatus}"/>"
});
</core_rt:forEach>
Expand Down
Expand Up @@ -14,7 +14,7 @@
<table class="table info_table"">
<thead>
<tr>
<th colspan="4">${documentName} is used by the following components</th>
<th colspan="4"><sw360:out value="${documentName}"/> is used by the following components</th>
</tr>
<tr>
<th>Vendor</th>
Expand Down
Expand Up @@ -15,7 +15,7 @@
<table id="usingProjectsTable" class="table info_table">
<thead>
<tr>
<th colspan="3">${documentName} is used by the following projects</th>
<th colspan="3"><sw360:out value="${documentName}"/> is used by the following projects</th>
</tr>
<tr>
<th>Project Name</th><th>Group</th><th>Responsible</th>
Expand Down
Expand Up @@ -12,7 +12,7 @@
<table class="table info_table" title="Usage overview">
<thead>
<tr>
<th colspan="3">${documentName} is present in the following releases</th>
<th colspan="3"><sw360:out value="${documentName}"/> is present in the following releases</th>
</tr>
<tr>
<th>Release</th>
Expand Down

0 comments on commit e8ed405

Please sign in to comment.