Files
2023-10-10 11:25:56 +08:00

52 lines
1.3 KiB
JavaScript
Executable File

/**
* Load execution related builds
*
* @access public
* @return void
*/
function loadProductRelated()
{
loadExecutions($('#product').val());
loadTestReports($('#product').val());
loadExecutionBuilds($('#execution').val())
}
/**
* Load executions.
*
* @param int productID
* @access public
* @return void
*/
function loadExecutions(productID)
{
var executionID = $('#execution').val();
link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID + '&branch=');
$.get(link, function(data)
{
if(!data) data = '<select id="execution" name="execution" class="form-control"></select>';
$('#execution').replaceWith(data);
$('#execution_chosen').remove();
$("#execution").val(executionID);
$("#execution").chosen();
});
}
$('#mainContent').on('change', '#build', function()
{
var buildID = $(this).val();
link = createLink('testtask', 'ajaxGetExecutionByBuild', 'buildID=' + buildID);
$.get(link, function(data)
{
$('#execution').val(data);
$("#execution").trigger("chosen:updated");
});
})
/* If the mouse hover over the manage contacts button, give tip. */
$(function()
{
adjustPriBoxWidth();
if($('#execution').val() != 0 && multiple) loadExecutionBuilds($('#execution').val());
});