...
 
Commits (6)
......@@ -15,6 +15,7 @@ Changes
* [UI]: Fixed error where synchronizing sequence files could lead to truncated files without generating an error. (0.22.3)
* [UI]: Adding NCBI SRA accession to sample metadata when uploading data to NCBI.
* [Developer]: Updated FastQC to 0.11.7.
* [UI]: Fixed bug in sample edit page that didn't allow users to clear a field in the sample.
* [Workflow]: Updated the AssemblyAnnotation pipeline to v0.5 and the AssemblyAnnotationCollection pipeline to v0.4. Both pipelines now use Shovill for assembly and QUAST for assembly quality assessment in addition to Prokka for annotation.
0.21.0 to 0.22.0
......
......@@ -191,21 +191,28 @@ public class SamplesController extends BaseController {
@RequestParam(name = "metadata") String metadataString, @RequestParam Map<String, String> params,
HttpServletRequest request) {
logger.debug("Updating sample [" + sampleId + "]");
Map<String, Object> updatedValues = new HashMap<>();
for (String field : FIELDS) {
String fieldValue = params.get(field);
if (!Strings.isNullOrEmpty(fieldValue)) {
updatedValues.put(field, fieldValue);
if(Strings.isNullOrEmpty(fieldValue)){
fieldValue = null;
}
updatedValues.put(field, fieldValue);
if (fieldValue != null) {
model.addAttribute(field, fieldValue);
}
}
// Special case because it is a date field.
updatedValues.put(COLLECTION_DATE, collectionDate);
if (collectionDate != null) {
updatedValues.put(COLLECTION_DATE, collectionDate);
model.addAttribute(COLLECTION_DATE, collectionDate);
}
/**
* If there's sample metadata to add, add it here.
*/
......
......@@ -21,16 +21,14 @@
<div class="form-group" th:class="#{#maps.containsKey(errors, 'sampleName')}">
<label for="sampleName" th:text="#{samples.details.sampleName}">Sample Name</label>
<input type="text" id="sampleName" name="sampleName" class="form-control input-full"
th:placeholder="${sample.getSampleName()}"
th:value="${sampleName}"/>
th:value="${sampleName} != null ? ${sampleName} : ${sample.getSampleName()}"/>
<span id="sampleName-error" th:if="${#maps.containsKey(errors, 'sampleName')}"
class="help-block" th:text="${errors.sampleName}"></span>
</div>
<div class="form-group" th:class="#{#maps.containsKey(errors, 'description')}">
<label for="description" th:text="#{samples.details.description}">Description</label>
<textarea type="text" id="description" name="description"
class="form-control input-full" th:placeholder="${sample.getDescription()}"
th:text="${description}"></textarea>
class="form-control input-full" th:text="${description} != null ? ${description} : ${sample.getDescription()}"></textarea>
<span id="description-error" th:if="${#maps.containsKey(errors, 'description')}"
class="help-block" th:text="${errors.description}"></span>
</div>
......@@ -40,8 +38,7 @@
<div class="form-group" th:class="${#maps.containsKey(errors, 'organism')} ? has-error">
<label for="organism" th:text="#{samples.details.organism}">Organism</label>
<input type="text" class="form-control input-full" id="organism" name="organism"
th:placeholder="${sample.getOrganism()} != null ? ${sample.getOrganism()}"
th:value="${organism}"/>
th:value="${organism} != null ? ${organism} : ${sample.getOrganism()}"/>
<span id="organism-error" th:if="${#maps.containsKey(errors, 'organism')}"
class="help-block" th:text="${errors.organism}"></span>
......@@ -49,16 +46,14 @@
<div class="form-group" th:class="${#maps.containsKey(errors, 'isolate')} ? has-error">
<label for="isolate" th:text="#{samples.details.isolate}">Organism</label>
<input type="text" class="form-control input-full" id="isolate" name="isolate"
th:placeholder="${sample.getIsolate()} != null ? ${sample.getIsolate()}"
th:value="${isolate}"/>
th:value="${isolate} != null ? ${isolate} : ${sample.getIsolate()}"/>
<span id="isolate-error" th:if="${#maps.containsKey(errors, 'isolate')}"
class="help-block" th:text="${errors.isolate}"></span>
</div>
<div class="form-group" th:class="${#maps.containsKey(errors, 'strain')} ? has-error">
<label for="strain" th:text="#{samples.details.strain}">Organism</label>
<input type="text" class="form-control input-full" id="strain" name="strain"
th:placeholder="${sample.getStrain()} != null ? ${sample.getStrain()}"
th:value="${strain}"/>
th:value="${strain} != null ? ${strain} : ${sample.getStrain()}"/>
<span id="strain-error" th:if="${#maps.containsKey(errors, 'strain')}"
class="help-block" th:text="${errors.strain}"></span>
</div>
......@@ -68,8 +63,7 @@
<div class="form-group" th:class="${#maps.containsKey(errors, 'collectedBy')} ? has-error">
<label for="collectedBy" th:text="#{samples.collected-by}">Collected By</label>
<input type="text" class="form-control input-full" id="collectedBy" name="collectedBy"
th:placeholder="${sample.getCollectedBy()} != null ? ${sample.getCollectedBy()}"
th:value="${collectedBy}"/>
th:value="${collectedBy} != null ? ${collectedBy} : ${sample.getCollectedBy()}"/>
<span id="collectedBy-error" th:if="${#maps.containsKey(errors, 'collectedBy')}"
class="help-block" th:text="${errors.collectedBy}"></span>
</div>
......@@ -79,8 +73,7 @@
Collected</label>
<input type="date" class="form-control input-full" id="collectionDate"
name="collectionDate"
th:placeholder="${sample.getCollectionDate()} != null ? ${sample.getCollectionDate()}"
th:value="${collectionDate}"/>
th:value="${collectionDate} != null ? ${collectionDate} : ${sample.getCollectionDate()}"/>
<span id="collectionDate-error" th:if="${#maps.containsKey(errors, 'collectionDate')}"
class="help-block" th:text="${errors.collectionDate}"></span>
</div>
......@@ -89,8 +82,7 @@
<label for="isolationSource" th:text="#{samples.isolation-source.title}">Source</label>
<input type="text" class="form-control input-full" id="isolationSource"
name="isolationSource"
th:placeholder="${sample.getIsolationSource()} != null ? ${sample.getIsolationSource()}"
th:value="${isolationSource}"/>
th:value="${isolationSource} != null ? ${isolationSource} : ${sample.getIsolationSource()}"/>
<span id="isolationSource-error" th:if="${#maps.containsKey(errors, 'isolationSource')}"
class="help-block" th:text="${errors.isolationSource}"></span>
</div>
......@@ -100,8 +92,7 @@
Location</label>
<input type="text" class="form-control input-full" id="geographicLocationName"
name="geographicLocationName"
th:placeholder="${sample.getGeographicLocationName()} != null ? ${sample.getGeographicLocationName()}"
th:value="${geographicLocationName}"/>
th:value="${geographicLocationName} != null ? ${geographicLocationName} : ${sample.getGeographicLocationName()}"/>
<span id="geographicLocationName-error"
th:if="${#maps.containsKey(errors, 'geographicLocationName')}" class="help-block"
th:text="${errors.geographicLocationName}"></span>
......@@ -113,8 +104,7 @@
<label for="latitude" th:text="#{location.latitude}">Latitude</label>
<input type="text" class="form-control input-full" id="latitude"
name="latitude"
th:placeholder="${sample.getLatitude()} != null ? ${sample.getLatitude()}"
th:value="${latitude}"/>
th:value="${latitude} != null ? ${latitude} : ${sample.getLatitude()}"/>
<span id="latitude-error" th:if="${#maps.containsKey(errors, 'latitude')}"
class="help-block" th:text="${errors.latitude}"></span>
</div>
......@@ -125,8 +115,7 @@
<label for="longitude" th:text="#{location.longitude}">Longitude</label>
<input type="text" class="form-control input-full" id="longitude"
name="longitude"
th:placeholder="${sample.getLongitude()} != null ? ${sample.getLongitude()}"
th:value="${longitude}"/>
th:value="${longitude} != null ? ${longitude} : ${sample.getLongitude()}"/>
<span id="longitude-error" th:if="${#maps.containsKey(errors, 'longitude')}"
class="help-block" th:text="${errors.longitude}"></span>
</div>
......