diff --git a/lib/zin/wg/productsbox/v1.php b/lib/zin/wg/productsbox/v1.php index be41c669b6..db52b1356f 100644 --- a/lib/zin/wg/productsbox/v1.php +++ b/lib/zin/wg/productsbox/v1.php @@ -60,9 +60,6 @@ class productsBox extends wg return div ( setClass('productsBox'), - on::click('.productsBox .addLine', 'window.addNewLine'), - on::click('.productsBox .removeLine', 'window.removeLine'), - on::change('.productsBox [name^=products]', 'window.loadBranches'), jsVar('multiBranchProducts', data('multiBranchProducts')), jsVar('project', \zget($project, 'id', 0)), jsVar('errorSameProducts', $errorSameProducts), @@ -104,6 +101,7 @@ class productsBox extends wg $hasNewProduct ? set::checkbox(array('text' => $lang->project->addProduct, 'name' => 'addProduct', 'checked' => false)) : false, picker ( + on::change()->call('loadBranches', jsRaw('event')), set::name('products[0]'), set::items($productItems), !empty($project) && empty($project->hasProduct) ? set::value(current(array_keys($productItems))) : null, @@ -148,11 +146,13 @@ class productsBox extends wg setClass('pl-2 flex self-center line-btn c-actions first-action'), btn ( + on::click()->call('addNewLine', jsRaw('event')), setClass('btn btn-link text-gray addLine'), icon('plus') ), btn ( + on::click()->call('removeLine', jsRaw('event')), setClass('btn btn-link text-gray removeLine'), setClass('hidden'), icon('trash') @@ -258,6 +258,7 @@ class productsBox extends wg setClass('grow'), picker ( + on::change()->call('loadBranches', jsRaw('event')), set::name("products[$i]"), set::value($product->id), set::items($productItems), @@ -323,11 +324,13 @@ class productsBox extends wg setClass('pl-2 flex self-center line-btn c-actions', $i == 0 ? 'first-action' : ''), btn ( + on::click()->call('addNewLine', jsRaw('event')), setClass('btn btn-link text-gray addLine'), icon('plus') ), btn ( + on::click()->call('removeLine', jsRaw('event')), setClass('btn btn-link text-gray removeLine'), setClass($i == 0 ? 'hidden' : ''), icon('trash') diff --git a/lib/zin/wg/treemap/v1.php b/lib/zin/wg/treemap/v1.php index 924568ef95..74ed267d45 100644 --- a/lib/zin/wg/treemap/v1.php +++ b/lib/zin/wg/treemap/v1.php @@ -36,7 +36,9 @@ class treemap extends wg 'nodeTemplate?: string', // 节点元素模板。 'onNodeClick?: function', // 节点元素模板。 'afterDrawLines?: function', // 节点元素模板。 - 'afterRender?: function' // 节点元素模板。 + 'afterRender?: function', // 节点元素模板。 + 'onContextMenu?: function', // 上下文菜单事件回调函数。 + 'onReady?: function' // 组件就绪回调函数。 ); protected function build(): array @@ -46,7 +48,7 @@ class treemap extends wg list($width, $height) = $this->prop(array('width', 'height')); $dataVarName = "_treemap_$this->gid"; $treemapPath = $app->getWebRoot() . 'js/zui/treemap/index.html?options=' . $dataVarName; - $options = $this->props->pick(array('hotkeyEnable', 'hotkeys', 'lang', 'langs', 'data', 'nodeTeamplate', 'hSpace', 'vSpace', 'canvasPadding', 'removingNodeTip', 'lineCurvature', 'subLineWidth', 'lineColor', 'lineOpacity', 'lineSaturation', 'lineLightness', 'nodeLineWidth', 'showToggleButton', 'readonly', 'minimap', 'toolbar', 'zoom', 'zoomMax', 'zoomMin', 'minimapHeight', 'onNodeClick', 'afterDrawLines', 'afterRender')); + $options = $this->props->pick(array('hotkeyEnable', 'hotkeys', 'lang', 'langs', 'data', 'nodeTeamplate', 'hSpace', 'vSpace', 'canvasPadding', 'removingNodeTip', 'lineCurvature', 'subLineWidth', 'lineColor', 'lineOpacity', 'lineSaturation', 'lineLightness', 'nodeLineWidth', 'showToggleButton', 'readonly', 'minimap', 'toolbar', 'zoom', 'zoomMax', 'zoomMin', 'minimapHeight', 'onNodeClick', 'afterDrawLines', 'afterRender', 'onReady', 'onContextMenu')); return array ( h::jsVar("window.$dataVarName", $options), diff --git a/module/job/lang/de.php b/module/job/lang/de.php index 53c3b11f57..7aace671d6 100644 --- a/module/job/lang/de.php +++ b/module/job/lang/de.php @@ -96,7 +96,6 @@ $lang->job->paramValueList['$zentao_repopath'] = 'Current version library path'; $lang->job->engineList = array(); $lang->job->engineList[''] = ''; -$lang->job->engineList['gitfox'] = 'GitFox'; $lang->job->engineList['gitlab'] = 'GitLab'; $lang->job->engineList['jenkins'] = 'Jenkins'; diff --git a/module/job/lang/en.php b/module/job/lang/en.php index d23371ab6d..99a6780154 100644 --- a/module/job/lang/en.php +++ b/module/job/lang/en.php @@ -96,7 +96,6 @@ $lang->job->paramValueList['$zentao_repopath'] = 'Current version library path'; $lang->job->engineList = array(); $lang->job->engineList[''] = ''; -$lang->job->engineList['gitfox'] = 'GitFox'; $lang->job->engineList['gitlab'] = 'GitLab'; $lang->job->engineList['jenkins'] = 'Jenkins'; diff --git a/module/job/lang/fr.php b/module/job/lang/fr.php index 6263580daa..b62283f1ce 100644 --- a/module/job/lang/fr.php +++ b/module/job/lang/fr.php @@ -96,7 +96,6 @@ $lang->job->paramValueList['$zentao_repopath'] = 'Current version library path'; $lang->job->engineList = array(); $lang->job->engineList[''] = ''; -$lang->job->engineList['gitfox'] = 'GitFox'; $lang->job->engineList['gitlab'] = 'GitLab'; $lang->job->engineList['jenkins'] = 'Jenkins'; diff --git a/module/job/lang/zh-cn.php b/module/job/lang/zh-cn.php index 6acb20924b..55e06703a5 100644 --- a/module/job/lang/zh-cn.php +++ b/module/job/lang/zh-cn.php @@ -96,7 +96,6 @@ $lang->job->paramValueList['$zentao_repopath'] = '当前版本库路径'; $lang->job->engineList = array(); $lang->job->engineList[''] = ''; -$lang->job->engineList['gitfox'] = 'GitFox'; $lang->job->engineList['gitlab'] = 'GitLab'; $lang->job->engineList['jenkins'] = 'Jenkins'; diff --git a/module/pivot/ui/preview.html.php b/module/pivot/ui/preview.html.php index 3c06625772..4205514469 100644 --- a/module/pivot/ui/preview.html.php +++ b/module/pivot/ui/preview.html.php @@ -19,7 +19,6 @@ if(file_exists($viewFile)) include_once $viewFile; if($this->config->edition != 'open') { $pivotPath = $this->app->getModuleExtPath('pivot', 'ui'); - if($method == 'show') $exportMode = 'preview'; include $pivotPath['common'] . 'exportdata.html.php'; } diff --git a/module/project/zen.php b/module/project/zen.php index b7ef99c41d..da40918566 100755 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -137,6 +137,11 @@ class projectZen extends project private function checkProductAndBranch(object $project, object $rawdata): bool { $linkedProductsCount = $this->project->getLinkedProductsCount($project, $rawdata); + if(!empty($project->parent) && empty($linkedProductsCount)) + { + dao::$errors['products[0]'] = $this->lang->project->errorNoProducts; + return false; + } if(!empty($rawdata->products)) { diff --git a/module/repo/lang/de.php b/module/repo/lang/de.php index 1b14f796ab..2afff666d2 100644 --- a/module/repo/lang/de.php +++ b/module/repo/lang/de.php @@ -177,7 +177,6 @@ $lang->repo->logStyles['D'] = 'Delete'; $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; -$lang->repo->scmList['GitFox'] = 'GitFox'; $lang->repo->scmList['Gitlab'] = 'GitLab'; if(!$config->inQuickon) { diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index 0b85addb62..4df1734a84 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -177,7 +177,6 @@ $lang->repo->logStyles['D'] = 'Delete'; $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; -$lang->repo->scmList['GitFox'] = 'GitFox'; $lang->repo->scmList['Gitlab'] = 'GitLab'; if(!$config->inQuickon) { diff --git a/module/repo/lang/fr.php b/module/repo/lang/fr.php index c7dbf598d9..7f28bda7fc 100644 --- a/module/repo/lang/fr.php +++ b/module/repo/lang/fr.php @@ -177,7 +177,6 @@ $lang->repo->logStyles['D'] = 'Suppression'; $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; -$lang->repo->scmList['GitFox'] = 'GitFox'; $lang->repo->scmList['Gitlab'] = 'GitLab'; if(!$config->inQuickon) { diff --git a/module/repo/lang/zh-cn.php b/module/repo/lang/zh-cn.php index 0db63f3efa..67b510ae57 100644 --- a/module/repo/lang/zh-cn.php +++ b/module/repo/lang/zh-cn.php @@ -177,7 +177,6 @@ $lang->repo->logStyles['D'] = '删除'; $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; -$lang->repo->scmList['GitFox'] = 'GitFox'; $lang->repo->scmList['Gitlab'] = 'GitLab'; if(!$config->inQuickon) { diff --git a/module/space/lang/de.php b/module/space/lang/de.php index 190b9f4d6a..f9497f572c 100644 --- a/module/space/lang/de.php +++ b/module/space/lang/de.php @@ -28,7 +28,6 @@ if($config->inQuickon) $lang->space->featureBar['browse']['running'] = 'Running if($config->inQuickon) $lang->space->featureBar['browse']['stopped'] = 'Stopped'; if($config->inQuickon) $lang->space->featureBar['browse']['abnormal'] = 'Abnormal'; -$lang->space->appType['gitfox'] = 'GitFox'; $lang->space->appType['gitlab'] = 'GitLab'; $lang->space->appType['jenkins'] = 'Jenkins'; $lang->space->appType['sonarqube'] = 'SonarQube'; diff --git a/module/space/lang/en.php b/module/space/lang/en.php index 190b9f4d6a..f9497f572c 100644 --- a/module/space/lang/en.php +++ b/module/space/lang/en.php @@ -28,7 +28,6 @@ if($config->inQuickon) $lang->space->featureBar['browse']['running'] = 'Running if($config->inQuickon) $lang->space->featureBar['browse']['stopped'] = 'Stopped'; if($config->inQuickon) $lang->space->featureBar['browse']['abnormal'] = 'Abnormal'; -$lang->space->appType['gitfox'] = 'GitFox'; $lang->space->appType['gitlab'] = 'GitLab'; $lang->space->appType['jenkins'] = 'Jenkins'; $lang->space->appType['sonarqube'] = 'SonarQube'; diff --git a/module/space/lang/fr.php b/module/space/lang/fr.php index 190b9f4d6a..f9497f572c 100644 --- a/module/space/lang/fr.php +++ b/module/space/lang/fr.php @@ -28,7 +28,6 @@ if($config->inQuickon) $lang->space->featureBar['browse']['running'] = 'Running if($config->inQuickon) $lang->space->featureBar['browse']['stopped'] = 'Stopped'; if($config->inQuickon) $lang->space->featureBar['browse']['abnormal'] = 'Abnormal'; -$lang->space->appType['gitfox'] = 'GitFox'; $lang->space->appType['gitlab'] = 'GitLab'; $lang->space->appType['jenkins'] = 'Jenkins'; $lang->space->appType['sonarqube'] = 'SonarQube'; diff --git a/module/space/lang/zh-cn.php b/module/space/lang/zh-cn.php index 69ed7b9ed5..d7e9f0ffe2 100644 --- a/module/space/lang/zh-cn.php +++ b/module/space/lang/zh-cn.php @@ -28,7 +28,6 @@ if($config->inQuickon) $lang->space->featureBar['browse']['running'] = '运行 if($config->inQuickon) $lang->space->featureBar['browse']['stopped'] = '已关闭'; if($config->inQuickon) $lang->space->featureBar['browse']['abnormal'] = '异常'; -$lang->space->appType['gitfox'] = 'GitFox'; $lang->space->appType['gitlab'] = 'GitLab'; $lang->space->appType['jenkins'] = 'Jenkins'; $lang->space->appType['sonarqube'] = 'SonarQube'; diff --git a/www/js/mindmap/index.html b/www/js/mindmap/index.html index eeb69174ee..100bdbbbdc 100644 --- a/www/js/mindmap/index.html +++ b/www/js/mindmap/index.html @@ -29,6 +29,7 @@ if(!options.manual) $('#mindmap').mindmap(options); parent.createMindmap = function(userOptions){return $('#mindmap').mindmap($.extend({}, options, userOptions)).data('zui.mindmap');}; parent.getMindmap = function(){return $('#mindmap').data('zui.mindmap');}; parent.mindmap$ = $; +$('body').on('click', () => window.parent.$(window.frameElement).trigger('click')); diff --git a/www/js/zui/treemap/index.html b/www/js/zui/treemap/index.html index 057ecda922..dfd936ede0 100644 --- a/www/js/zui/treemap/index.html +++ b/www/js/zui/treemap/index.html @@ -25,6 +25,28 @@ window.parent.$(function() $('#treemap').treemap($.extend({}, window.parent[$.getSearchParam('options')])); const treemap = $('#treemap').data('zui.treemap'); window.parent.getTreemap = function() {return treemap;}; + if(treemap.options.onReady) treemap.options.onReady(treemap, window); + $('body').on('click', () => window.parent.$(window.frameElement).trigger('click')); + if(treemap.options.onContextMenu) + { + treemap.$nodes.on('contextmenu', function(e) + { + const $node = $(e.target).closest('.treemap-node'); + const node = $node.data('node'); + const frameBounding = window.frameElement.getBoundingClientRect(); + const clientX = e.clientX + frameBounding.left; + const clientY = e.clientY + frameBounding.top; + let result = treemap.options.onContextMenu({node: node, clientX: clientX, clientY: clientY, treemap: treemap, event: e}); + if(!result) return; + if(Array.isArray(result)) result = {items: result}; + window.parent.zui.ContextMenu.show($.extend( + { + element: {getBoundingClientRect: () => ({x: clientX, y: clientY, width: 0, height: 0, left: clientX, top: clientY})}, + }, result)); + e.preventDefault(); + return false; + }); + } });