* Finish task #118422.
This commit is contained in:
@@ -9,6 +9,9 @@ $config->metric->orMetricList = array('count_of_assigned_demand_in_user');
|
||||
|
||||
$config->metric->maxSelectNum = 10;
|
||||
|
||||
$config->metric->collapseList = array('codebase', 'pipeline', 'artifact', 'deployment', 'node', 'application', 'cpu', 'memory', 'commit', 'mergeRequest', 'code', 'vulnerability', 'codeAnalysis');
|
||||
if(in_array($config->edition, array('max', 'ipd'))) $config->metric->collapseList = array_merge($config->metric->collapseList, array('risk', 'issue'));
|
||||
|
||||
global $lang;
|
||||
$this->loadLang('metric');
|
||||
$config->metric->actionList = array();
|
||||
|
||||
@@ -743,3 +743,16 @@ window.toggleSearchBtn = function(active = null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.collapseFilters = function()
|
||||
{
|
||||
$('.collapse-icon').toggleClass('icon-chevron-double-up');
|
||||
$('.collapse-icon').toggleClass('icon-chevron-double-down');
|
||||
|
||||
$('[data-collapse=true]').parent('.checkbox-primary').toggleClass('hidden');
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('[data-collapse=true]').parent('.checkbox-primary').addClass('hidden');
|
||||
})
|
||||
|
||||
@@ -1601,7 +1601,8 @@ class metricModel extends model
|
||||
foreach($this->lang->metric->objectList as $value => $text)
|
||||
{
|
||||
$isChecked = (isset($filters['object']) and in_array($value, $filters['object']));
|
||||
$objectItems[] = array('text' => $text, 'value' => $value, 'onchange' => $onchange, 'checked' => $isChecked);
|
||||
$collapse = in_array($value, $this->config->metric->collapseList) && !$isChecked;
|
||||
$objectItems[] = array('text' => $text, 'value' => $value, 'onchange' => $onchange, 'checked' => $isChecked, 'data-collapse' => $collapse);
|
||||
}
|
||||
$filterItems['object'] = array
|
||||
(
|
||||
|
||||
@@ -34,6 +34,12 @@ $fnGenerateFilterBlock = function($code, $filterItem) use($lang)
|
||||
set::inline(true),
|
||||
set::items($items)
|
||||
),
|
||||
$code == 'object' ? icon
|
||||
(
|
||||
'chevron-double-down',
|
||||
setClass('pull-right collapse-icon'),
|
||||
on::click('collapseFilters')
|
||||
) : null,
|
||||
set::headingActions(array($removeAction))
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user