* Finish task #118422.

This commit is contained in:
daitingting
2024-05-24 03:09:09 +00:00
parent 491cdc6fc1
commit 4cf2d4e80a
4 changed files with 24 additions and 1 deletions
+3
View File
@@ -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();
+13
View File
@@ -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');
})
+2 -1
View File
@@ -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))
);
};