This commit is contained in:
d-buchmann 2026-05-02 09:11:17 +08:00 committed by GitHub
commit 187fbee94b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 59 additions and 0 deletions

View file

@ -101,10 +101,38 @@ class ToolsTreeBuilder
});
}
protected function getFilterNode(): array
{
$nodes = [];
if ($this->security->isGranted('@parts.read')) {
$nodes[] = (new TreeViewNode(
$this->translator->trans('filter.less_than_desired'),
$this->urlGenerator->generate('parts_filter_less_than_desired')
))->setIcon("fa-treeview fa-fw fa-solid fa-circle-exclamation");
}
if ($this->security->isGranted('@parts.read')) {
$nodes[] = (new TreeViewNode(
$this->translator->trans('filter.custom'),
$this->urlGenerator->generate('parts_filter_custom')
))->setIcon("fa-treeview fa-fw fa-solid fa-code");
}
return $nodes;
}
protected function getToolsNode(): array
{
$nodes = [];
if ($this->security->isGranted('@parts.read')) {
$nodes[] = (new TreeViewNode(
$this->translator->trans('filter.title'),
null,
$this->getFilterNode()
))->setIcon("fa-fw fa-treeview fa-solid fa-filter");
}
if ($this->security->isGranted('@labels.create_labels')) {
$nodes[] = (new TreeViewNode(
$this->translator->trans('tree.tools.tools.label_dialog'),