Skip to content

Commit

Permalink
Fix: Bulkedit empty check + DB migration fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
asurendra authored and asurendra committed May 20, 2016
1 parent c6b82cb commit 5294e26
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 30 deletions.
31 changes: 14 additions & 17 deletions src/main/java/com/deem/excord/controller/TestCaseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,9 @@ public String testcaseBulkEdit(Model model, HttpServletRequest request, HttpSess
public String testcaseBulkSave(Model model, HttpServletRequest request, HttpSession session,
@RequestParam(value = "nodeId", required = true) Long nodeId,
@RequestParam(value = "bulkTc", required = true) String bulkTc,
@RequestParam(value = "tenabled", required = false) Boolean tenabled,
@RequestParam(value = "tautomated", required = false) Boolean tautomated,
@RequestParam(value = "tpriority", required = true) String tpriority,
@RequestParam(value = "ttype", required = true) String ttype,
@RequestParam(value = "tautomated", required = false) String tautomated,
@RequestParam(value = "tpriority", required = false) String tpriority,
@RequestParam(value = "ttype", required = false) String ttype,
@RequestParam(value = "tlanguage", required = false) String tlanguage,
@RequestParam(value = "tproduct", required = false) String tproduct,
@RequestParam(value = "tfeature", required = false) String tfeature,
Expand All @@ -393,34 +392,32 @@ public String testcaseBulkSave(Model model, HttpServletRequest request, HttpSess
String[] tcLst = StringUtils.commaDelimitedListToStringArray(bulkTc);
for (String tc : tcLst) {
EcTestcase tcObj = tcDao.findOne(Long.parseLong(tc));
if (taversion != null) {
if (!StringUtils.isEmpty(taversion)) {
tcObj.setAddedVersion(taversion);
}
if (ttype != null) {
if (!StringUtils.isEmpty(ttype)) {
tcObj.setCaseType(ttype);
}
if (tdversion != null) {
if (!StringUtils.isEmpty(tdversion)) {
tcObj.setDeprecatedVersion(tdversion);
}
if (tenabled != null) {
tcObj.setEnabled(tenabled);
}
if (tautomated != null) {
tcObj.setAutomated(tautomated);
if (!StringUtils.isEmpty(tautomated)) {
tcObj.setAutomated(Boolean.valueOf(tautomated));
}
if (tfeature != null) {
if (!StringUtils.isEmpty(tfeature)) {
tcObj.setFeature(tfeature);
}
if (tlanguage != null) {
if (!StringUtils.isEmpty(tlanguage)) {
tcObj.setLanguage(tlanguage);
}
if (tpriority != null) {
if (!StringUtils.isEmpty(tpriority)) {
tcObj.setPriority(tpriority);
}
if (tproduct != null) {
if (!StringUtils.isEmpty(tproduct)) {
tcObj.setProduct(tproduct);
}
if (tcObj.getDescription() == null || tcObj.getDescription().equals("")) {
//Safetyblock incase the description is empty. Dont remove.
if (StringUtils.isEmpty(tcObj.getDescription())) {
tcObj.setDescription(" ");
}
tcDao.save(tcObj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

update `excord`.`ec_requirement` set story_point = 1 where id = 0;
update `excord`.`ec_requirement` set story_point = 1 where story_point is null;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
Expand Down
25 changes: 13 additions & 12 deletions src/main/resources/templates/testcase_form_bulk.ftl.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ <h3>Bulk Edit Test Cases</h3>
</div>
<div class="form-group">
<label class="col-md-2 control-label">
<label for="tpriority">Priority<font color="red">*</font></label>
Priority
</label>
<div class="col-md-6">
<select class="form-control" id="tpriority" name="tpriority">
<option value="P1" selected>Critical (P1)</option>
<option value="" selected></option>
<option value="P1">Critical (P1)</option>
<option value="P2">Major (P2)</option>
<option value="P3">Minor (P3)</option>
<option value="P4">Trivial (P4)</option>
Expand All @@ -35,10 +36,11 @@ <h3>Bulk Edit Test Cases</h3>
</div>
<div class="form-group">
<label class="col-md-2 control-label">
<label for="ttype">Type<font color="red">*</font></label>
Type
</label>
<div class="col-md-6">
<select class="form-control" id="ttype" name="ttype">
<option value="" selected></option>
<option value="REGRESSION">Regression</option>
<option value="MIXED_MODE">Mixed mode</option>
<option value="NEW_FEATURE">New feature</option>
Expand All @@ -52,18 +54,17 @@ <h3>Bulk Edit Test Cases</h3>
</div>
<div class="form-group">
<label class="col-md-2 control-label">
Flags
Automation
</label>
<div class="col-md-6 text-left">
<div class="checkbox form-group">
&nbsp;&nbsp;&nbsp;
<label><input type="checkbox" name="tenabled" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="success"> Enabled</label>
<label><input type="checkbox" name="tautomated" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="success"> Automated</label>
<br/>
<br/>
</div>
<div class="col-md-6">
<select class="form-control" id="tautomated" name="tautomated">
<option value="" selected></option>
<option value="true">Automated</option>
<option value="false">Not Automated</option>
</select>
</div>
</div>

<div class="form-group">
<label class="col-md-2 control-label">
<label for="tlanguage">Language</label>
Expand Down

0 comments on commit 5294e26

Please sign in to comment.