Skip to content
Snippets Groups Projects
Commit 120dcd45 authored by juanf's avatar juanf
Browse files

SSDM-3253 : Option to copy or not comment logs.

SVN: 36228
parent b4adcbf9
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ function SampleFormController(mainController, mode, sample) {
});
}
this.createUpdateCopySample = function(isCopyWithNewCode, linkParentsOnCopy, copyChildrenOnCopy) {
this.createUpdateCopySample = function(isCopyWithNewCode, linkParentsOnCopy, copyChildrenOnCopy, copyCommentsLogOnCopy) {
Util.blockUI();
var _this = this;
......@@ -232,6 +232,11 @@ function SampleFormController(mainController, mode, sample) {
parameters["sampleCode"] = isCopyWithNewCode;
parameters["notCopyProperties"] = [];
parameters["defaultBenchPropertyList"] = [];
if(!copyCommentsLogOnCopy && parameters["sampleProperties"]["XMLCOMMENTS"]) {
delete parameters["sampleProperties"]["XMLCOMMENTS"];
}
if(!linkParentsOnCopy) {
parameters["sampleParents"] = [];
}
......
......@@ -623,6 +623,8 @@ function SampleFormView(sampleFormController, sampleFormModel) {
component += "<span class='checkbox'><label><input type='checkbox' id='linkParentsOnCopy'> Link Parents </label></span>";
component += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
component += "<span class='checkbox'><label><input type='checkbox' id='copyChildrenOnCopy'> Copy Children </label></span>";
component += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
component += "<span class='checkbox'><label><input type='checkbox' id='copyCommentsLogOnCopy'> Copy Comments Log </label></span>";
component += "</div>";
component += "</div>";
component += "</div>";
......@@ -658,10 +660,11 @@ function SampleFormView(sampleFormController, sampleFormModel) {
var newSampleCodeForCopy = $("#newSampleCodeForCopy");
var linkParentsOnCopy = $("#linkParentsOnCopy")[0].checked;
var copyChildrenOnCopy = $("#copyChildrenOnCopy")[0].checked;
var copyCommentsLogOnCopy = $("#copyCommentsLogOnCopy")[0].checked;
var isValid = newSampleCodeForCopy[0].checkValidity();
if(isValid) {
var newSampleCodeForCopyValue = newSampleCodeForCopy.val();
_this._sampleFormController.createUpdateCopySample(newSampleCodeForCopyValue, linkParentsOnCopy, copyChildrenOnCopy);
_this._sampleFormController.createUpdateCopySample(newSampleCodeForCopyValue, linkParentsOnCopy, copyChildrenOnCopy, copyCommentsLogOnCopy);
} else {
Util.showError("Invalid code.", function() {}, true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment