* Fix create a build product drop-down range.
This commit is contained in:
@@ -57,7 +57,7 @@ class build extends control
|
||||
|
||||
$message = $this->executeHooks($buildID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
return $this->sendSuccess(array('locate' => $this->createLink('build', 'view', "buildID=$buildID") . "#app={$this->app->tab}", 'id' => $buildID));
|
||||
return $this->sendSuccess(array('load' => $this->createLink('build', 'view', "buildID=$buildID"), 'id' => $buildID));
|
||||
}
|
||||
|
||||
$status = empty($this->config->CRProduct) ? 'noclosed' : '';
|
||||
|
||||
@@ -62,6 +62,7 @@ $().ready(function()
|
||||
}
|
||||
});
|
||||
loadBranches();
|
||||
loadProducts();
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -74,20 +75,19 @@ $().ready(function()
|
||||
function loadProducts(executionID)
|
||||
{
|
||||
executionID = parseInt(executionID);
|
||||
if(!executionID) executionID = $('input[name=execution]').val();
|
||||
$.get($.createLink('product', 'ajaxGetProducts', 'executionID=' + executionID), function(data)
|
||||
if(!executionID) executionID = $(document).find('[name=execution]').val();
|
||||
|
||||
$.getJSON($.createLink('product', 'ajaxGetProducts', 'executionID=' + executionID), function(data)
|
||||
{
|
||||
const $product = $('input[name=product]');
|
||||
const $productPicker = $product.zui('picker');
|
||||
const productID = data.length ? data[0].value : 0;
|
||||
$productPicker.render({items: data});
|
||||
$productPicker.$.setValue(productID);
|
||||
|
||||
if(data)
|
||||
{
|
||||
data = JSON.parse(data);
|
||||
const $product = $('input[name=product]');
|
||||
const $productPicker = $product.zui('picker');
|
||||
const productID = data[0].value;
|
||||
$productPicker.render({items: data});
|
||||
$productPicker.$.setValue(productID);
|
||||
|
||||
$('#builds').attr('data-placeholder', multipleSelect);
|
||||
|
||||
loadBranches(productID);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -433,9 +433,9 @@ class buildModel extends model
|
||||
*
|
||||
* @param object $build
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return int|false
|
||||
*/
|
||||
public function create(object $build): bool
|
||||
public function create(object $build): int|false
|
||||
{
|
||||
/* Integrated version merging branch. */
|
||||
if($this->post->isIntegrated == 'yes')
|
||||
|
||||
@@ -68,8 +68,8 @@ if(!$hidden)
|
||||
set::value(empty($product) ? '' : $product->id),
|
||||
set::items($products),
|
||||
set::required(true),
|
||||
on::change('loadBranches'),
|
||||
on::change('loadArtifactrepo'),
|
||||
on::change('loadBranches')
|
||||
// on::change('loadArtifactrepo'),
|
||||
);
|
||||
|
||||
$artifactRepoRow[] = formRow
|
||||
@@ -106,9 +106,9 @@ if(!$hidden)
|
||||
{
|
||||
$productBox = formGroup(
|
||||
set::width('1/2'),
|
||||
setClass('items-center'),
|
||||
set::id('productBox'),
|
||||
set::label($lang->build->product),
|
||||
setClass('items-center'),
|
||||
html(sprintf($lang->build->noProduct, helper::createLink('execution', 'manageproducts', "executionID={$executionID}", '', true), $app->tab)),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user