* Adjust the duplicate toggle and picker.
This commit is contained in:
@@ -36,10 +36,11 @@ window.renderRowData = function($row, index, row)
|
||||
}
|
||||
|
||||
/* Show the bugs of current bug's product. */
|
||||
if(productBugList[row.product] != undefined && productBugList[row.product][row.branch] != undefined)
|
||||
if(productBugOptions[row.product] != undefined && productBugOptions[row.product][row.branch] != undefined)
|
||||
{
|
||||
let duplicateBugs = productBugList[row.product][row.branch];
|
||||
$row.find('[data-name="duplicateBug"]').find('.picker-box').on('inited', function(e, info)
|
||||
let duplicateBugs = productBugOptions[row.product][row.branch];
|
||||
|
||||
$row.find('[data-name="resolutionBox"]').find('.input-group').find('.duplicate-select').on('inited', function(e, info)
|
||||
{
|
||||
let $duplicateBug = info[0];
|
||||
$duplicateBug.render({items: duplicateBugs});
|
||||
@@ -91,12 +92,6 @@ function setDuplicate(event)
|
||||
const $target = $(event.target);
|
||||
const $currentRow = $target.closest('tr');
|
||||
const resolution = $target.val();
|
||||
if(resolution == 'duplicate')
|
||||
{
|
||||
$currentRow.find('.form-batch-input[data-name="duplicateBug"]').removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$currentRow.find('.form-batch-input[data-name="duplicateBug"]').addClass('hidden');
|
||||
}
|
||||
|
||||
$currentRow.find('[data-name="duplicate"]').toggleClass('hidden', resolution != 'duplicate');
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ jsVar('tab', $app->tab);
|
||||
jsVar('modules', $modules);
|
||||
jsVar('products', $products);
|
||||
jsVar('branchTagOption', $branchTagOption);
|
||||
jsVar('productBugList', $productBugList);
|
||||
jsVar('productBugOptions', $productBugOptions);
|
||||
jsVar('executionMembers', isset($executionMembers) ? $executionMembers : array());
|
||||
jsVar('projectMembers', isset($projectMembers) ? $projectMembers : array());
|
||||
jsVar('productMembers', isset($productMembers) ? $productMembers : array());
|
||||
@@ -194,8 +194,8 @@ formBatchPanel
|
||||
formBatchItem
|
||||
(
|
||||
set::label($lang->bug->resolution),
|
||||
set::width('200px'),
|
||||
set::name(''),
|
||||
set::width('220px'),
|
||||
set::name('resolutionBox'),
|
||||
set::control('inputGroup'),
|
||||
inputGroup
|
||||
(
|
||||
@@ -207,7 +207,7 @@ formBatchPanel
|
||||
),
|
||||
picker
|
||||
(
|
||||
setClass('hidden'),
|
||||
setClass('duplicate-select hidden'),
|
||||
set::name('duplicate'),
|
||||
set::items(array()),
|
||||
set::placeholder($lang->bug->placeholder->duplicate),
|
||||
|
||||
+20
-6
@@ -1662,12 +1662,26 @@ class bugZen extends bug
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->branchProduct = $branchProduct;
|
||||
$this->view->modules = $bugModules;
|
||||
$this->view->productBugList = $productBugList;
|
||||
$this->view->branchTagOption = $branchOptions;
|
||||
$this->view->products = $products;
|
||||
$productBugOptions = array();
|
||||
foreach($productBugList as $productID => $productBugs)
|
||||
{
|
||||
$productBugOptions[$productID] = array();
|
||||
foreach($productBugs as $branchID => $branchBugs)
|
||||
{
|
||||
$productBugOptions[$productID][$branchID] = array();
|
||||
foreach($branchBugs as $bugID => $bugTitle)
|
||||
{
|
||||
$productBugOptions[$productID][$branchID][] = array('text' => $bugTitle, 'value' => $bugID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->branchProduct = $branchProduct;
|
||||
$this->view->modules = $bugModules;
|
||||
$this->view->productBugOptions = $productBugOptions;
|
||||
$this->view->branchTagOption = $branchOptions;
|
||||
$this->view->products = $products;
|
||||
|
||||
return $branchTagOption;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user