diff --git a/lib/zin/wg/tabpane/v1.php b/lib/zin/wg/tabpane/v1.php index bb1b0de2be..f721305406 100644 --- a/lib/zin/wg/tabpane/v1.php +++ b/lib/zin/wg/tabpane/v1.php @@ -8,7 +8,7 @@ class tabPane extends wg 'key: string', 'title: string', 'active?: bool=false', - 'param: string', + 'param?: string', ); protected static array $defineBlocks = array( diff --git a/lib/zin/wg/tree/v1.php b/lib/zin/wg/tree/v1.php index 49f205a9f2..3a658135f5 100644 --- a/lib/zin/wg/tree/v1.php +++ b/lib/zin/wg/tree/v1.php @@ -13,6 +13,7 @@ class tree extends wg 'canUpdateOrder?: bool=false', 'canEdit?: bool=false', 'canDelete?: bool=false', + 'canSplit?: bool=true', ); public static function getPageJS(): string|false @@ -31,6 +32,7 @@ class tree extends wg $canUpdateOrder = $this->prop('canUpdateOrder'); $canEdit = $this->prop('canEdit'); $canDelete = $this->prop('canDelete'); + $canSplit = $this->prop('canSplit'); $editType = $this->prop('type'); foreach($items as $key => $item) @@ -48,7 +50,7 @@ class tree extends wg if($canEdit) $treeItem['actions']['items'][] = array('key' => 'edit', 'icon' => 'edit', 'id' => $item['id'], 'editType' => $editType, 'onClick' => jsRaw('(event, item) => window.editItem(item)')); if($canDelete) $treeItem['actions']['items'][] = array('key' => 'delete', 'icon' => 'trash', 'id' => $item['id'], 'className' => 'btn ghost toolbar-item square size-sm rounded ajax-submit','url' => helper::createLink('tree', 'delete', 'module=' . $item['id'])); - $treeItem['actions']['items'][] = array('key' => 'view', 'icon' => 'split', 'url' => $item['url']); + if($canSplit) $treeItem['actions']['items'][] = array('key' => 'view', 'icon' => 'split', 'url' => $item['url']); } if(isset($item['children'])) $treeItem['items'] = $this->buildTree($item['children']); diff --git a/module/mr/js/diff.ui.js b/module/mr/js/diff.ui.js index 158aeba60e..9a1c462a5e 100644 --- a/module/mr/js/diff.ui.js +++ b/module/mr/js/diff.ui.js @@ -153,9 +153,9 @@ function findItemInTreeItems(list, key, level) { if (item.key === key) return item; - if (item.items && item.items.length > 0) + if (item.children && item.children.length > 0) { - const findedItem = findItemInTreeItems(item.items, key); + const findedItem = findItemInTreeItems(item.children, key); if (findedItem) { parentTree.push(item.key); diff --git a/module/repo/js/common.ui.js b/module/repo/js/common.ui.js index 99f0585840..5fea935ff8 100644 --- a/module/repo/js/common.ui.js +++ b/module/repo/js/common.ui.js @@ -195,9 +195,9 @@ function findItemInTreeItems(list, key, level) { if (item.key === key) return item; - if (item.items && item.items.length > 0) + if (item.children && item.children.length > 0) { - const findedItem = findItemInTreeItems(item.items, key); + const findedItem = findItemInTreeItems(item.children, key); if (findedItem) { parentTree.push(item.key); diff --git a/module/repo/model.php b/module/repo/model.php index 319b825221..b3a28459c5 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -2663,7 +2663,7 @@ class repoModel extends model if($children) { - $treeList[$key]['items'] = $children; + $treeList[$key]['children'] = $children; $fileName[$key] = ''; $pathName[$key] = $file['path']; } diff --git a/module/repo/ui/diffeditor.html.php b/module/repo/ui/diffeditor.html.php index 33a420455c..15c52034cf 100644 --- a/module/repo/ui/diffeditor.html.php +++ b/module/repo/ui/diffeditor.html.php @@ -83,6 +83,7 @@ sidebar ( set::id('monacoTree'), set::items($tree), + set::canSplit(false), set::collapsedIcon('folder'), set::expandedIcon('folder-open'), set::normalIcon('file-text-alt'), @@ -92,3 +93,4 @@ sidebar ); a(set::class('iframe'), setData('size', '1000px'), setData('toggle', 'modal'), set::id('linkObject')); +\a($tree); \ No newline at end of file diff --git a/module/repo/ui/monaco.html.php b/module/repo/ui/monaco.html.php index 40a7f185fc..0189a9f04c 100644 --- a/module/repo/ui/monaco.html.php +++ b/module/repo/ui/monaco.html.php @@ -98,6 +98,7 @@ sidebar ( set::id('monacoTree'), set::items($tree), + set::canSplit(false), set::collapsedIcon('folder'), set::expandedIcon('folder-open'), set::normalIcon('file-text-alt'), diff --git a/module/store/ui/browse.html.php b/module/store/ui/browse.html.php index 192e8a6fd4..9f803619b1 100644 --- a/module/store/ui/browse.html.php +++ b/module/store/ui/browse.html.php @@ -135,6 +135,7 @@ sidebar ( set::id('storeTree'), set::items($tree), + set::canSplit(false), set::onClickItem(jsRaw('window.treeClick')), ) );