-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Traceability relations removable from web app and filtering out task_…
…asset for removable traces list
- Loading branch information
Shamal Faily
committed
Jan 4, 2017
1 parent
e5f9987
commit bf4fc4d
Showing
20 changed files
with
157 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
Authors: Shamal Faily */ | ||
|
||
'use strict'; | ||
|
||
$("#traceabilityClick").click(function(){ | ||
activeElement("objectViewer"); | ||
$('#filtercontent').hide(); | ||
$.ajax({ | ||
type: "GET", | ||
dataType: "json", | ||
accept: "application/json", | ||
data: { | ||
session_id: String($.session.get('sessionID')) | ||
}, | ||
crossDomain: true, | ||
url: serverIP + "/api/dimensions/table/environment", | ||
success: function (envs) { | ||
fillOptionMenu("fastTemplates/editTraceabilityOptions.html", "#objectViewer", null, true, true, function () { | ||
$('#theEnvironmentName option').remove(); | ||
$.each(envs, function(idx,env) { | ||
$('#theEnvironmentName').append($("<option></option>").attr("value",env).text(env)); | ||
}); | ||
}); | ||
$('#theEnvironmentName').val(envs[0]); | ||
$('#theEnvironmentName').trigger('change'); | ||
}, | ||
error: function (xhr, textStatus, errorThrown) { | ||
debugLogger(String(this.url)); | ||
debugLogger("error: " + xhr.responseText + ", textstatus: " + textStatus + ", thrown: " + errorThrown); | ||
} | ||
}) | ||
}); | ||
|
||
var mainContent = $('#objectViewer'); | ||
mainContent.on("change",'#theEnvironmentName',function() { | ||
var envName = $('#theEnvironmentName').val(); | ||
$.ajax({ | ||
type: "GET", | ||
dataType: "json", | ||
accept: "application/json", | ||
data: { | ||
session_id: String($.session.get('sessionID')) | ||
}, | ||
crossDomain: true, | ||
url: serverIP + "/api/traces/environment/" + encodeURIComponent(envName), | ||
success: function (trs) { | ||
$('#theTraces').find('tbody').empty(); | ||
$.each(trs, function(idx,t) { | ||
appendTrace(t); | ||
}); | ||
}, | ||
error: function (xhr, textStatus, errorThrown) { | ||
debugLogger(String(this.url)); | ||
debugLogger("error: " + xhr.responseText + ", textstatus: " + textStatus + ", thrown: " + errorThrown); | ||
} | ||
}) | ||
}); | ||
|
||
function appendTrace(t) { | ||
$("#theTraces").find("tbody").append('<tr><td class="deleteTrace"><i class="fa fa-minus"></i></td><td class="trace-rows">'+ t.theFromObject + '</td><td>' + t.theFromName + '</td><td>' + t.theToObject + '</td><td>' + t.theToName +'</td></tr>'); | ||
}; | ||
|
||
mainContent.on('click','td.deleteTrace',function() { | ||
var tRow = $(this).closest("tr"); | ||
var fromObjt = tRow.find("td:eq(1)").text(); | ||
var fromName = tRow.find("td:eq(2)").text(); | ||
var toObjt = tRow.find("td:eq(3)").text(); | ||
var toName = tRow.find("td:eq(4)").text(); | ||
|
||
$.ajax({ | ||
type: "DELETE", | ||
dataType: "json", | ||
contentType: "application/json", | ||
accept: "application/json", | ||
crossDomain: true, | ||
processData: false, | ||
origin: serverIP, | ||
url: serverIP + "/api/traces/from_type/" + encodeURIComponent(fromObjt) + "/from_name/" + encodeURIComponent(fromName) + "/to_type/" + encodeURIComponent(toObjt) + "/to_name/" + encodeURIComponent(toName) + "?session_id=" + $.session.get('sessionID'), | ||
success: function (data) { | ||
tRow.remove(); | ||
showPopup(true); | ||
}, | ||
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); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<form role="form" id="editTraceabilityOptionsForm" xmlns="http://www.w3.org/1999/html" > | ||
<div class="panel panel-default control-group form-group"> | ||
<div class="form-group"> | ||
<label for="theEnvironmentName" class="control-label">Name</label> | ||
<select class="optionsInput form-control" name="theEnvironmentName" id="theEnvironmentName" style="width: 100%;"> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<table class="clickable-table scrollableTable" id="theTraces"> | ||
<thead> | ||
<tr><th style="width: 15px;"></th><th>From</th><th>Name</th><th>To</th><th>Name</th></tr> | ||
</thead> | ||
<tbody> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters