diff --git a/cairis/controllers/EnvironmentController.py b/cairis/controllers/EnvironmentController.py
index 94fbc5ab9..95b75f729 100644
--- a/cairis/controllers/EnvironmentController.py
+++ b/cairis/controllers/EnvironmentController.py
@@ -252,7 +252,6 @@ def put(self, name):
# endregion
def delete(self, name):
session_id = get_session_id(session, request)
-
dao = EnvironmentDAO(session_id)
dao.delete_environment(name=name)
dao.close()
diff --git a/cairis/core/MySQLDatabaseProxy.py b/cairis/core/MySQLDatabaseProxy.py
index 51e4b4929..d76c86ed3 100644
--- a/cairis/core/MySQLDatabaseProxy.py
+++ b/cairis/core/MySQLDatabaseProxy.py
@@ -1369,6 +1369,8 @@ def deleteEnvironment(self,environmentId):
curs = self.conn.connection().connection.cursor()
sqlTxt = 'call delete_environment(%s)'
curs.execute(sqlTxt,[environmentId])
+ session = self.conn()
+ session.commit()
curs.close()
except _mysql_exceptions.IntegrityError as e:
exceptionText = 'Cannot remove environment due to dependent data (' + str(e) + ').'
diff --git a/cairis/mio/MisusabilityContentHandler.py b/cairis/mio/MisusabilityContentHandler.py
index 0aac8b028..458c563ba 100755
--- a/cairis/mio/MisusabilityContentHandler.py
+++ b/cairis/mio/MisusabilityContentHandler.py
@@ -63,6 +63,20 @@ def startElement(self,name,attrs):
self.theName = attrs['name']
self.theConcept = attrs['concept']
self.theObject = attrs['object']
+ elif name == 'grounds':
+ refName = attrs['reference']
+ refType = attrs['type']
+ refArtifact = ''
+ self.theGrounds.append((refName,'',refType))
+ elif name == 'warrant':
+ refName = attrs['reference']
+ refType = attrs['type']
+ refArtifact = ''
+ self.theWarrants.append((refName,'',refType))
+ elif name == 'rebuttal':
+ refName = attrs['reference']
+ refType = attrs['type']
+ refArtifact = ''
elif name == 'task_characteristic':
self.theTask = attrs['task']
self.theModalQualifier = attrs['modal_qualifier']
diff --git a/cairis/sql/procs.sql b/cairis/sql/procs.sql
index 1d8a6f75c..24b01c39e 100755
--- a/cairis/sql/procs.sql
+++ b/cairis/sql/procs.sql
@@ -11061,7 +11061,7 @@ end
create procedure getPersonaCharacteristicsSummary()
begin
- select p.name,bv.name,pc.description from persona_characteristic pc, persona p, behavioural_variable bv where pc.persona_id = p.id and pc.variable_id = bv.id order by 1,2;
+ select p.name,bv.name,pc.description from persona_characteristic pc, persona p, behavioural_variable bv where pc.persona_id = p.id and pc.variable_id = bv.id order by 1,2,3;
end
//
diff --git a/cairis/web/dist/css/CAIRIS.css b/cairis/web/dist/css/CAIRIS.css
index 25785659a..6d3f45f14 100644
--- a/cairis/web/dist/css/CAIRIS.css
+++ b/cairis/web/dist/css/CAIRIS.css
@@ -87,7 +87,7 @@ table, th, td{
display: none;
}
thead{
- border-bottom: 3px black solid;
+ border-bottom: 3px #ddd solid;
}
.comboboxD{
visibility: hidden;
@@ -152,19 +152,24 @@ footer{
min-width: 200px;
}
#AssociationsAssetsOptions > th, td { /*min-width: 75px;*/ }
-#assetstabsID{
- width: 70%;
-}
.tabs textarea{
width:100%;
}
.right{
float: right;
}
-/*environmentstable*/
-#theEnvironmentDictionary{
- margin : 5px;
+
+.table-striped th {
+ background-color: grey;
+ color: white;
}
+
+.table-striped th.addRemove td.addRemove {
+ width: 15px;
+}
+
+.table-striped tbody tr.active td {background-color: #ccc;}
+
table.clickable-table {
border-collapse: collapse;
}
@@ -243,7 +248,7 @@ select#theType {
min-width: 10px;
}
.fa-plus{
- color: green;
+ color: white;
}
.fa-minus{
color: red;
diff --git a/cairis/web/dist/js/cairis/assets.js b/cairis/web/dist/js/cairis/assets.js
index 4f277bae4..e6f834eb2 100644
--- a/cairis/web/dist/js/cairis/assets.js
+++ b/cairis/web/dist/js/cairis/assets.js
@@ -120,6 +120,9 @@ function viewAsset(assetName) {
appendAssetInterface(aInt);
});
$('#editAssetsOptionsform').loadJSON(newdata,null);
+ if (newdata.isCritical) {
+ $('#theCriticalRationale').prop("disabled",false);
+ }
fillAssetEnvironments(newdata.theEnvironmentProperties);
$('#editAssetsOptionsform').validator('update');
$("#theEnvironmentDictionary").find("tbody").find(".assetEnvironmentRow:first").trigger('click');
@@ -198,6 +201,7 @@ mainContent.on('click', ".removeAssetEnvironment", function () {
mainContent.on('click', '.assetEnvironmentRow', function(event){
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
var asset = JSON.parse($.session.get("Asset"));
var text = $(this).text();
$.session.set("assetEnvironmentName", text);
diff --git a/cairis/web/dist/js/cairis/attackers.js b/cairis/web/dist/js/cairis/attackers.js
index c0476b491..2fe8abb94 100644
--- a/cairis/web/dist/js/cairis/attackers.js
+++ b/cairis/web/dist/js/cairis/attackers.js
@@ -127,6 +127,7 @@ function viewAttacker(attackerName) {
var mainContent = $("#objectViewer");
mainContent.on("click",".attackerEnvironment", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
clearAttackerEnvInfo();
var attacker = JSON.parse($.session.get("Attacker"));
var theEnvName = $(this).text();
diff --git a/cairis/web/dist/js/cairis/countermeasures.js b/cairis/web/dist/js/cairis/countermeasures.js
index ef55432a4..8da0acb1a 100644
--- a/cairis/web/dist/js/cairis/countermeasures.js
+++ b/cairis/web/dist/js/cairis/countermeasures.js
@@ -231,6 +231,7 @@ mainContent.on("change", "#theCountermeasureCost", function() {
});
mainContent.on("click", ".countermeasuresEnvironments", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
clearCountermeasureEnvInfo();
var countermeasure = JSON.parse($.session.get("Countermeasure"));
var envName = $(this).text();
@@ -397,7 +398,7 @@ mainContent.on('click', '#chooseTargetButton', function () {
$.session.set("Countermeasure", JSON.stringify(cm));
$('#theTargets').find('tbody').find('tr:eq(' + selectedIdx + ')').find("td:eq(1)").text(target.theName);
$('#theTargets').find('tbody').find('tr:eq(' + selectedIdx + ')').find("td:eq(2)").text(target.theEffectiveness);
- $('#theTargets').find('tbody').find('tr:eq(' + selectedIdx + ')').find("td:eq(2)").text(target.theRationale);
+ $('#theTargets').find('tbody').find('tr:eq(' + selectedIdx + ')').find("td:eq(3)").text(target.theRationale);
$('#ChooseTargetDialog').modal('hide');
}
else {
diff --git a/cairis/web/dist/js/cairis/environments.js b/cairis/web/dist/js/cairis/environments.js
index 054c3cbd6..cc17f6776 100644
--- a/cairis/web/dist/js/cairis/environments.js
+++ b/cairis/web/dist/js/cairis/environments.js
@@ -48,21 +48,25 @@ $(document).on('click', "td.environment-rows",function(){
}, 10);
});
$.each(data.theEnvironments, function (index, env) {
- $("#envToEnvTable").append("
| " + env + " |
");
+ $("#envToEnvTable").append(" | " + env + " |
");
$("#overrideCombobox").append($("").text(env));
});
+ if (data.theEnvironments.length > 0) {
+ $('#duplicateSettings').show();
+ }
switch (data.theDuplicateProperty) {
case "Maximise":
- $("#MaximiseID").prop('checked', true);
+ $("#maximise").click();
+ $('#overrideCombobox').empty();
break;
case "Override":
- $("#OverrideID").prop('checked', true);
- $("#overrideCombobox").prop("disabled", false);
+ $("#override").click();
+ $('#overrideCombobox').val(data.theOverridingEnvironment);
break;
case "None":
- $("#overrideCombobox").prop("disabled", false);
- $("#OverrideID").prop('checked', false);
- $("#MaximiseID").prop('checked', false);
+ $('#overrideCombobox').empty();
+ $("#override").prop('checked', false);
+ $("#maximise").prop('checked', true);
break;
}
$("#editEnvironmentOptionsform").validator('update');
@@ -120,15 +124,18 @@ $("#environmentMenuClick").click(function () {
});
var mainContent = $("#objectViewer");
-mainContent.on('change', "#OverrideID", function () {
- if($("#OverrideID").prop("checked")){
- $("#overrideCombobox").prop("disabled",false);
+mainContent.on('change', "#override", function () {
+ $("#overrideCombobox").empty();
+ if($("#override").prop("checked")){
+ $("#envToEnvTable").find("tbody").find("tr .removeEnvinEnv").each(function () {
+ $("#overrideCombobox").append($("").text($(this).next("td").text()));
+ });
}
});
-mainContent.on('change', "#MaximiseID", function () {
- if($("#MaximiseID").prop("checked")){
- $("#overrideCombobox").prop("disabled",true);
+mainContent.on('change', "#maximise", function () {
+ if($("#maximise").prop("checked")){
+ $('#overrideCombobox').empty();
}
});
@@ -142,9 +149,8 @@ mainContent.on('click', ".removeEnvinEnv", function () {
}
});
if ($('#envToEnvTable').find("tbody").is(':empty')){
- $("input:radio[name='duplication']").each(function(i) {
- this.checked = false;
- });
+ $("#maximise").prop("checked");
+ $('#duplicateSettings').hide();
}
});
@@ -175,7 +181,16 @@ mainContent.on("click", "#addEnvtoEnv", function () {
function addEnvToEnv() {
var text = $("#chooseEnvironmentSelect").val();
$("#envToEnvTable").append(" | "+ text +" |
");
- $("#overrideCombobox").append("");
+
+ if ($('#envToEnvTable tr').length == 1) {
+ $("#maximise").prop('checked', true);
+ }
+ else {
+ if ($("#override").prop('checked' == true)) {
+ $("#overrideCombobox").append("");
+ }
+ }
+ $("#duplicateSettings").show();
$('#chooseEnvironment').modal('hide');
};
@@ -227,7 +242,6 @@ function fillupEnvironmentObject(env) {
$("#tensionsTable").find("td").each(function() {
var attr = $(this).find("select").attr('rationale');
if(typeof attr !== typeof undefined && attr !== false) {
- var env = JSON.parse($.session.get("Environment"));
var select = $(this).find("select");
var tension = jQuery.extend(true, {}, tensionDefault);
tension.rationale = select.attr("rationale");
@@ -245,17 +259,16 @@ function fillupEnvironmentObject(env) {
envInEnv.push($(this).next("td").text());
});
env.theEnvironments = envInEnv;
- env.theDuplicateProperty = $("input:radio[name ='duplication']:checked").val();
- if(env.theDuplicateProperty == "" || env.theDuplicateProperty == undefined){
- env.theDuplicateProperty = "None";
- env.theOverridingEnvironment = $('#overrideCombobox').val();
- }
- var theEnvinEnvArray = [];
- $("#overrideCombobox").find("option").each(function (index, option) {
- theEnvinEnvArray.push($(option).text());
- });
- env.theEnvironments = theEnvinEnvArray;
+ if (env.theEnvironments.length > 0) {
+ if ($("#override").prop('checked') == true) {
+ env.theDuplicateProperty = "Override";
+ env.theOverridingEnvironment = $('#overrideCombobox').val();
+ }
+ else {
+ env.theDuplicateProperty = "Maximise";
+ }
+ }
return env;
}
@@ -387,4 +400,3 @@ function postEnvironment(environment, callback){
}
});
}
-
diff --git a/cairis/web/dist/js/cairis/goals.js b/cairis/web/dist/js/cairis/goals.js
index 7a14013eb..34f3d29cf 100644
--- a/cairis/web/dist/js/cairis/goals.js
+++ b/cairis/web/dist/js/cairis/goals.js
@@ -101,6 +101,7 @@ $(document).on('click', "td.goal-rows", function(){
var mainContent = $("#objectViewer");
mainContent.on('click', ".goalEnvProperties", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
var goal = JSON.parse($.session.get("Goal"));
var name = $(this).text();
$.session.set("GoalEnvName", name);
@@ -675,19 +676,19 @@ function emptyGoalEnvTables(){
}
function appendGoalEnvironment(text){
- $("#theGoalEnvironments").append(" | "+ text +" |
");
+ $("#theGoalEnvironments").append(" | "+ text +" |
");
}
function appendGoalGoal(goal){
- $("#editgoalsGoalsTable").append(' | '+goal[0]+' | '+goal[1]+' | '+goal[2]+' | '+goal[3]+' | '+goal[4]+' |
');
+ $("#editgoalsGoalsTable").append(' | '+goal[0]+' | '+goal[1]+' | '+goal[2]+' | '+goal[3]+' | '+goal[4]+' |
');
}
function appendGoalSubGoal(subgoal){
- $("#editgoalsSubgoalsTable").append(' | '+subgoal[0]+' | '+subgoal[1]+' | '+subgoal[2]+' | '+subgoal[3]+' | '+subgoal[4]+' |
');
+ $("#editgoalsSubgoalsTable").append(' | '+subgoal[0]+' | '+subgoal[1]+' | '+subgoal[2]+' | '+subgoal[3]+' | '+subgoal[4]+' |
');
}
function appendGoalConcern(concern){
- $("#editgoalsConcernTable").append(' | '+concern+' |
');
+ $("#editgoalsConcernTable").append(' | '+concern+' |
');
}
function appendGoalConcernAssoc(assoc){
- $("#editgoalsConcernassociationsTable").append(' | '+assoc[0]+' | '+assoc[1]+' | '+assoc[2]+' | '+assoc[4]+' | '+assoc[3]+' |
');
+ $("#editgoalsConcernassociationsTable").append(' | '+assoc[0]+' | '+assoc[1]+' | '+assoc[2]+' | '+assoc[4]+' | '+assoc[3]+' |
');
}
mainContent.on('click', '#goalCancelButton', function (e) {
@@ -696,31 +697,6 @@ mainContent.on('click', '#goalCancelButton', function (e) {
refreshMenuBreadCrumb('goal');
});
-function getAllgoals(callback) {
- $.ajax({
- type: "GET",
- dataType: "json",
- accept: "application/json",
- data: {
- session_id: String($.session.get('sessionID'))
- },
- crossDomain: true,
- url: serverIP + "/api/goals",
- success: function (data) {
- if (jQuery.isFunction(callback)) {
- callback(data);
- }
- },
- error: function (xhr, textStatus, errorThrown) {
- var error = JSON.parse(xhr.responseText);
- showPopup(false, String(error.message));
- debugLogger(String(this.url));
- debugLogger("error: " + xhr.responseText + ", textstatus: " + textStatus + ", thrown: " + errorThrown);
- return null;
- }
- });
-}
-
$(document).on('click', "td.deleteGoalButton", function (e) {
e.preventDefault();
var goalName = $(this).find('i').attr("value");
diff --git a/cairis/web/dist/js/cairis/locations.js b/cairis/web/dist/js/cairis/locations.js
index f98a9e3c5..adad3053d 100644
--- a/cairis/web/dist/js/cairis/locations.js
+++ b/cairis/web/dist/js/cairis/locations.js
@@ -436,7 +436,7 @@ mainContent.on('click','#addLocationLink',function() {
mainContent.on('click','td.location-link',function(){
var iRow = $(this).closest("tr");
- selectedLink = iRow.find("td:eq(1)").text();
+ var selectedLink = iRow.find("td:eq(1)").text();
$('#addLocationLinkDialog').attr('data-selectedLink',JSON.stringify(selectedLink));
$('#addLocationLinkDialog').attr('data-selectedIndex',iRow.index());
$('#addLocationLinkDialog').modal('show');
diff --git a/cairis/web/dist/js/cairis/obstacles.js b/cairis/web/dist/js/cairis/obstacles.js
index b867e293f..92411584d 100644
--- a/cairis/web/dist/js/cairis/obstacles.js
+++ b/cairis/web/dist/js/cairis/obstacles.js
@@ -84,11 +84,11 @@ $(document).on('click', "td.obstacle-rows",function() {
var mainContent = $("#objectViewer");
mainContent.on('click', ".obstacleEnvProperties", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
var obstacle = JSON.parse($.session.get("Obstacle"));
var name = $(this).text();
$.session.set("ObstacleEnvName", name);
- emptyGoalEnvTables();
-
+ clearObstacleEnvironmentPanel();
$.each(obstacle.theEnvironmentProperties, function (index, env) {
if(env.theEnvironmentName == name){
$("#theDefinition").val(env.theDefinition);
diff --git a/cairis/web/dist/js/cairis/personas.js b/cairis/web/dist/js/cairis/personas.js
index 547e9e273..f6a6c5d2f 100644
--- a/cairis/web/dist/js/cairis/personas.js
+++ b/cairis/web/dist/js/cairis/personas.js
@@ -158,6 +158,7 @@ function viewPersona(personaName) {
var mainContent = $("#objectViewer");
mainContent.on("click",".personaEnvironment", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
clearPersonaEnvInfo();
var persona = JSON.parse($.session.get("Persona"));
var theEnvName = $(this).text();
diff --git a/cairis/web/dist/js/cairis/projectSettings.js b/cairis/web/dist/js/cairis/projectSettings.js
index 7f473a89a..5d53df605 100644
--- a/cairis/web/dist/js/cairis/projectSettings.js
+++ b/cairis/web/dist/js/cairis/projectSettings.js
@@ -331,10 +331,10 @@ function postProjectImage(imagedir, actualDir) {
}
function appendNamingConvention(name,def){
- $("#editNamingConventionsTable").find("tbody").append(" | " + name + " | "+ def + " |
");
+ $("#editNamingConventionsTable").find("tbody").append(" | " + name + " | "+ def + " |
");
}
function appendContributor(con){
- $("#editContributorTable").find("tbody").append(" | " + con.firstName + " | "+ con.surname + " | "+ con.affiliation + " | "+ con.role +" |
");
+ $("#editContributorTable").find("tbody").append(" | " + con.firstName + " | "+ con.surname + " | "+ con.affiliation + " | "+ con.role +" |
");
}
function editProjectRevisions(rev){
diff --git a/cairis/web/dist/js/cairis/responses.js b/cairis/web/dist/js/cairis/responses.js
index 77359ef75..7a408fc87 100644
--- a/cairis/web/dist/js/cairis/responses.js
+++ b/cairis/web/dist/js/cairis/responses.js
@@ -267,6 +267,7 @@ mainContent.on('click', ".deleteRespEnv", function () {
mainContent.on('click', ".responseEnvironment", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
var type = $.session.get("responseKind");
var resp = JSON.parse($.session.get("response"));
var environmentName = $(this).text();
diff --git a/cairis/web/dist/js/cairis/risks.js b/cairis/web/dist/js/cairis/risks.js
index 49752d6a3..eb1611cb5 100644
--- a/cairis/web/dist/js/cairis/risks.js
+++ b/cairis/web/dist/js/cairis/risks.js
@@ -163,6 +163,7 @@ mainContent.on('click', "#cancelMisuseCase", function (e) {
});
mainContent.on("click",".misusecaseEnvironment", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
clearMisuseCaseInfo();
var misusecase = JSON.parse($.session.get("MisuseCase"));
@@ -293,6 +294,7 @@ $(document).on('click','#addNewRisk', function() {
});
mainContent.on('click', '.riskEnvironment', function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
var env = $(this).text();
var name = $("#theName").val();
getRiskEnvironmentDetails(name, env);
@@ -317,7 +319,6 @@ function getRiskEnvironments(){
success: function (data) {
$('#theRiskEnvironments').find('tbody').empty();
if (data.length > 0) {
- $('#theRiskRatingDiv').show();
$('#theRiskEnvironmentDiv').show();
$.each(data, function (index, object) {
appendRiskEnvironment(object);
@@ -325,7 +326,6 @@ function getRiskEnvironments(){
$('#theRiskEnvironments').find('tbody').find('.riskEnvironment:first').click();
}
else {
- $('#theRiskRatingDiv').hide();
$('#theRiskEnvironmentDiv').hide();
}
},
diff --git a/cairis/web/dist/js/cairis/roles.js b/cairis/web/dist/js/cairis/roles.js
index af1a8ed7f..e152c859f 100644
--- a/cairis/web/dist/js/cairis/roles.js
+++ b/cairis/web/dist/js/cairis/roles.js
@@ -121,6 +121,7 @@ function viewRole(roleName) {
$("#theEnvironments").find("tbody").append("" + value.theEnvironmentName + " |
");
});
$.session.set("RoleEnvironments", JSON.stringify(json))
+ $("#theEnvironments").find("tbody").find(".roleEnvironmentClick:first").trigger('click');
},
error: function (xhr, textStatus, errorThrown) {
var error = JSON.parse(xhr.responseText);
@@ -212,6 +213,7 @@ $(document).on('click',"td.deleteRoleButton",function(event){
mainContent.on("click", '.roleEnvironmentClick', function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
$("#theCounterMeasures").find('tbody').empty();
$("#theResponses").find('tbody').empty();
var text = $(this).text();
diff --git a/cairis/web/dist/js/cairis/securitypatterns.js b/cairis/web/dist/js/cairis/securitypatterns.js
index 4fa3c026e..68ad4916e 100644
--- a/cairis/web/dist/js/cairis/securitypatterns.js
+++ b/cairis/web/dist/js/cairis/securitypatterns.js
@@ -20,10 +20,12 @@
'use strict';
$("#securityPatternsClick").click(function () {
- clearLocalStorage($('#menuBCClick').attr('dimension'));
- $("#objectViewer").empty();
- $('#menuBCClick').attr('dimension','security_pattern');
- refreshMenuBreadCrumb('security_pattern');
+ validateClick('template_asset',function() {
+ clearLocalStorage($('#menuBCClick').attr('dimension'));
+ $("#objectViewer").empty();
+ $('#menuBCClick').attr('dimension','security_pattern');
+ refreshMenuBreadCrumb('security_pattern');
+ });
});
function createSecurityPatternsTable(){
diff --git a/cairis/web/dist/js/cairis/taskcharacteristics.js b/cairis/web/dist/js/cairis/taskcharacteristics.js
index c9ad6ca99..4f51e2c46 100644
--- a/cairis/web/dist/js/cairis/taskcharacteristics.js
+++ b/cairis/web/dist/js/cairis/taskcharacteristics.js
@@ -330,9 +330,9 @@ function loadTaskCharacteristicReference() {
$('#theTCArtifactTypeDiv').show();
var cr = $("#editTaskCharacteristicReference").data("currentcr");
if (cr != undefined) {
+ var cr = JSON.parse(cr);
$('#theTCArtifactType').val(cr.dimension);
refreshDimensionSelector($('#theTCReferenceName'),cr.dimension + '_reference',undefined,function() {
- var cr = JSON.parse(cr);
$("#theTCReferenceName").val(cr.name);
$("#theTCDescription").val(cr.description);
});
@@ -398,10 +398,11 @@ function updateTaskReferenceList(e) {
var cr = JSON.parse($("#editTaskCharacteristicReference").data("currentcr"));
var item = jQuery.extend(true, {},characteristicReferenceDefault );
item.theReferenceName = $("#theTCReferenceName").val();
- item.theReferenceDescription = $("#theTCReferenceDescription").val();
+ item.theDimensionName = $('#theTCArtifactType').val();
+ item.theReferenceDescription = $("#theTCDescription").val();
$(cr.tableId).find("tbody").find('tr:eq(' + cr.index + ')').find('td:eq(1)').text(item.theReferenceName);
- $(cr.tableId).find("tbody").find('tr:eq(' + cr.index + ')').find('td:eq(2)').text(item.theReferenceDescription);
- item.theDimensionName = $('#theTCReferenceArtifactType').val();
+ $(cr.tableId).find("tbody").find('tr:eq(' + cr.index + ')').find('td:eq(2)').text(item.theDimensionName);
+ $(cr.tableId).find("tbody").find('tr:eq(' + cr.index + ')').find('td:eq(3)').text(item.theReferenceDescription);
var tc = JSON.parse($.session.get("TaskCharacteristic"));
if (cr.tableId == '#theGrounds') {
diff --git a/cairis/web/dist/js/cairis/tasks.js b/cairis/web/dist/js/cairis/tasks.js
index 8a3f10b96..5a2450bb1 100644
--- a/cairis/web/dist/js/cairis/tasks.js
+++ b/cairis/web/dist/js/cairis/tasks.js
@@ -168,10 +168,8 @@ function viewTask(taskName) {
$.each(data.theEnvironmentProperties, function (index, env) {
appendTaskEnvironment(env.theEnvironmentName);
});
- fillTaskEnvInfo(data.theEnvironmentProperties[0]);
+ $("#theEnvironments").find("tbody").find(".taskEnvironment:first").trigger('click');
$("#editTaskOptionsForm").validator('update');
- $('#tasktabsID').show('fast');
- $.session.set("taskEnvironmentName", data.theEnvironmentProperties[0].theEnvironmentName);
});
},
error: function (xhr, textStatus, errorThrown) {
@@ -206,22 +204,9 @@ function fillTaskEnvInfo(env) {
var mainContent = $("#objectViewer");
mainContent.on("click",".taskEnvironment", function () {
- var lastEnvName = $.session.get("taskEnvironmentName");
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
+ updateTaskEnvInfo();
var task = JSON.parse($.session.get("Task"));
- var updatedEnvProps = [];
- $.each(task.theEnvironmentProperties, function (index, env) {
- if(env.theEnvironmentName == lastEnvName){
- env.theDependencies = $('#theDependencies').val();
- env.theNarrative = $('#theNarrative').val();
- env.theConsequences = $('#theConsequences').val();
- env.theBenefits = $('#theBenefits').val();
- }
- updatedEnvProps.push(env);
- });
- task.theEnvironmentProperties = updatedEnvProps;
- $.session.set("Task", JSON.stringify(task));
- task = JSON.parse($.session.get("Task"));
-
var envName = $(this).text();
$.session.set("taskEnvironmentName", envName);
$.each(task.theEnvironmentProperties, function (index, env) {
@@ -231,6 +216,23 @@ mainContent.on("click",".taskEnvironment", function () {
});
});
+function updateTaskEnvInfo() {
+ var lastEnvName = $.session.get("taskEnvironmentName");
+ if (lastEnvName != undefined) {
+ var task = JSON.parse($.session.get("Task"));
+ var updatedEnvProps = [];
+ $.each(task.theEnvironmentProperties, function (index, env) {
+ if(env.theEnvironmentName == lastEnvName){
+ env.theDependencies = $('#theDependencies').val();
+ env.theNarrative = $('#theNarrative').val();
+ env.theConsequences = $('#theConsequences').val();
+ env.theBenefits = $('#theBenefits').val();
+ $.session.set("Task", JSON.stringify(task));
+ }
+ });
+ }
+}
+
function clearTaskEnvInfo(){
$("#theDependencies").val('');
$("#theNarrative").val('');
@@ -429,10 +431,10 @@ mainContent.on('click', ".deleteTaskEnv", function () {
var UIenv = $("#theTaskEnvironments").find("tbody");
if(jQuery(UIenv).has(".taskEnvironment").length){
UIenv.find(".taskEnvironment:first").trigger('click');
- }else{
+ }
+ else {
$("#tasktabsID").hide("fast");
}
-
return false;
}
});
diff --git a/cairis/web/dist/js/cairis/templaterequirements.js b/cairis/web/dist/js/cairis/templaterequirements.js
index 51587e51a..45bd3cadb 100644
--- a/cairis/web/dist/js/cairis/templaterequirements.js
+++ b/cairis/web/dist/js/cairis/templaterequirements.js
@@ -127,7 +127,6 @@ function viewTemplateRequirement(trName) {
debugLogger("error: " + xhr.responseText + ", textstatus: " + textStatus + ", thrown: " + errorThrown);
}
});
- $('#editTemplateRequirementOptionsForm').validator();
$('#theName').val(data.theName);
$('#theTemplateAssetName').val(data.theAssetName);
$('#theType').val(data.theType);
@@ -136,6 +135,7 @@ function viewTemplateRequirement(trName) {
$('#theFitCriterion').val(data.theFitCriterion);
$.session.set("TemplateRequirement", JSON.stringify(data));
$('#editTemplateRequirementOptionsDorm').loadJSON(data,null);
+ $('#editTemplateRequirementOptionsForm').validator('update');
});
},
error: function (xhr, textStatus, errorThrown) {
@@ -160,6 +160,7 @@ $(document).on('click', "#addTemplateRequirement",function(){
crossDomain: true,
url: serverIP + "/api/dimensions/table/template_asset",
success: function (tas) {
+ $('#editTemplateRequirementOptionsForm').validator();
$("#UpdateTemplateRequirement").text("Create");
$("#theTemplateAssetName option").remove();
$.each(tas,function(idx,ta) {
diff --git a/cairis/web/dist/js/cairis/threats.js b/cairis/web/dist/js/cairis/threats.js
index 88de38a11..352b40474 100644
--- a/cairis/web/dist/js/cairis/threats.js
+++ b/cairis/web/dist/js/cairis/threats.js
@@ -167,6 +167,7 @@ $(document).on("click","#introduceThreatDirectoryEntry", function() {
});
mainContent.on("click", ".threatEnvironments", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
clearThreatEnvInfo();
var threat = JSON.parse($.session.get("theThreat"));
var envName = $(this).text();
diff --git a/cairis/web/dist/js/cairis/trustboundaries.js b/cairis/web/dist/js/cairis/trustboundaries.js
index d16277afa..87ee512d6 100644
--- a/cairis/web/dist/js/cairis/trustboundaries.js
+++ b/cairis/web/dist/js/cairis/trustboundaries.js
@@ -90,7 +90,6 @@ $(document).on('click', "td.trustboundary-rows", function(){
$.session.set("TrustBoundary", JSON.stringify(tb));
fillOptionMenu("fastTemplates/editTrustBoundaryOptions.html","#objectViewer",null,true,true, function(){
- $('#editTrustBoundaryOptionsForm').validator();
$('#UpdateTrustBoundary').text("Update");
$('#theTrustBoundaryName').val(tb.theName);
$('#theTrustBoundaryDescription').val(tb.theDescription);
@@ -99,6 +98,7 @@ $(document).on('click', "td.trustboundary-rows", function(){
appendTrustBoundaryEnvironment(envprop.theName);
});
$("#theTrustBoundaryEnvironments").find(".trustBoundaryEnvironmentProperties:first").trigger('click');
+ $('#editTrustBoundaryOptionsForm').validator('update');
$.session.set("TrustBoundaryEnvironmentName", $("#theTrustBoundaryEnvironments").find(".trustBoundaryEnvironmentProperties:first").text());
});
});
@@ -283,6 +283,7 @@ mainContent.on('click', '.deleteTrustBoundaryEnvironment', function () {
});
mainContent.on("click", ".trustBoundaryEnvironmentProperties", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
var name = $(this).text();
$.session.set("TrustBoundaryEnvironmentName", name);
$("#theTrustBoundaryComponents").find("tbody").empty();
@@ -383,9 +384,9 @@ mainContent.on('click', ".removeTrustBoundaryComponent", function () {
var envName = $.session.get("TrustBoundaryEnvironmentName");
$.each(tb.theEnvironmentProperties, function (index, env) {
- if(env.theEnvironmentName == envName){
+ if(env.theName == envName){
$.each(env.theComponents, function (index2, comp) {
- if(comp.theName == compText){
+ if(comp.theName == compTxt){
env.theComponents.splice( index2 ,1 );
$.session.set("TrustBoundary", JSON.stringify(tb));
compRow.remove();
diff --git a/cairis/web/dist/js/cairis/usecases.js b/cairis/web/dist/js/cairis/usecases.js
index 6fda5c4c1..a479f4c4f 100644
--- a/cairis/web/dist/js/cairis/usecases.js
+++ b/cairis/web/dist/js/cairis/usecases.js
@@ -162,7 +162,8 @@ function viewUseCase(ucName) {
var mainContent = $("#objectViewer");
mainContent.on("click",".usecaseEnvironment", function () {
- clearUseCaseEnvInfo();
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
+ updateUseCaseEnvInfo();
var usecase = JSON.parse($.session.get("UseCase"));
var theEnvName = $(this).text();
$.session.set("usecaseEnvironmentName", theEnvName);
@@ -231,12 +232,29 @@ function generateObstacleFromException(exceptionIdx) {
});
}
-function clearUseCaseEnvInfo(){
+function updateUseCaseEnvInfo(){
+ var usecase = JSON.parse($.session.get("UseCase"));
+ var theEnvName = $(this).text();
+ var theEnvName = $.session.get("usecaseEnvironmentName");
+ if (theEnvName != undefined) {
+ $.each(usecase.theEnvironmentProperties, function (index, env) {
+ if(env.theEnvironmentName == theEnvName){
+ env.thePreCond = $('#thePreCond').val();
+ env.thePostCond = $('#thePostCond').val();
+ $.session.set("UseCase", JSON.stringify(usecase));
+ }
+ });
+ }
+ clearUseCaseEnvInfo();
+}
+
+function clearUseCaseEnvInfo() {
$("#thePreCond").val('');
$("#thePostCond").val('');
$("#theSteps").find("tbody").empty();
$("#theExceptions").find("tbody").empty();
$("#theExceptions").hide();
+
}
function appendUseCaseEnvironment(environment){
@@ -244,7 +262,7 @@ function appendUseCaseEnvironment(environment){
}
function appendUseCaseStep(stepTxt) {
- $("#theSteps").find("tbody").append(' | ' + stepTxt + ' |
').animate('slow');
+ $("#theSteps").find("tbody").append(' | ' + stepTxt + ' |
').animate('slow');
}
function appendUseCaseActor(actor) {
@@ -281,7 +299,7 @@ mainContent.on('change','#theActorType',function() {
refreshDimensionSelector($('#theGRLActor'),$('#theActorType').val(),envName,undefined,['All']);
});
-mainContent.on('dblclick','.clickable-row',function() {
+mainContent.on('dblclick','.usecase-step',function() {
$('#AddStepButton').text('Update');
var stepIdx = $(this).closest('tr').index();
$('#useCaseStepDialog').attr('data-selectedIndex',stepIdx);
@@ -592,7 +610,7 @@ function postUseCase(usecase, callback){
});
}
-mainContent.on("click",".clickable-row", function () {
+mainContent.on("click",".usecase-step", function () {
if($(this).hasClass('active')){
$(this).removeClass('active');
$("#theExceptions").hide();
diff --git a/cairis/web/dist/js/cairis/vulnerabilities.js b/cairis/web/dist/js/cairis/vulnerabilities.js
index 393a7d75c..ee5f4a3ab 100644
--- a/cairis/web/dist/js/cairis/vulnerabilities.js
+++ b/cairis/web/dist/js/cairis/vulnerabilities.js
@@ -196,6 +196,8 @@ mainContent.on('click', '.deleteVulEnv', function () {
});
mainContent.on("click", ".vulEnvProperties", function () {
+ $(this).closest('tr').addClass('active').siblings().removeClass('active');
+ updateVulnerabilityEnvironment();
var name = $(this).text();
$.session.set("VulnEnvironmentName", name);
$("#vulnEnvAssets").find("tbody").empty();
@@ -216,6 +218,19 @@ mainContent.on("click", ".vulEnvProperties", function () {
})
});
+function updateVulnerabilityEnvironment() {
+ var envName = $.session.get("VulnEnvironmentName");
+ if (envName != undefined) {
+ var vul = JSON.parse($.session.get("Vulnerability"));
+ $.each(vul.theEnvironmentProperties, function (index, env) {
+ if(env.theEnvironmentName == envName){
+ env.theSeverity = $("#theSeverity").val();
+ $.session.set("Vulnerability", JSON.stringify(vul));
+ }
+ });
+ }
+}
+
mainContent.on("click", "#addAssetToEnvFromVuln", function () {
var filterList = [];
$(".removeVulnEnvAsset").next("td").each(function (index, tag) {
diff --git a/cairis/web/fastTemplates/AssetOptions.html b/cairis/web/fastTemplates/AssetOptions.html
index 30880f0a8..b4b3bd5dd 100644
--- a/cairis/web/fastTemplates/AssetOptions.html
+++ b/cairis/web/fastTemplates/AssetOptions.html
@@ -12,7 +12,7 @@